Measuring

Every object provides its area, length, center and bounding box directly, and Measure() returns them all as a dict together with the second moments and principal axes. Distances, closest points and inside tests take a point or an array of points. In a sketch, Measure(id) measures elements by their ids, so a drawing can be checked against its intent.

A measurement can also be a function of your own, stored on a sketch and evaluated again after every change, such as the thinnest wall, the largest end mill that fits, or the point farthest from a cooling channel. planex.measurements provides thickness maps, clearances, Hausdorff distances and torsion constants. See Field solvers as measurements for measurements that need a field solver.

In this section

Measurements

Analysis

Everything at a glance

Size

mass (the area of faces, the length of wires), bounding_box, outer, inner

Mass properties

center (3D), inertia (3D, about the center), Measure(): Ih, Iv, Ihv, I1, I2, principal_angle

Distances

Distance(target, project=False, components=None, signed=False), ClosestPoint(point)

Inside

Contains(point, boundary=True)

Edges

Distance(..., on_carrier=True), Measure(to=...)

Sketches

sketch.Measure(id, to=...): lengths, radii, angles and distances between elements, by id

Analysis

Selectors by id, name, kind and position; vertex.angle, vertex.radius; planex.measurements with thickness maps, clearance, Hausdorff distance and torsion; Measure(f, id=...), measures

See Field solvers as measurements for measurements that need a field solver, NGSolve or FEniCSx, such as a peak temperature or a stress concentration.