@@ -94,6 +94,11 @@ def end_points(self):
9494 def is_valid (self ):
9595 """
9696 Is the current entity valid.
97+
98+ Returns
99+ -----------
100+ valid : bool
101+ Is the current entity well formed
97102 """
98103 return True
99104
@@ -183,25 +188,36 @@ def discrete(self, vertices, scale=1.0):
183188
184189 Parameters
185190 ------------
186- vertices: (n, dimension) float, points in space
187- scale: float, size of overall scene for numerical comparisons
191+ vertices: (n, dimension) float
192+ Points in space
193+ scale : float
194+ Size of overall scene for numerical comparisons
188195
189196 Returns
190197 -------------
191- discrete: (m, dimension) float, linear path in space
198+ discrete: (m, dimension) float
199+ Path in space composed of line segments
192200 """
193201 discrete = self ._orient (vertices [self .points ])
194202 return discrete
195203
196204 @property
197205 def is_valid (self ):
206+ """
207+ Is the current entity valid.
208+
209+ Returns
210+ -----------
211+ valid : bool
212+ Is the current entity well formed
213+ """
198214 valid = np .any ((self .points - self .points [0 ]) != 0 )
199215 return valid
200216
201217 def explode (self ):
202218 """
203- If the current Line entity consists of multiple lines, break it
204- up into n Line entities.
219+ If the current Line entity consists of multiple line
220+ break it up into n Line entities.
205221
206222 Returns
207223 ----------
@@ -223,16 +239,38 @@ def closed(self):
223239
224240 Returns
225241 ----------
226- closed: bool, if true arc will be a closed circle in space
242+ closed : bool
243+ If set True, Arc will be a closed circle
227244 """
228245 if hasattr (self , '_closed' ):
229246 return self ._closed
230247 return False
231248
232249 @closed .setter
233250 def closed (self , value ):
251+ """
252+ Set the Arc to be closed or not, without
253+ changing the control points
254+
255+ Parameters
256+ ------------
257+ value : bool
258+ Should this Arc be a closed circle or not
259+ """
234260 self ._closed = bool (value )
235261
262+ @property
263+ def is_valid (self ):
264+ """
265+ Is the current Arc entity valid.
266+
267+ Returns
268+ -----------
269+ valid : bool
270+ Does the current Arc have exactly 3 control points
271+ """
272+ return len (np .unique (self .points )) == 3
273+
236274 def _bytes (self ):
237275 hashable = (self .__class__ .__name__ .encode ('utf-8' ) +
238276 bytes (bool (self .closed )) +
@@ -307,7 +345,9 @@ def bounds(self, vertices):
307345
308346
309347class Curve (Entity ):
310-
348+ """
349+ The parent class for all wild curves in space.
350+ """
311351 @property
312352 def nodes (self ):
313353 return [[self .points [0 ],
@@ -317,15 +357,38 @@ def nodes(self):
317357
318358
319359class Bezier (Curve ):
360+ """
361+ An open or closed Bezier curve
362+ """
320363
321364 def discrete (self , vertices , scale = 1.0 , count = None ):
365+ """
366+ Discretize the Bezier curve.
367+
368+ Parameters
369+ -------------
370+ vertices : (n, 2) or (n, 3) float
371+ Points in space
372+ scale : float
373+ Scale of overall drawings (for precision)
374+ count : int
375+ Number of segments to reurn
376+
377+ Returns
378+ -------------
379+ discrete : (m, 2) or (m, 3) float
380+ Curve as line segments
381+ """
322382 discrete = discretize_bezier (vertices [self .points ],
323383 count = count ,
324384 scale = scale )
325385 return self ._orient (discrete )
326386
327387
328388class BSpline (Curve ):
389+ """
390+ An open or closed B- Spline.
391+ """
329392
330393 def __init__ (self , points ,
331394 knots ,
@@ -338,6 +401,23 @@ def __init__(self, points,
338401 self .kwargs = kwargs
339402
340403 def discrete (self , vertices , count = None , scale = 1.0 ):
404+ """
405+ Discretize the B-Spline curve.
406+
407+ Parameters
408+ -------------
409+ vertices : (n, 2) or (n, 3) float
410+ Points in space
411+ scale : float
412+ Scale of overall drawings (for precision)
413+ count : int
414+ Number of segments to reurn
415+
416+ Returns
417+ -------------
418+ discrete : (m, 2) or (m, 3) float
419+ Curve as line segments
420+ """
341421 discrete = discretize_bspline (
342422 control = vertices [self .points ],
343423 knots = self .knots ,
0 commit comments