pub fn project_on_surface(
surface: &SurfaceGeometry,
target: Point,
samples: usize,
tol: Tolerances,
) -> OgeomResult<SurfaceProjection>Expand description
The nearest point on a surface to target.
A seed, then Newton on the two conditions that define a foot point: the
displacement from the surface to the target is perpendicular to both
tangents. An elementary or swept surface seeds in closed form or along
its profile. A B-spline patch seeds by branch and bound over its knot
spans, to within a hundredth of the confusion of the nearest point of
the whole patch, and ignores samples. Any other surface seeds from a grid of samples
per direction: the distance to a surface is generally multi-modal, and
the grid sets how fine a basin it can tell apart.
Where two feet of a B-spline patch are equally near to within a
hundredth of the confusion, either is a right answer, and the one
returned is fixed by the patch and the target: the one at the smaller
u, then v, among the points the search seeds Newton from.
ยงErrors
OgeomError::Domain if the surface cannot be
evaluated over its own domain.