Skip to content

Commit cef4d01

Browse files
committed
add conversion error
1 parent 4ba76f4 commit cef4d01

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/compas_rhino/conversions/surface.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from ._primitives import point_to_compas
1313

1414
from ._geometry import RhinoGeometry
15+
from ._exceptions import ConversionError
1516

1617

1718
class RhinoSurface(RhinoGeometry):
@@ -46,13 +47,18 @@ def to_compas(self):
4647
Returns
4748
-------
4849
:class:`compas_rhino.geometry.RhinoNurbsSurface`
50+
51+
Raises
52+
------
53+
:class:`ConversionError`
54+
If the surface BRep contains more than one face.
4955
"""
5056
from compas.geometry import NurbsSurface
5157

5258
brep = Rhino.Geometry.Brep.TryConvertBrep(self.geometry)
5359
surface = NurbsSurface()
5460
if brep.Surfaces.Count > 1:
55-
raise Exception('Conversion of a BRep with multiple underlying surface is currently not supported.')
61+
raise ConversionError('Conversion of a BRep with multiple underlying surface is currently not supported.')
5662
for geometry in brep.Surfaces:
5763
surface.rhino_surface = geometry
5864
break

0 commit comments

Comments
 (0)