@@ -356,7 +356,7 @@ def from_step(cls, filepath):
356356 raise NotImplementedError
357357
358358 @classmethod
359- def from_fill (cls , curve1 , curve2 , curve3 = None , curve4 = None , scheme = 'stretch' ):
359+ def from_fill (cls , curve1 , curve2 , curve3 = None , curve4 = None , style = 'stretch' ):
360360 """Construct a NURBS surface from the infill between two, three or four contiguous NURBS curves.
361361
362362 Parameters
@@ -365,30 +365,39 @@ def from_fill(cls, curve1, curve2, curve3=None, curve4=None, scheme='stretch'):
365365 curve2 : :class:`~compas_occ.geometry.OCCNurbsCurve`
366366 curve3 : :class:`~compas_occ.geometry.OCCNurbsCurve`, optional.
367367 curve4 : :class:`~compas_occ.geometry.OCCNurbsCurve`, optional.
368- scheme (Literal[’stretch’, ’coons’, ‘curved’], optional) – The scheme according to which the mesh should be subdivided.
368+ style : Literal['stretch', 'coons', 'curved'], optional.
369+ The fill style:
370+ 'stretch' gives the flattest patch.
371+ 'coons' gives a rounded patch with less depth than that of curved.
372+ 'curved' gives with the most rounded patch.
373+
374+ Raises
375+ ------
376+ ValueError
377+ If the fill style is not supported.
369378
370379 Returns
371380 -------
372381 :class:`OCCNurbsSurface`
373382
374383 """
375384
376- if scheme == 'stretch' :
377- schemeStyle = GeomFill_StretchStyle
378- elif scheme == 'coons' :
379- schemeStyle = GeomFill_CoonsStyle
380- elif scheme == 'curved' :
381- schemeStyle = GeomFill_CurvedStyle
385+ if style == 'stretch' :
386+ style = GeomFill_StretchStyle
387+ elif style == 'coons' :
388+ style = GeomFill_CoonsStyle
389+ elif style == 'curved' :
390+ style = GeomFill_CurvedStyle
382391 else :
383392 ValueError ('Scheme is not supported' )
384393
385394 surface = cls ()
386- if curve3 :
387- occ_fill = GeomFill_BSplineCurves (curve1 .occ_curve , curve2 .occ_curve , curve3 .occ_curve , schemeStyle )
388395 if curve3 and curve4 :
389- occ_fill = GeomFill_BSplineCurves (curve1 .occ_curve , curve2 .occ_curve , curve3 .occ_curve , curve4 .occ_curve , schemeStyle )
396+ occ_fill = GeomFill_BSplineCurves (curve1 .occ_curve , curve2 .occ_curve , curve3 .occ_curve , curve4 .occ_curve , style )
397+ elif curve3 :
398+ occ_fill = GeomFill_BSplineCurves (curve1 .occ_curve , curve2 .occ_curve , curve3 .occ_curve , style )
390399 else :
391- occ_fill = GeomFill_BSplineCurves (curve1 .occ_curve , curve2 .occ_curve , schemeStyle )
400+ occ_fill = GeomFill_BSplineCurves (curve1 .occ_curve , curve2 .occ_curve , style )
392401 surface .occ_surface = occ_fill .Surface ()
393402 return surface
394403
0 commit comments