Skip to content
brep-conformancegithub

sweep

Constructors · api.md § sweep · all operations

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}
FunctionFieldsReturns
boxframe, sizeSolid
cylinderframe, radius, heightSolid
sphereframe, radiusSolid
torusframe, major, minorSolid
coneframe, bottom, top, heightSolid
extrudeframe, profile, heightSolid
revolveframe, profile, angleSolid
screwframe, profile, rise, angleSolid
loftframe, profile, scale, height, topSolid
loft_throughframe, profiles, heightsSolid
sweepframe, profile, pathSolid
sweep_pathframe, profile, path, twistSolid
slabframe, size, knots_u, knots_v, heightsSolid