pub struct MeshGeometry { /* private fields */ }Expand description
A target of closed triangle-mesh solids, each tagged with a material, with a BVH per solid. See the module docs for the ownership rules.
Implementations§
Source§impl MeshGeometry
impl MeshGeometry
Sourcepub fn new(
materials: Vec<Material>,
solids: Vec<(TriMesh, u32)>,
) -> Result<Self, GeometryError>
pub fn new( materials: Vec<Material>, solids: Vec<(TriMesh, u32)>, ) -> Result<Self, GeometryError>
Build from the material list and (mesh, material index) solids, in
priority order (the first listed owns overlaps). Meshes are in metres.
Sourcepub fn tolerance_m(&self) -> f64
pub fn tolerance_m(&self) -> f64
The geometric tolerance of the ownership rules, m.
Trait Implementations§
Source§impl Clone for MeshGeometry
impl Clone for MeshGeometry
Source§fn clone(&self) -> MeshGeometry
fn clone(&self) -> MeshGeometry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MeshGeometry
impl Debug for MeshGeometry
Source§impl Geometry for MeshGeometry
impl Geometry for MeshGeometry
Source§fn in_vacuum(&self, pos: [f64; 3]) -> bool
fn in_vacuum(&self, pos: [f64; 3]) -> bool
A point on the surface of a solid is not in vacuum, whichever of the
eight diagonal offsets (the one of Geometry::locate and its
mirror images) would put it outside.
Source§fn n_materials(&self) -> usize
fn n_materials(&self) -> usize
Number of distinct materials.
Source§fn material_index(&self, region: usize) -> usize
fn material_index(&self, region: usize) -> usize
Index of the material filling
region.Source§fn locate(&self, pos: [f64; 3]) -> Option<usize>
fn locate(&self, pos: [f64; 3]) -> Option<usize>
The region containing
pos, or None outside the target (or for a
non-finite position). Ownership of shared faces: see the module docs.Source§fn entry_point(&self) -> [f64; 3]
fn entry_point(&self) -> [f64; 3]
Source§fn exit(
&self,
region: usize,
pos: [f64; 3],
dir: [f64; 3],
limit: f64,
) -> Option<Exit>
fn exit( &self, region: usize, pos: [f64; 3], dir: [f64; 3], limit: f64, ) -> Option<Exit>
The first event along the straight flight from
pos (inside region,
or on one of its faces) in the unit direction dir, if it happens at
a path length of at most limit; otherwise None. The event is a
change of material, a periodic wrap, or leaving the target. Read moreSource§fn flight(
&self,
region: usize,
pos: [f64; 3],
dir: [f64; 3],
limit: f64,
) -> Flight
fn flight( &self, region: usize, pos: [f64; 3], dir: [f64; 3], limit: f64, ) -> Flight
Geometry::exit, also reporting the region the flight ends in when
there is no event, so a transport engine can keep its particle’s
region consistent with its position after crossing same-material
faces. The default suits a geometry whose regions are each a whole
material run along every flight (a Stack, where leaving a layer is
always an event): without an event the region is unchanged.Source§impl PartialEq for MeshGeometry
impl PartialEq for MeshGeometry
impl StructuralPartialEq for MeshGeometry
Auto Trait Implementations§
impl Freeze for MeshGeometry
impl RefUnwindSafe for MeshGeometry
impl Send for MeshGeometry
impl Sync for MeshGeometry
impl Unpin for MeshGeometry
impl UnsafeUnpin for MeshGeometry
impl UnwindSafe for MeshGeometry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more