Skip to content

Commit 3f193fb

Browse files
committed
2nd level import for BrepTrim.
1 parent 164b11d commit 3f193fb

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

src/compas/geometry/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
BrepEdge
8787
BrepLoop
8888
BrepFace
89+
BrepTrim
90+
BrepTrimIsoStatus
8991
9092
BrepType
9193
BrepOrientation
@@ -892,6 +894,8 @@
892894
BrepFace,
893895
BrepLoop,
894896
BrepEdge,
897+
BrepTrim,
898+
BrepTrimIsoStatus,
895899
BrepType,
896900
BrepOrientation,
897901
BrepError,
@@ -1202,6 +1206,8 @@
12021206
"BrepEdge",
12031207
"BrepVertex",
12041208
"BrepFace",
1209+
"BrepTrim",
1210+
"BrepTrimIsoStatus",
12051211
"BrepType",
12061212
"BrepOrientation",
12071213
"BrepError",

src/compas/geometry/brep/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from .loop import BrepLoop
66
from .face import BrepFace
77
from .vertex import BrepVertex
8+
from .trim import BrepTrim
9+
from .trim import BrepTrimIsoStatus
810

911

1012
class BrepError(Exception):
@@ -31,6 +33,8 @@ class BrepTrimmingError(BrepError):
3133
"BrepLoop",
3234
"BrepFace",
3335
"BrepVertex",
36+
"BrepTrim",
37+
"BrepTrimIsoStatus",
3438
"BrepOrientation",
3539
"BrepType",
3640
"BrepError",

src/compas/geometry/brep/trim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from compas.data import Data
22

33

4-
class TrimIsoStatus(object):
4+
class BrepTrimIsoStatus(object):
55
"""An enumeration of isoparametric curve direction on the surface."""
66
NONE = 0
77
X = 1

src/compas_rhino/geometry/brep/builder.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from compas.geometry import BrepInvalidError
12
from compas_rhino.conversions import point_to_rhino
23

34

@@ -7,11 +8,6 @@
78
TOLERANCE = 1e-6
89

910

10-
class BrepReconstructionError(BaseException):
11-
"""Indicates that the Brep reconstruction operation has resulted with an invalid Brep."""
12-
pass
13-
14-
1511
class RhinoLoopBuilder(object):
1612
"""Builds a Brep loop.
1713
@@ -96,7 +92,14 @@ def add_loop(self, loop_type):
9692

9793

9894
class RhinoBrepBuilder(object):
99-
"""Reconstructs a Rhino.Geometry.Brep from COMPAS types"""
95+
"""Reconstructs a Rhino.Geometry.Brep from COMPAS types
96+
97+
Attributes
98+
==========
99+
result : :rhino:`Rhino.Geometry.Brep`
100+
The Brep resulting from the reconstruction, if successful.
101+
102+
"""
100103

101104
def __init__(self):
102105
self._instance = Rhino.Geometry.Brep()
@@ -105,7 +108,7 @@ def __init__(self):
105108
def result(self):
106109
is_valid, log = self._instance.IsValidWithLog()
107110
if not is_valid:
108-
raise BrepReconstructionError("Brep reconstruction failed!\n{}".format(log))
111+
raise BrepInvalidError("Brep reconstruction failed!\n{}".format(log))
109112
return self._instance
110113

111114
def add_vertex(self, point):
@@ -152,7 +155,7 @@ def add_face(self, surface):
152155
Returns
153156
=======
154157
:class:`compas_rhino.geometry.RhinoFaceBuilder`
155-
158+
156159
"""
157160
surface_index = self._instance.AddSurface(surface.rhino_surface)
158161
face = self._instance.Faces.Add(surface_index)

0 commit comments

Comments
 (0)