Expand description
Mass properties of solids, and areas of faces and solids, integrated over
the exact trimmed NURBS faces: Model::mass_properties,
Model::face_area, Model::solid_area.
§How
A volume integral is turned into a surface integral by the divergence
theorem — ∫ div F dV = ∮ F · n dA — with F chosen per quantity:
p / 3 for the volume, (x²/2, 0, 0) for ∫ x dV, (x³/3, 0, 0) for
∫ x² dV, (x² y / 2, 0, 0) for ∫ x y dV, and so on. Each face is a
surface Scalar(u, v) over a trimmed region D of its parameter plane, with
n dA = S_u × S_v du dv pointing out of the solid. A double integral over
D is turned into a line integral around it by Green’s theorem:
∬_D g du dv = ∮_∂D G dv, G(u, v) = ∫_{u0}^{u} g(s, v) dswith ∂D the face’s loops as the kernel orients them — the outer one
counter-clockwise, holes clockwise — and u0 the start of the surface’s
u domain, which the untrimmed surface covers. (Or the same with the
roles swapped: ∬_D g du dv = -∮_∂D H du, H integrating along v.)
So every face is integrated along its own pcurves, each piece of a
pcurve by adaptive Gauss–Kronrod, and every point of those by an inner
integral split at the surface’s knots (see geop_core_math::quadrature).
§The inner integral is exact where it can be
The inner integral is evaluated at every point of the outer one, so it
decides the cost. It runs along a direction in which the surface is a
polynomial where there is one: where the weights do not change along
it — any plane, an extrusion along its straight direction, a cylinder
along its axis. For a fixed other parameter the point is then a
polynomial spline of the surface’s degree p there, S_u × S_v one of
degree 2p - 1, and the moments, at most cubic in the point, of degree
5p - 1: the Gauss–Legendre rule of ⌈5p / 2⌉ points integrates every
span exactly (three points on a plane, against the fifteen of a
Gauss–Kronrod panel), and the inner integral has no truncation error at
all. The weights must be the same numbers, not merely overlapping
enclosures: the same interval along every row, which is what a sweep or
a plane is built with. Elsewhere — a sphere, a torus, an area’s square
root — it is adaptive Gauss–Kronrod.
§Why not a tessellation
A triangle mesh of the faces gives exact integrals of the wrong shape:
its error is the chord error of the mesh, which nothing bounds without
curvature bounds the rasterizer does not compute, and it converges only
quadratically. Integrating the exact surfaces converges spectrally, and
what is uncertain about the result can be stated: the quadrature rule’s
own value is enclosed in interval arithmetic, and its truncation error
is the rule’s standard estimate (see geop_core_math::quadrature for
exactly what is proven and what is estimated). Every quantity here is
that enclosure, widened by that estimate.
Structs§
- Mass
Properties - The mass properties of a body: its volume, its mass, where its centre of
mass is and its inertia tensor about it. (The area of its boundary is no
mass property, and costs more to integrate: see
Model::solid_area.) - Principal
Axes - The principal moments of inertia, ascending, each enclosed, and the axis
each is about (see
symmetric_eigen3: where moments coincide, any axis of their plane is one).