Skip to main content

SurfaceMidpoints

Struct SurfaceMidpoints 

Source
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

Source

pub fn of(surface: &NurbSurface3D) -> Self

Source

pub fn domain_u(&self) -> (f64, f64)

Source

pub fn domain_v(&self) -> (f64, f64)

Source

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).

Source

pub fn point(&self, u: f64, v: f64) -> P3

The point at (u, v), clamped into the domain.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.