Skip to content

Commit 8527872

Browse files
authored
Merge pull request #1466 from compas-dev/brep_serialization
Brep serialization
2 parents 7983c1c + 1f48e8d commit 8527872

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
* Fixed error in `circle_to_compas` from Rhino.
15+
* Fixed Rhino to Rhino brep serialization.
16+
1417
### Removed
1518

1619

src/compas_rhino/conversions/curves.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def circle_to_compas(circle):
215215
:class:`compas.geometry.Circle`
216216
217217
"""
218-
frame = plane_to_compas(circle.Plane)
218+
frame = plane_to_compas_frame(circle.Plane)
219219
return Circle(circle.Radius, frame=frame)
220220

221221

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 discrepancy 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)