Skip to content

Commit

Permalink
allow Rhino.Geometry.Point
Browse files Browse the repository at this point in the history
  • Loading branch information
Licini committed Apr 29, 2024
1 parent c2516e9 commit 8283d74
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/compas_rhino/conversions/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,19 @@ def point_to_compas(point):
Parameters
----------
point : :rhino:`Rhino.Geometry.Point3d`
point : :rhino:`Rhino.Geometry.Point3d` | :rhino:`Rhino.Geometry.Point`
Returns
-------
:class:`compas.geometry.Point`
"""
return Point(point.X, point.Y, point.Z)
if isinstance(point, Rhino.Geometry.Point3d):
return Point(point.X, point.Y, point.Z)
elif isinstance(point, Rhino.Geometry.Point):
return Point(point.Location.X, point.Location.Y, point.Location.Z)
else:
raise TypeError("Expected Rhino.Geometry.Point3d or Rhino.Geometry.Point., got: {}".format(type(point)))


def vector_to_compas(vector):
Expand Down

0 comments on commit 8283d74

Please sign in to comment.