MCPcopy
hub / github.com/CadQuery/cadquery / periodicLoft

Function periodicLoft

cadquery/occ_impl/nurbs.py:2037–2061  ·  view source on GitHub ↗

Periodic loft from curves.

(*curves: Curve, order: int = 3)

Source from the content-addressed store, hash-verified

2035
2036
2037def periodicLoft(*curves: Curve, order: int = 3) -> Surface:
2038 """
2039 Periodic loft from curves.
2040 """
2041
2042 nknots: int = len(curves) + 1
2043
2044 # collect control pts
2045 pts = [el for el in np.stack([c.pts for c in curves]).swapaxes(0, 1)]
2046
2047 # approximate
2048 pts_new = [el.pts for el in periodicApproximate(pts, knots=nknots, order=order)]
2049
2050 # construct the final surface
2051 rv = Surface(
2052 np.stack(pts_new).swapaxes(0, 1),
2053 linspace(0, 1, nknots),
2054 curves[0].knots,
2055 order,
2056 curves[0].order,
2057 True,
2058 curves[0].periodic,
2059 )
2060
2061 return rv
2062
2063
2064def loft(

Callers 1

test_periodic_loftFunction · 0.90

Calls 2

periodicApproximateFunction · 0.85
SurfaceClass · 0.85

Tested by 1

test_periodic_loftFunction · 0.72