Skip to main content

Module surface

Module surface 

Source
Expand description

Surface/surface intersection: the analytic cases.

Where two surfaces meet has a closed form for a specific and well-known set of pairs, and a general answer that needs a marching intersector with a fitting stage after it. This module is the first of those. It is deliberately not a partial implementation of the second: a pair it cannot solve exactly is reported as needing the general path, never approximated.

§The exact cases

They are common: plane against plane, plane against cylinder, sphere against sphere. A mechanical part is mostly these, and running a marching intersector over a pair whose answer is a circle is slower and less accurate than writing down the circle.

They are fast. No stepping, no refinement, no approximation stage.

And they are exact. Every result here can be checked without reference to anything but the two surfaces themselves: sample the curve, ask each surface how far away it is, and the answer should be zero. That check is the accuracy instrument in tests/support/.

§What it reports

Not just curves. Two surfaces can miss, touch at a point, meet along curves, or be the same surface, and those are four different answers that downstream code has to distinguish. A boolean that treats coincidence as “no intersection” produces a solid with a face missing.

Enums§

Meeting
What two surfaces do where they meet.

Functions§

surface_surface
Where two surfaces meet, when that has a closed form.