screw
Constructors · api.md § screw · all operations
definition
screw(frame: Frame, profile: Profile, rise: Length, angle: Angle) -> Solid
Spins a profile about an axis while moving the profile along the axis, as a thread is formed. Each whole turn rises 2π·rise.
The profile is drawn as for revolve. Ω must lie where the first coordinate is at least zero, and angle must be positive. The turns must stay apart: 2π·|rise| must be at least the profile's extent along z. The result is the set of points (ρ cos φ, ρ sin φ, w + rise·φ) for (ρ, w) ∈ Ω and 0 ≤ φ ≤ angle: the profile turned about z while rising rise per radian, as a thread. The result's volume is M·angle, because the rise moves each section within its own plane. Its area is angle·∮ √(u² + rise²·(du/ds)²) ds + 2A.
Example.
> {"cmd": "screw", "frame": {"origin": [0, 0, 0], "x": [1, 0, 0], "y": [0, 1, 0], "z": [0, 0, 1]},
"profile": [[{"line": [[5, 0], [6, 0]]}, {"line": [[6, 0], [6, 1]]}, {"line": [[6, 1], [5, 1]]},
{"line": [[5, 1], [5, 0]]}]], "rise": 0.5, "angle": 12.566370614}
< {"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 |