Skip to content

Commit f115187

Browse files
feat: add static method from_rh_plane to DFPose
1 parent 090244d commit f115187

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/gh/diffCheck/diffCheck/df_poses.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ class DFPose:
2222
xDirection: list
2323
yDirection: list
2424

25+
@staticmethod
26+
def from_rh_plane(rh_plane):
27+
"""
28+
Create a DFPose object from a Rhino Plane object.
29+
30+
:param rh_plane: the Rhino Plane to convert
31+
:return: a DFPose object representing the same pose as the input Rhino Plane
32+
"""
33+
return DFPose(
34+
origin = [rh_plane.Origin.X, rh_plane.Origin.Y, rh_plane.Origin.Z],
35+
xDirection = [rh_plane.XAxis.X, rh_plane.XAxis.Y, rh_plane.XAxis.Z],
36+
yDirection = [rh_plane.YAxis.X, rh_plane.YAxis.Y, rh_plane.YAxis.Z])
37+
2538
def to_rh_plane(self):
2639
"""
2740
Convert the pose to a Rhino Plane object.

0 commit comments

Comments
 (0)