revolve
Constructors · api.md § revolve · all operations
definition
revolve(frame: Frame, profile: Profile, angle: Angle) -> Solid
Spins a profile about an axis, as on a lathe. The profile lies beside the frame's z axis and is turned about that axis by angle. A whole turn makes a closed body of revolution.
The profile is drawn in the plane of the frame's x and z, with its first coordinate measured out from the z axis and its second coordinate measured along the z axis. Ω must lie in the half-plane where the first coordinate is at least zero, and 0 < angle ≤ 2π must hold. The result is the set of points (ρ cos φ, ρ sin φ, w) for (ρ, w) ∈ Ω and 0 ≤ φ ≤ angle: the profile turned right-handed about z. The result's volume is M·angle (Pappus). Its area is angle·∮ u ds, plus 2A for the end faces when angle < 2π.
Example.
> {"cmd": "revolve", "frame": {"origin": [0, 0, 0], "x": [1, 0, 0], "y": [0, 1, 0], "z": [0, 0, 1]},
"profile": [[{"line": [[5, 0], [8, 0]]}, {"line": [[8, 0], [8, 4]]}, {"line": [[8, 4], [5, 4]]},
{"line": [[5, 4], [5, 0]]}]], "angle": 6.283185307}
< {"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 |