sweep
Constructors · api.md § sweep · all operations
definition
sweep(frame: Frame, profile: Profile, path: Path) -> Solid
Carries a profile along a path of straight runs and bends, like a pipe or a bent bar.
The path starts at the frame's origin heading along z, with the profile in the xy plane square to it. A line runs straight on by length. An arc bends toward the current x by angle, about an axis that lies along the current y at a distance radius from the path, and the arc turns the frame with it. The result is the union of the pieces: each line gives the extrusion of the profile along the line, and each arc gives the revolution of the profile about the arc's axis. Every profile point must be closer to the path than any bend's radius, and all lengths, radii and angles must be positive. The result's volume, area and moments are those of its pieces added together, less the end caps that meet inside the result.
Example.
> {"cmd": "sweep", "frame": {"origin": [0, 0, 0], "x": [1, 0, 0], "y": [0, 1, 0], "z": [0, 0, 1]},
"profile": [[{"line": [[-1, -1], [1, -1]]}, {"line": [[1, -1], [1, 1]]}, {"line": [[1, 1],
[-1, 1]]}, {"line": [[-1, 1], [-1, -1]]}]], "path": [{"line": 10},
{"arc": {"radius": 5, "angle": 1.570796327}}, {"line": 10}]}
< {"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 |