Skip to main content

transformed

Function transformed 

Source
pub fn transformed(
    model: &mut Model,
    shape: &Shape,
    transform: Transform,
) -> OgeomResult<Built>
Expand description

Move a shape by a rigid motion, sharing everything.

Cheap and exact: the result names the same topology nodes and the same geometry, at a new placement.

The history records the shape and every sub-shape below it as modified into its occurrence in the moved shape: the same node under the new placement. A placement is part of a sub-shape’s identity, so without the record a face of the input would trace to itself, which is no face of the result. The records cost one walk of the input’s unique sub-shapes; no node is made.

There is no way to pass something that is not a placement. Transform is a similarity by construction (rigid motion with a uniform scale), and a shear or a non-uniform scale is a GeneralTransform, which this does not accept. That is deliberate: such a transform carries a circle to an ellipse, and recording it as a placement would leave every circle in the shape claiming to be a circle while sitting on an ellipse. The type refuses it, so no runtime check has to.

§Errors

OgeomError::Dangling if the shape does not resolve in this model.