Skip to content

Commit 8283d74

Browse files
committed
allow Rhino.Geometry.Point
1 parent c2516e9 commit 8283d74

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/compas_rhino/conversions/geometry.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,19 @@ def point_to_compas(point):
103103
104104
Parameters
105105
----------
106-
point : :rhino:`Rhino.Geometry.Point3d`
106+
point : :rhino:`Rhino.Geometry.Point3d` | :rhino:`Rhino.Geometry.Point`
107107
108108
Returns
109109
-------
110110
:class:`compas.geometry.Point`
111111
112112
"""
113-
return Point(point.X, point.Y, point.Z)
113+
if isinstance(point, Rhino.Geometry.Point3d):
114+
return Point(point.X, point.Y, point.Z)
115+
elif isinstance(point, Rhino.Geometry.Point):
116+
return Point(point.Location.X, point.Location.Y, point.Location.Z)
117+
else:
118+
raise TypeError("Expected Rhino.Geometry.Point3d or Rhino.Geometry.Point., got: {}".format(type(point)))
114119

115120

116121
def vector_to_compas(vector):

0 commit comments

Comments
 (0)