Periodic loft from curves.
(*curves: Curve, order: int = 3)
| 2035 | |
| 2036 | |
| 2037 | def 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 | |
| 2064 | def loft( |