Skip to content

Commit f68bf2d

Browse files
committed
revived Rhino brep serialization
1 parent 4813826 commit f68bf2d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/compas_rhino/geometry/brep/face.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def _get_surface_geometry(surface):
208208
if isinstance(surface, Rhino.Geometry.NurbsSurface):
209209
_, plane = surface.FrameAt(0.0, 0.0)
210210
return "nurbs", RhinoNurbsSurface.from_rhino(surface), uv_domain, plane
211-
if isinstance(surface, Rhino.Geometry.Rhino.Geometry.RevSurface):
211+
if isinstance(surface, Rhino.Geometry.RevSurface):
212212
success, cast_surface = surface.TryGetSphere()
213213
if success:
214214
return "sphere", sphere_to_compas(cast_surface), uv_domain, cast_surface.EquatorialPlane

src/compas_rhino/geometry/brep/trim.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ def __from_data__(cls, data, builder):
7777
"""
7878
instance = cls()
7979
curve = RhinoNurbsCurve.__from_data__(data["curve"]).rhino_curve
80-
iso_status = getattr(Rhino.Geometry.IsoStatus, data["iso"])
80+
try:
81+
iso_status = getattr(Rhino.Geometry.IsoStatus, data["iso"])
82+
except AttributeError:
83+
# due to discrepency in how IsoStatus.None looks like in Rhino7 vs Rhino8 (`IsoStatus.NONE`)
84+
iso_status = Rhino.Geometry.IsoStatus.NONE
8185
is_reversed = True if data["is_reversed"] == "true" else False
8286
instance.native_trim = builder.add_trim(curve, data["edge"], is_reversed, iso_status, data["start_vertex"])
8387
return instance

0 commit comments

Comments
 (0)