pub struct BallEnvelope { /* private fields */ }Expand description
Ball-end mill moves: balls of radius whose centres run the segments.
Implementations§
Source§impl BallEnvelope
impl BallEnvelope
Sourcepub fn new(radius: f64, segments: Vec<(Vec3, Vec3)>) -> Option<BallEnvelope>
pub fn new(radius: f64, segments: Vec<(Vec3, Vec3)>) -> Option<BallEnvelope>
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.
Sourcepub fn capsule_underside(
&self,
index: usize,
x: f64,
y: f64,
) -> Option<(f64, Underside)>
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).
Sourcepub fn capsule_parts(&self, index: usize, x: f64, y: f64) -> [Option<f64>; 3]
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).
Sourcepub fn tube_root(&self, index: usize, x: f64, y: f64) -> Option<(f64, f64)>
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.
Sourcepub fn candidates(&self, x: f64, y: f64) -> &[usize]
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.
Sourcepub fn height(&self, x: f64, y: f64) -> Option<(f64, usize, Underside)>
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.
Sourcepub fn volume_under(
&self,
x0: f64,
x1: f64,
y0: f64,
y1: f64,
bottom: f64,
top: f64,
cell: f64,
) -> Option<f64>
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
impl BallEnvelope
Sourcepub fn plan(
&self,
x0: f64,
x1: f64,
y0: f64,
y1: f64,
top: f64,
cell: f64,
) -> Result<Plan, String>
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
impl Clone for BallEnvelope
Source§fn clone(&self) -> BallEnvelope
fn clone(&self) -> BallEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more