loft
Constructors · api.md § loft · all operations
definition
loft(frame: Frame, profile: Profile, scale: Number, height: Length, top: Profile) -> Solid
Joins a profile by straight lines to a scaled copy of the profile above it, like a tapered post. A scale of 1 gives an extrusion, and a smaller scale narrows the solid toward the top.
top is profile scaled by scale about the origin. The client sends top, so that an adapter whose kernel lofts between two sections passes both profiles on and scales nothing itself.
The profile must have one loop, and scale and height must be positive. The result is the set of points (σu, σv, w) for (u, v) ∈ Ω and 0 ≤ w ≤ height, with σ = 1 + (scale − 1)·w/height. The result is ruled from the profile in the xy plane to the profile's copy scaled about the origin, height up z. The result's volume is A·height·(1 + s + s²)/3 with s = scale, and its area is A·(1 + s²) + (1 + s)/2 · ∮ ‖(height·q′, (s − 1)·q × q′)‖ round the profile q.
Example.
> {"cmd": "loft", "frame": {"origin": [0, 0, 0], "x": [1, 0, 0], "y": [0, 1, 0], "z": [0, 0, 1]},
"profile": [[{"line": [[-5, -5], [5, -5]]}, {"line": [[5, -5], [5, 5]]}, {"line": [[5, 5],
[-5, 5]]}, {"line": [[-5, 5], [-5, -5]]}]], "scale": 0.5, "height": 10, "top": [[{"line": [[-2.5,
-2.5], [2.5, -2.5]]}, {"line": [[2.5, -2.5], [2.5, 2.5]]}, {"line": [[2.5, 2.5], [-2.5, 2.5]]},
{"line": [[-2.5, 2.5], [-2.5, -2.5]]}]]}
< {"ok": 1}common to constructors
| Function | Fields | Returns |
|---|---|---|
box | frame, size | Solid |
cylinder | frame, radius, height | Solid |
sphere | frame, radius | Solid |
torus | frame, major, minor | Solid |
cone | frame, bottom, top, height | Solid |
extrude | frame, profile, height | Solid |
revolve | frame, profile, angle | Solid |
screw | frame, profile, rise, angle | Solid |
loft | frame, profile, scale, height, top | Solid |
loft_through | frame, profiles, heights | Solid |
sweep | frame, profile, path | Solid |
sweep_path | frame, profile, path, twist | Solid |
slab | frame, size, knots_u, knots_v, heights | Solid |