Skip to main content

Module transform

Module transform 

Source
Expand description

Rigid placement of an exact B-rep. Rigid placement of an exact B-rep (#223).

§What a rigid transform preserves

A rotation, a translation and a reflection map every support family the catalog carries onto the same family: a plane stays a plane, a cylinder a cylinder of the same radius, a circle a circle, a B-spline a B-spline over the same knots and weights with its control points moved. So ExactBRep::transformed is a new exact B-rep of the same topology and the same families, never a tessellation or a refit. Any other affine map – a scale, a shear – turns circles into ellipses or worse and is refused, not approximated.

Coordinates are mapped in f64: each frame axis, origin, control point and vertex is the transform applied once, rounded once. The result is the exact B-rep of those numbers, as every constructed B-rep is the exact B-rep of the numbers it was built from; the rounding is a few units in the last place of the coordinates, not a change of representation.

§Proper rotations

A rotation moves every frame rigidly. Every point keeps its parameters, so edge intervals, pcurves and pcurve intervals are unchanged, and the curves that carry their own surface (sections, traced and lifted curves) move with their carriers.

§Reflections

A reflection M (determinant -1) keeps a frame orthonormal but makes it left-handed, which the evaluators refuse. So each frame is re-chosen right-handed, with its parameterisation adjusted so every point keeps its place:

  • a plane, circle or ellipse takes (M x, M y, -M z): points keep their parameters;
  • a cylinder, elliptical cylinder, cone, sphere and torus take (M x, -M y, M z), which reads the angle about the axis backwards, so a point at u sits at 2 pi - u and each pcurve on the face is reflected in u to match;
  • a B-spline keeps its parameters; its control points are reflected.

A reflection reverses the winding of every loop about the mirrored outward normal, so every face is flipped: the solid stays outward oriented and measures a positive volume. A pcurve family that cannot be reflected in u in closed form here (graphs of quadric and torus sections, traced and lifted curves, intrinsic curves) on a curved face, and a curve that carries such a surface, are refused by name.

§Refused for every transform

An elevated alignment curve is a plan curve with a height law: only a motion that keeps the vertical axis keeps that form, and re-expressing the law is not implemented. An unknown support family is refused too.

Enums§

TransformError
Why an exact B-rep could not be placed.

Constants§

RIGID_TOLERANCE
How far the columns of a transform’s linear part may stray from an orthonormal basis, in each dot product, and still be read as rigid.