Skip to main content

make_evolved

Function make_evolved 

Source
pub fn make_evolved(
    model: &mut Model,
    spine: &Shape,
    profile: &Shape,
    tol: Tolerances,
) -> OgeomResult<Built>
Expand description

Sweep a profile along a spine, the way a moulding runs round a frame.

The spine is a planar wire, or a planar face whose outer wire is taken. The profile is a wire standing in a plane that contains the spine’s own normal, positioned where the spine starts. What comes back is what the profile sweeps out as it travels the spine, always square to it:

  • a straight spine edge extrudes the profile (a prism);
  • a circular one turns it about that arc’s own axis (a revolution);
  • and each corner between them turns it about the corner, through exactly the angle the spine turns there, which is the join the 2D offset makes for the same reason.

Every piece is exact: the surfaces are the ones a prism and a revolution give for the profile’s own curves, and nothing is fitted. The pieces are then unioned, which is the assembly’s real name: consecutive pieces meet on the same placed profile, and a coincident face is what the boolean identifies rather than probes across.

§Volume or shell

The result is always a volume, and which spine is given is what says whether there is one to have. A closed profile bounds its own section and sweeps a solid along either kind of spine. An open one does not, and there is exactly one honest way to close it: against the plane a face spine was drawn in, whose own plane the profile’s two ends must reach. An open profile along a wire spine is refused, and the refusal says which spine would close it.

§Errors

OgeomError::Construction if the spine is not a planar wire or face, if it carries an edge that is neither straight nor circular, if the profile is not planar, if the profile’s plane does not contain the spine’s normal or does not cut across it (a profile that leans or lies along is not square to the spine), or if an open profile has no spine plane to close against. OgeomError::NotDone where a corner’s turn would sweep the profile across the corner itself, which no revolution can express.