File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
src/compas_rhino/conversions Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3434* Changed use of ` compas.geometry.allclose ` to ` compas.tolerance.TOL.is_allclose ` .
3535* Changed use of ` compas.geometry.close ` to ` compas.tolerance.TOL.is_close ` .
3636* Changed imports of itertools to ` compas.itertools ` instead of ` compas.utilities ` .
37- * Updated ` compas_rhino.conversions.point_to_compas ` to allow for ` compas.geometry .Point` as input.
37+ * Updated ` compas_rhino.conversions.point_to_compas ` to allow for ` Rhino.Geometry .Point` as input.
3838
3939### Removed
4040
Original file line number Diff line number Diff line change 33from __future__ import print_function
44
55import Rhino # type: ignore
6+ from System import MissingMemberException # type: ignore
67
78from compas .geometry import Frame
89from compas .geometry import Plane
@@ -110,12 +111,13 @@ def point_to_compas(point):
110111 :class:`compas.geometry.Point`
111112
112113 """
113- if isinstance ( point , Rhino . Geometry . Point3d ) :
114+ try :
114115 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 )))
116+ except MissingMemberException :
117+ try :
118+ return Point (point .Location .X , point .Location .Y , point .Location .Z )
119+ except MissingMemberException :
120+ raise TypeError ("Unexpected point type, got: {}" .format (type (point )))
119121
120122
121123def vector_to_compas (vector ):
You can’t perform that action at this time.
0 commit comments