1515
1616
1717class RhinoBrepEdge (BrepEdge ):
18- """A wrapper for Rhino.Geometry.BrepEdge
18+ """A wrapper for Rhino.Geometry.BrepEdge.
19+
20+ The expected native type here is a Rhino.Geometry.BrepTrim.
21+ a BrepTrim holds a reference to its associated BrepEdge as well as its start a end vertices
22+ in a correct topological order (!).
1923
2024 Attributes
2125 ----------
2226 curve : :class:`Rhino.Geometry.Curve3D`
2327 The underlying geometry of this edge.
2428 start_vertex : :class:`~compas_rhino.geometry.RhinoBrepVertex`, read-only
25- The start vertex of this edge.
29+ The start vertex of this edge (taken from BrepTrim) .
2630 end_vertex : :class:`~compas_rhino.geometry.RhinoBrepVertex`, read-only
27- The end vertex of this edge.
31+ The end vertex of this edge (taken from BrepTrim) .
2832 vertices : list[:class:`~compas_rhino.geometry.RhinoBrepVertex`], read-only
2933 The list of vertices which comprise this edge (start and end)
3034 is_circle : bool, read-only
@@ -34,22 +38,20 @@ class RhinoBrepEdge(BrepEdge):
3438
3539 """
3640
37- def __init__ (self , rhino_edge = None ):
41+ def __init__ (self , rhino_trim = None ):
3842 super (RhinoBrepEdge , self ).__init__ ()
3943 self ._edge = None
4044 self ._curve = None
41- self .start_vertex = None
42- self .end_vertex = None
43- if rhino_edge :
44- self ._set_edge (rhino_edge )
45-
46- def _set_edge (self , native_edge ):
47- print ("creating Edge object. nativ:{}" .format (native_edge ))
48- self ._edge = native_edge
45+ self ._start_vertex = None
46+ self ._end_vertex = None
47+ if rhino_trim :
48+ self ._set_edge (rhino_trim )
49+
50+ def _set_edge (self , rhino_trim ):
51+ self ._edge = rhino_trim .Edge
4952 self ._curve = self ._edge .EdgeCurve
50- # print("creating Edge object. StartVertex:{} EndVertex:{}".format(self._edge.StartVertex.Location, self._edge.EndVertex.Location))
51- # self._curve_start = RhinoBrepVertex(self._edge.StartVertex)
52- # self._curve_end = RhinoBrepVertex(self._edge.EndVertex)
53+ self ._start_vertex = RhinoBrepVertex (rhino_trim .StartVertex )
54+ self ._end_vertex = RhinoBrepVertex (rhino_trim .EndVertex )
5355
5456 # ==============================================================================
5557 # Data
@@ -91,9 +93,9 @@ def data(self, value):
9193 else :
9294 self ._curve = RhinoNurbsCurve .from_data (value ["value" ]).rhino_curve
9395
94- self .start_vertex , self .end_vertex = RhinoBrepVertex (), RhinoBrepVertex ()
95- self .start_vertex ._point = Point .from_data (value ["points" ][0 ])
96- self .end_vertex ._point = Point .from_data (value ["points" ][1 ])
96+ self ._start_vertex , self ._end_vertex = RhinoBrepVertex (), RhinoBrepVertex ()
97+ self ._start_vertex ._point = Point .from_data (value ["points" ][0 ])
98+ self ._end_vertex ._point = Point .from_data (value ["points" ][1 ])
9799
98100 # ==============================================================================
99101 # Properties
@@ -103,13 +105,13 @@ def data(self, value):
103105 def curve (self ):
104106 return self ._curve
105107
106- # @property
107- # def start_vertex(self):
108- # return self._start_vertex
109- #
110- # @property
111- # def end_vertex(self):
112- # return self._end_vertex
108+ @property
109+ def start_vertex (self ):
110+ return self ._start_vertex
111+
112+ @property
113+ def end_vertex (self ):
114+ return self ._end_vertex
113115
114116 @property
115117 def vertices (self ):
0 commit comments