@@ -42,25 +42,25 @@ class RhinoNurbsCurve(NurbsCurve):
4242
4343 Attributes
4444 ----------
45- points: List[ Point]
45+ points: list of :class:`compas.geometry. Point`
4646 The control points of the curve.
47- weights: List[ float]
47+ weights: list of float
4848 The weights of the control points.
49- knots: List[ float]
49+ knots: list of float
5050 The knot vector, without duplicates.
51- multiplicities: List[ int]
51+ multiplicities: list of int
5252 The multiplicities of the knots in the knot vector.
53- knotsequence: List[ float]
53+ knotsequence: list of float
5454 The knot vector, with repeating values according to the multiplicities.
5555 degree: int
5656 The degree of the polynomials.
5757 order: int
5858 The order of the curve.
59- domain: Tuple[float, float]
59+ domain: tuple of float
6060 The parameter domain.
61- start: :class:`Point`
61+ start: :class:`compas.geometry. Point`
6262 The point corresponding to the start of the parameter domain.
63- end: :class:`Point`
63+ end: :class:`compas.geometry. Point`
6464 The point corresponding to the end of the parameter domain.
6565 is_closed: bool
6666 True if the curve is closed.
@@ -123,34 +123,66 @@ def data(self, data):
123123
124124 @classmethod
125125 def from_rhino (cls , rhino_curve ):
126- """Construct a NURBS curve from an existing Rhino BSplineCurve."""
126+ """Construct a NURBS curve from an existing Rhino curve.
127+
128+ Parameters
129+ ----------
130+ rhino_curve : Rhino.Geometry.NurbsCurve
131+
132+ Returns
133+ -------
134+ :class:`compas_rhino.geometry.RhinoNurbsCurve`
135+
136+ """
127137 curve = cls ()
128138 curve .rhino_curve = rhino_curve
129139 return curve
130140
131141 @classmethod
132- def from_parameters (cls ,
133- points ,
134- weights ,
135- knots ,
136- multiplicities ,
137- degree ,
138- is_periodic = False ):
139- """Construct a NURBS curve from explicit curve parameters."""
142+ def from_parameters (cls , points , weights , knots , multiplicities , degree , is_periodic = False ):
143+ """Construct a NURBS curve from explicit curve parameters.
144+
145+ Parameters
146+ ----------
147+ points : list of :class:`compas.geometry.Point`
148+ The control points.
149+ weights : list of float
150+ The control point weights.
151+ knots : list of float
152+ The curve knots, without duplicates.
153+ multiplicities : list of int
154+ The multiplicities of the knots.
155+ degree : int
156+ The degree of the curve.
157+ is_periodic : bool, optional
158+ Flag indicating whether the curve is periodic or not.
159+ Note that this parameters is currently not supported.
160+
161+ Returns
162+ -------
163+ :class:`compas_rhino.geometry.RhinoNurbsCurve`
164+
165+ """
140166 curve = cls ()
141- # set periodicity => aparently not possible
142167 curve .rhino_curve = rhino_curve_from_parameters (points , weights , knots , multiplicities , degree )
143168 return curve
144169
145170 @classmethod
146171 def from_points (cls , points , degree = 3 , is_periodic = False ):
147172 """Construct a NURBS curve from control points.
148173
149- This construction method is similar to the method ``Create`` of the Rhino API for NURBS curves [1]_.
150-
151- References
174+ Parameters
152175 ----------
153- .. [1] https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_NurbsCurve_Create.htm
176+ points : list of :class:`compas.geometry.Point`
177+ The control points.
178+ degree : int
179+ The degree of the curve.
180+ is_periodic : bool, optional
181+ Flag indicating whether the curve is periodic or not.
182+
183+ Returns
184+ -------
185+ :class:`compas_rhino.geometry.RhinoNurbsCurve`
154186
155187 """
156188 points [:] = [point_to_rhino (point ) for point in points ]
@@ -162,12 +194,17 @@ def from_points(cls, points, degree=3, is_periodic=False):
162194 def from_interpolation (cls , points , precision = 1e-3 ):
163195 """Construct a NURBS curve by interpolating a set of points.
164196
165- This construction method is similar to the method ``CreateHSpline`` of the Rhino API for NURBS curves [1]_.
166-
167- References
197+ Parameters
168198 ----------
169- .. [1] https://developer.rhino3d.com/api/RhinoCommon/html/Overload_Rhino_Geometry_NurbsCurve_CreateHSpline.htm
170- .. [2] https://dev.opencascade.org/doc/occt-7.4.0/refman/html/class_geom_a_p_i___interpolate.html
199+ points : list of :class:`compas.geometry.Point`
200+ The control points.
201+ precision : float, optional
202+ The required precision of the interpolation.
203+ This parameter is currently not supported.
204+
205+ Returns
206+ -------
207+ :class:`compas_rhino.geometry.RhinoNurbsCurve`
171208
172209 """
173210 curve = cls ()
@@ -183,11 +220,14 @@ def from_step(cls, filepath):
183220 def from_arc (cls , arc ):
184221 """Construct a NURBS curve from an arc.
185222
186- This construction method is similar to the method ``CreateFromArc`` of the Rhino API for NURBS curves [1]_.
187-
188- References
223+ Parameters
189224 ----------
190- .. [1] https://developer.rhino3d.com/api/RhinoCommon/html/Overload_Rhino_Geometry_NurbsCurve_CreateFromArc.htm
225+ arc : :class:`compas.geometry.Arc`
226+ An arc geometry.
227+
228+ Returns
229+ -------
230+ :class:`compas_rhino.geometry.RhinoNurbsCurve`
191231
192232 """
193233 # curve = cls()
@@ -199,11 +239,14 @@ def from_arc(cls, arc):
199239 def from_circle (cls , circle ):
200240 """Construct a NURBS curve from a circle.
201241
202- This construction method is similar to the method ``CreateFromCircle`` of the Rhino API for NURBS curves [1]_.
203-
204- References
242+ Parameters
205243 ----------
206- .. [1] https://developer.rhino3d.com/api/RhinoCommon/html/Overload_Rhino_Geometry_NurbsCurve_CreateFromCircle.htm
244+ circle : :class:`compas.geometry.Circle`
245+ A circle geometry.
246+
247+ Returns
248+ -------
249+ :class:`compas_rhino.geometry.RhinoNurbsCurve`
207250
208251 """
209252 curve = cls ()
@@ -214,11 +257,14 @@ def from_circle(cls, circle):
214257 def from_ellipse (cls , ellipse ):
215258 """Construct a NURBS curve from an ellipse.
216259
217- This construction method is similar to the method ``CreateFromEllipse`` of the Rhino API for NURBS curves [1]_.
218-
219- References
260+ Parameters
220261 ----------
221- .. [1] https://developer.rhino3d.com/api/RhinoCommon/html/Overload_Rhino_Geometry_NurbsCurve_CreateFromEllipse.htm
262+ ellipse : :class:`compas.geometry.Ellipse`
263+ An ellipse geometry.
264+
265+ Returns
266+ -------
267+ :class:`compas_rhino.geometry.RhinoNurbsCurve`
222268
223269 """
224270 curve = cls ()
@@ -229,11 +275,14 @@ def from_ellipse(cls, ellipse):
229275 def from_line (cls , line ):
230276 """Construct a NURBS curve from a line.
231277
232- This construction method is similar to the method ``CreateFromLine`` of the Rhino API for NURBS curves [1]_.
233-
234- References
278+ Parameters
235279 ----------
236- .. [1] https://developer.rhino3d.com/api/RhinoCommon/html/Overload_Rhino_Geometry_NurbsCurve_CreateFromLine.htm
280+ line : :class:`compas.geometry.Line`
281+ A line geometry.
282+
283+ Returns
284+ -------
285+ :class:`compas_rhino.geometry.RhinoNurbsCurve`
237286
238287 """
239288 curve = cls ()
0 commit comments