Skip to main content

Module place

Module place 

Source
Expand description

Placing and duplicating shapes.

§A rigid move copies nothing

transformed returns the same topology at a different Location. No node is created, no curve is re-evaluated, and the result compares equal to the original under Shape::is_partner, which is how “these thousand bolts are the same bolt” stays a fact the model knows rather than one an application has to remember (docs/DATA_MODEL.md §2, §3).

That is only sound because a location is a rigid motion with a uniform scale. Such a motion carries a line to a line and a circle to a circle, so the geometry underneath still describes the moved shape. An affine transform that shears or scales unevenly does not: it carries a circle to an ellipse, and no amount of placement makes a circle record that. The type system says so: transformed takes a Transform, which is a similarity by construction, and a general affine transform is a different type it will not accept. Applying one means rebuilding the geometry, which is not written yet; see the deferred list in docs/PLAN.md.

§A copy is for editing, not for moving

copied duplicates the topology so the two can diverge. It shares the geometry: curves and surfaces are immutable values in an arena, so two shapes naming one circle can never disagree about it, and copying it would only make the model larger. What a copy buys is independent topology: tolerances, representations and children that one shape can change without the other seeing it.

Modules§

roles
Roles this module assigns.

Functions§

copied
Duplicate a shape’s topology so the two can be edited apart.
transformed
Move a shape by a rigid motion, sharing everything.