Skip to content

Commit 164b11d

Browse files
committed
added docstrings
1 parent 83c38d6 commit 164b11d

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

src/compas_rhino/geometry/brep/builder.py

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,20 @@ def add_trim(self, curve, edge_index, is_reversed, iso_status):
3030
3131
Parameters
3232
==========
33-
curve:
33+
curve : :rhino:`Rhino.Geometry.NurbsCurve`
34+
The curve representing the geometry of this trim.
35+
edge_index : int
36+
The index of the already added edge which corresponds with this trim.
37+
is_reversed : bool
38+
True if this trim is reversed in direction from its associated edge.
39+
iso_status : :rhino:`Rhino.Geometry.IsoStatus`
40+
The iso status of this trim.
41+
42+
Returns
43+
=======
44+
:rhino:`Rhino.Geometry.BrepTrim`
45+
The newly added BrepTrim instance.
46+
3447
"""
3548
c_index = self.instance.AddTrimCurve(curve)
3649
edge = self.instance.Edges[edge_index]
@@ -45,6 +58,16 @@ def result(self):
4558

4659

4760
class RhinoFaceBuilder(object):
61+
"""Builds a BrepFace.
62+
63+
Serves as context for reconstructing the loop elements associated with this face.
64+
65+
Attributes
66+
==========
67+
result : :rhino:`Rhino.Geometry.BrepFace`
68+
The resulting BrepFace.
69+
70+
"""
4871
def __init__(self, face=None, instance=None):
4972
self.face = face
5073
self.instance = instance
@@ -54,6 +77,20 @@ def result(self):
5477
return self.face
5578

5679
def add_loop(self, loop_type):
80+
"""Add a new loop to this face.
81+
82+
Returns a new builder to be used by all the trims of the newly added loop.
83+
84+
Parameters
85+
==========
86+
loop_type : :rhino:`Rhino.Geometry.BrepLoopType`
87+
The enumeration value representing the type of this loop.
88+
89+
Returns
90+
=======
91+
:class:`compas_rhino.geometry.RhinoLoopBuilder`
92+
93+
"""
5794
loop = self.instance.Loops.Add(loop_type, self.face)
5895
return RhinoLoopBuilder(loop, self.instance)
5996

@@ -103,6 +140,20 @@ def add_edge(self, edge_curve, start_vertex, end_vertex):
103140
return self._instance.Edges.Add(s_vertex, e_vertex, curve_index, TOLERANCE)
104141

105142
def add_face(self, surface):
143+
"""Creates and adds a new face to the brep.
144+
145+
Returns a new builder to be used by all the loops related to his new face to add themselves.
146+
147+
Parameters
148+
==========
149+
surface : :rhino:`Rhino.Geometry.Surface`
150+
The surface of this face.
151+
152+
Returns
153+
=======
154+
:class:`compas_rhino.geometry.RhinoFaceBuilder`
155+
156+
"""
106157
surface_index = self._instance.AddSurface(surface.rhino_surface)
107158
face = self._instance.Faces.Add(surface_index)
108159
return RhinoFaceBuilder(face=face, instance=self._instance)

0 commit comments

Comments
 (0)