pub struct SurfaceMidpoints { /* private fields */ }Expand description
A surface’s midpoints in f64 (see CurveMidpoints): for the searches on
a surface whose answer is a free choice or a measurement in f64 — a
seed for a projection, how far a point lies off the surface, where to
draw it.
Implementations§
Source§impl SurfaceMidpoints
impl SurfaceMidpoints
pub fn of(surface: &NurbSurface3D) -> Self
pub fn domain_u(&self) -> (f64, f64)
pub fn domain_v(&self) -> (f64, f64)
Sourcepub fn partials(&self, u: f64, v: f64) -> (P3, P3, P3)
pub fn partials(&self, u: f64, v: f64) -> (P3, P3, P3)
The point at (u, v), clamped into the domain, and its partial
derivatives there: (Scalar, S_u, S_v).
Sourcepub fn project(&self, target: P3, u: f64, v: f64) -> (f64, f64)
pub fn project(&self, target: P3, u: f64, v: f64) -> (f64, f64)
The foot point of target on the surface by Newton from (u, v),
on the first fundamental form, in the domain. A step is taken only
where it makes progress: brings the point nearer target, or, no
further from it, nearer meeting the foot point’s conditions
r · S_u = r · S_v = 0 (r from the point to target) — near the
foot point the distance changes too little to tell in f64, the
conditions do not; but alone they also lead to points furthest from
target. Where
the full step makes none — at a pole, where one derivative vanishes
up to the roundings of the midpoints and the system is as good as
singular — the step along either derivative alone; and where
neither does, the step along a derivative from the other parameter
at its domain’s ends or middle, which at a pole is the same point on
another meridian (as NurbSurface::project leaves a pole). Where
none does, the search has arrived.