Skip to main content

Module surface

Module surface 

Source
Expand description

Analytic and spline evaluation moved to the focused axiolid-evaluate package (ADR 0036). Re-exported unchanged so existing axiolid_reference::curve::* and ::surface::* callers are unaffected. Scalar reference implementation of surface evaluation (ADR 0012).

§What this closes

axiolid-surface declared six surface families and a SurfaceEvaluator trait. Nothing implemented it, so a B-rep face on any curved surface could not be tessellated, which is most faces in a real building model. This reference that makes the declaration executable.

§Parameterisation

Each family uses the conventional parameterisation, chosen so u is the angular direction wherever one exists (matching the curve module, where a full turn is [0, tau]):

familyuv
Planelocal x offsetlocal y offset
Cylinderangle about zheight along z
Coneangle about zheight along z
Sphereazimuth about zpolar, -pi/2 .. pi/2
Torusangle about zangle around the tube
BSplinefirst knot axissecond knot axis

Normals point outward for closed families (away from the axis for a cylinder, away from the centre for a sphere, away from the tube centre for a torus). A caller that needs the opposite convention negates; the kernel does not guess.

§What it does not do

No surface-surface intersection, no trimming, no blending. Those are the parts of a NURBS kernel this crate deliberately does not attempt: for a tessellate-and-check pipeline the useful operation is evaluation, and the boolean stack works on meshes.

Structs§

Patch
A finite parameter rectangle for tessellation.
ScalarSurface
The axiolid_surface::SurfaceEvaluator implementation, so a caller can dispatch through the trait rather than the free functions.
SurfaceJet
Position and all first/second partial derivatives of a surface.

Functions§

bspline_jet
Full second-order jet of a rational tensor-product B-spline. Second-order differential jet of a B-spline surface without enum wrapping.
evaluate
Position on a surface at (u, v).
invert
Surface parameters (u, v) whose evaluation reproduces point.
jet
Second-order differential jet at (u, v).
locate
Parameters of a point on a surface, iterating where no closed form exists: invert first, and for a B-spline the nearest point of a sample grid refined by Gauss-Newton. The answer must reproduce the point within tolerance, as invert’s must; where a surface overlaps itself one of the preimages is returned.
normal
Unit normal at (u, v).
partials
Analytic first partial derivatives (∂S/∂u, ∂S/∂v) at (u, v).
project
Parameters of the closest point on a surface to an arbitrary point.