Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Measurement and checking

Everything here is in ogeom::algo.

Mass properties

volume_properties, surface_properties and linear_properties return MassProperties: the measure (mass), the centroid, and the inertia tensor about the centroid.

  • Area and volume are integrated on the exact surfaces, trim and all, whenever every face has pcurves. The result then reports a deflection of zero and does not depend on the one passed in.
  • Otherwise they are computed on a tessellation at the given Deflection, which the result reports. The answer converges as the deflection gets smaller. Lengths are always measured this way.
  • An inside-out shell would measure a negative volume. It is reported as an error, not returned as a negative number.

Distances and projections

FunctionReturns
distance_between_shapesMinimum distance and the ClosestPair that realises it.
project_on_curve, project_on_surface, project_on_planar_curveParameter and distance of a point’s projection onto the geometry.
project_edge_onto_planeAn edge projected onto a plane as an exact 2D curve: point, line, circle, ellipse, parabola, hyperbola or B-spline (clamped); any other curve fitted.
curve_lengthLength along a curve.
parameter_at_lengthParameter at a given arc length.
points_by_count, points_by_spacingPoints spread along a curve.

Bounds and classification

  • shape_bounds, curve_bounds, surface_bounds, vertex_bounds: axis-aligned bounding boxes.
  • oriented_bounds: a tight oriented box (Obb).
  • classify_in_solid: is a point inside, outside or on a solid. The _exact variants work on the exact geometry.
  • classify_on_face: the same test for a point on a face.

Validity

check verifies the rules the builders promise: edges within their faces’ tolerance, vertices within their edges’, wires closed where they claim to be. It returns a Diagnosis of named Problems, each with a Severity. It accepts everything the kernel legitimately builds, so what it flags is really broken.

check also reports a solid whose boundary passes through itself: a face folded through itself, or two faces crossing away from the edges they share. The faces’ meshes find where they might cross, and each crossing is confirmed on the surfaces before it is named. A face is probed for which way it faces at two places, and one that reads out of the material at one and into it at the other is named too.

check_self_intersection asks a different question: it measures the exact distance between every pair of faces that share no edge or vertex, and names any pair that touches, not only one that crosses, but it never looks at a face against its neighbours or itself. It costs more than the crossing test in check, as does check_tessellation, which compares a shape’s mesh with its topology. Call them when that is the question.