Skip to content
brep-conformancegithub

revolve

Constructors · api.md § revolve · all operations

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}
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