Skip to main content

make_revolution

Function make_revolution 

Source
pub fn make_revolution(
    model: &mut Model,
    profile: &Shape,
    axis: Axis,
    angle: f64,
    tol: Tolerances,
) -> OgeomResult<Built>
Expand description

Revolve a shape about axis, through angle radians.

A face becomes a solid, a wire becomes a shell, an edge becomes a face: the same rule as make_prism, turning instead of travelling. A full turn closes on itself: its two ends are the same profile, meeting along a seam, which is the topology make_cylinder produces for the identical solid. A partial turn has two distinct ends and caps them.

The seam is not an implementation detail to be avoided. Building a full turn as two half-turns would sidestep it and give a different face count for the same solid, and a boolean later has to split along seams like any other edge.

ยงErrors

OgeomError::Construction if the angle is not in (0, 2pi], if the shape is of a kind that cannot be swept, if an edge of the profile has no 3D curve, if the profile meets the axis anywhere but at its ends (it would sweep through itself), or if the profile lies in a surface the turn runs along, which encloses no volume.