Skip to main content

BallEnvelope

Struct BallEnvelope 

Source
pub struct BallEnvelope { /* private fields */ }
Expand description

Ball-end mill moves: balls of radius whose centres run the segments.

Implementations§

Source§

impl BallEnvelope

Source

pub fn radius(&self) -> f64

The balls’ radius.

Source

pub fn segments(&self) -> &[(Vec3, Vec3)]

The moves’ ball-centre segments, start to end.

Source

pub fn new(radius: f64, segments: Vec<(Vec3, Vec3)>) -> Option<Self>

The envelope of segments swept by balls of radius. Its envelope (None outside it): a radius in [1e-100, 1e100], and every coordinate within 1e6 radii of the origin. Within it a read is backward accurate: the point it returns lies on the capsule’s surface to about 1e-10 of the radius. Its height alone can move further where the capsule’s wall stands near upright, since there the height itself turns on the plan position that sharply.

Source

pub fn capsule_underside( &self, index: usize, x: f64, y: f64, ) -> Option<(f64, Underside)>

The lowest point of the capsule index above (x, y), and which part of it that is; None where the capsule does not reach over (x, y).

Source

pub fn capsule_parts(&self, index: usize, x: f64, y: f64) -> [Option<f64>; 3]

Each part of the capsule index over (x, y): the underside of its start ball, of its end ball, and of its tube (None where that part does not reach: past a ball’s rim, or where the tube’s foot leaves the segment).

Source

pub fn tube_root(&self, index: usize, x: f64, y: f64) -> Option<(f64, f64)>

The lower side of the whole line’s cylinder about the capsule index’s segment over (x, y), and the foot of that point on the line (0 at the segment’s start, 1 at its end); None where the line’s cylinder does not reach over (x, y) or the segment has no length.

Source

pub fn candidates(&self, x: f64, y: f64) -> &[usize]

The capsules whose plan boxes hold (x, y) (a superset of those that reach over it); none outside the grid.

Source

pub fn height(&self, x: f64, y: f64) -> Option<(f64, usize, Underside)>

The envelope at (x, y): the lowest point of any capsule above it, the capsule’s index and its part; None where no capsule reaches.

Source

pub fn volume_under( &self, x0: f64, x1: f64, y0: f64, y1: f64, bottom: f64, top: f64, cell: f64, ) -> Option<f64>

The volume of the box [x0, x1] × [y0, y1] × [bottom, top] below the envelope (the stock left where the capsules cut its top), by Gauss-Legendre on square cells of size cell, four points a side each. The envelope has creases (where two capsules meet), so the rule converges as the cell’s square at best: two sizes and Richardson are the caller’s.

The box and the cell lie in the capsules’ own envelope (None outside it): every bound within 1e6 radii of the origin, the box of positive extent, the cell at least 1e-6 radii.

Source§

impl BallEnvelope

Source

pub fn plan( &self, x0: f64, x1: f64, y0: f64, y1: f64, top: f64, cell: f64, ) -> Result<Plan, String>

The plan of the envelope over the box [x0, x1] × [y0, y1] cut below top, read on a grid of about cell (see the module’s notes). Refuses (saying where) a part the grid passes over between two nodes of one part, a box or cell outside the envelope’s reach (every bound within 1e6 radii of the origin, the cell at least 1e-6 radii, at most 1e8 nodes), and a result its own check rejects.

Trait Implementations§

Source§

impl Clone for BallEnvelope

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BallEnvelope

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more