Skip to content

Commit c032a0d

Browse files
committed
fix bugs in curve and surface conversions
1 parent 2a01552 commit c032a0d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5151
* Fixed `compas_blender.artists.VolMeshArtist.draw` and `compas_blender.artists.VolMeshArtist.draw_cells`.
5252
* Fixed `compas_ghpython.artists.VolMeshArtist.draw` and `compas_ghpython.artists.VolMeshArtist.draw_cells`.
5353
* Fixed `compas_rhino.artists.VolMeshArtist.draw` and `compas_rhino.artists.VolMeshArtist.draw_cells`.
54+
* Fixed bug in `compas_rhino.conversions.RhinoCurve.to_compas`.
55+
* Fixed bug in `compas_rhino.conversions.RhinoSurface.to_compas`.
5456

5557
### Removed
5658

src/compas_rhino/conversions/curve.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ def to_compas(self):
6060
-------
6161
:class:`~compas_rhino.geometry.RhinoNurbsCurve`
6262
"""
63-
from compas.geometry import NurbsCurve
64-
curve = NurbsCurve()
65-
curve.rhino_curve = self.geometry
63+
from compas_rhino.geometry import RhinoNurbsCurve
64+
curve = RhinoNurbsCurve.from_rhino(self.geometry)
6665
return curve
6766

6867
def to_compas_circle(self):

src/compas_rhino/conversions/surface.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def geometry(self, geometry):
3535
------
3636
:class:`ConversionError`
3737
If the geometry cannot be converted to a surface.
38+
3839
"""
3940
if not isinstance(geometry, Rhino.Geometry.Surface):
4041
if not isinstance(geometry, Rhino.Geometry.Brep):
@@ -52,17 +53,15 @@ def to_compas(self):
5253
------
5354
:class:`ConversionError`
5455
If the surface BRep contains more than one face.
56+
5557
"""
56-
from compas.geometry import NurbsSurface
58+
from compas_rhino.geometry import RhinoNurbsSurface
5759

5860
brep = Rhino.Geometry.Brep.TryConvertBrep(self.geometry)
59-
surface = NurbsSurface()
6061
if brep.Surfaces.Count > 1:
6162
raise ConversionError('Conversion of a BRep with multiple underlying surface is currently not supported.')
6263
for geometry in brep.Surfaces:
63-
surface.rhino_surface = geometry
64-
break
65-
return surface
64+
return RhinoNurbsSurface.from_rhino(geometry)
6665

6766
def to_compas_mesh(self, cls=None, facefilter=None, cleanup=False):
6867
"""Convert the surface b-rep loops to a COMPAS mesh.

0 commit comments

Comments
 (0)