pub trait Field {
// Required methods
fn scale(&self) -> f64;
fn length(&self) -> f64;
fn top(&self) -> f64;
fn lowest(&self, x: f64, y: f64) -> (f64, Part);
fn height(&self, part: Part, x: f64, y: f64) -> f64;
fn continued(&self, part: Part, x: f64, y: f64) -> f64;
fn plane(&self, p: Part, q: Part, x: f64, y: f64) -> Option<f64>;
fn witnesses(&self, cell: f64) -> Vec<[f64; 2]>;
// Provided methods
fn seeds(&self) -> Vec<[f64; 2]> { ... }
fn below(&self, p: Part, q: Part, x: f64, y: f64) -> bool { ... }
fn equation(&self, p: Part, q: Part, x: f64, y: f64) -> f64 { ... }
fn meets(&self, p: Part, q: Part, x: f64, y: f64, tolerance: f64) -> bool { ... }
}Expand description
What a plan reads: over each point (x, y) of its chart, the part lowest there and its height (the stock’s top where nothing cuts below it), and each part’s own height and surface (continued past where it is read). A mill’s envelope over level ground reads in plan (x, y) and height z; a dome’s reads directions in a chart of the sphere, and the distance along each ray.
Required Methods§
Sourcefn lowest(&self, x: f64, y: f64) -> (f64, Part)
fn lowest(&self, x: f64, y: f64) -> (f64, Part)
The lowest part over (x, y) and its height; ties to the lesser part.
Sourcefn height(&self, part: Part, x: f64, y: f64) -> f64
fn height(&self, part: Part, x: f64, y: f64) -> f64
The part’s height over (x, y), +∞ where it is not read.
Sourcefn continued(&self, part: Part, x: f64, y: f64) -> f64
fn continued(&self, part: Part, x: f64, y: f64) -> f64
The part’s surface continued past where it is read (NaN past its reach), for the boundary equations.
Sourcefn plane(&self, p: Part, q: Part, x: f64, y: f64) -> Option<f64>
fn plane(&self, p: Part, q: Part, x: f64, y: f64) -> Option<f64>
For two parts that meet where one of them stops being read (a tube and its own ball, two stretches of one surface), the signed distance of the point from the surface they meet on; None for parts that meet where their heights agree.
Provided Methods§
Sourcefn seeds(&self) -> Vec<[f64; 2]>
fn seeds(&self) -> Vec<[f64; 2]>
Points (in the chart) where a boundary turns a corner that no third part marks (two parts meeting at a point of both their centre curves): each is made a vertex of the plan, its cell read down to it.
Sourcefn below(&self, p: Part, q: Part, x: f64, y: f64) -> bool
fn below(&self, p: Part, q: Part, x: f64, y: f64) -> bool
Whether p is read below q at (x, y) (the pair’s own comparison,
ties to the lesser part).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".