Struct SearchableMesh

Source
pub struct SearchableMesh<M, T, IC>
where M: IsMesh<T, Face3>, IC: IsIndexContainer,
{ /* private fields */ }
Expand description

SearchableMesh, transforms IsMesh to IsSearchableMesh

Implementations§

Source§

impl<M, T, IC> SearchableMesh<M, T, IC>
where M: IsMesh<T, Face3>, IC: IsIndexContainer,

Source

pub fn new(mesh: M) -> Self

Creates a new SearchableMesh3D from an IsMesh3D This only stays valid if IMesh3D is not changed after creation The mesh must be manifold

Source

pub fn ensure_face_id(&self, id: FId) -> Result<()>

Fails if the vertex ID is out of bounds

Source

pub fn mesh(&self) -> &M

Returns a reference to the held mesh

Trait Implementations§

Source§

impl<M, T, IC> AsRef<M> for SearchableMesh<M, T, IC>
where M: IsMesh<T, Face3>, IC: IsIndexContainer,

Source§

fn as_ref(&self) -> &M

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<M, T: Clone, IC> Clone for SearchableMesh<M, T, IC>
where M: IsMesh<T, Face3> + Clone, IC: IsIndexContainer + Clone,

Source§

fn clone(&self) -> SearchableMesh<M, T, IC>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<M, T, IC> From<(M, HalfEdge<IC>)> for SearchableMesh<M, T, IC>
where M: IsMesh<T, Face3>, IC: IsIndexContainer,

Source§

fn from(me: (M, HalfEdge<IC>)) -> Self

Converts to this type from the input type.
Source§

impl<M, T, IC> HasBoundingBox3DMaybe for SearchableMesh<M, T, IC>

Source§

fn bounding_box_maybe(&self) -> Result<BoundingBox3D>

Should return the bounding box if it can be calculated
Source§

impl<M, T, IC> HasCenterOfGravity3D for SearchableMesh<M, T, IC>

Source§

fn center_of_gravity(&self) -> Result<Point3D>

Should return the center of gravity
Source§

impl<M, T, IC> Into<(M, HalfEdge<IC>)> for SearchableMesh<M, T, IC>
where M: IsMesh<T, Face3>, IC: IsIndexContainer,

Source§

fn into(self) -> (M, HalfEdge<IC>)

Converts this type into the (usually inferred) input type.
Source§

impl<M, T, IC> IsMesh<T, Face3> for SearchableMesh<M, T, IC>
where M: IsMesh<T, Face3>, IC: IsIndexContainer,

Source§

fn num_faces(&self) -> usize

Should return the number of faces within the mesh
Source§

fn num_vertices(&self) -> usize

Should return the number of vertices within the mesh
Source§

fn face_vertex_ids(&self, faceid: FId) -> Result<Face3>

Should return the ids of vertices of the given face
Source§

fn face_vertices(&self, faceid: FId) -> Result<[T; 3]>

Should return the vertices of the given face
Source§

fn vertex(&self, vertexid: VId) -> Result<T>

Should return the vertex with the given id
Source§

impl<M, T, IC> IsScalable for SearchableMesh<M, T, IC>

Source§

fn scale(&mut self, factor: Positive)

Should scale by the given factor. 0.5 -> half size, 2.0 double the size without moving the position/center
Source§

impl<M, T, IC> IsSearchableMesh<T, Face3> for SearchableMesh<M, T, IC>
where M: IsMesh<T, Face3>, IC: IsIndexContainer,

Source§

fn num_edges(&self) -> usize

Returns the number of edges within the mesh
Source§

fn edges_of_face(&self, faceid: FId) -> Result<(EId, EId, EId)>

Should return the edge ids of the given face. Error if id invalid
Source§

fn edges_originating_from_vertex( &self, vertexid: VId, result: &mut Vec<EId>, ) -> Result<()>

Should append the edges originating at the given vertex (pointing away / having the vertex as tail). Error if id invalid
Source§

fn edges_ending_at_vertex( &self, vertexid: VId, cache: &mut Vec<EId>, result: &mut Vec<EId>, ) -> Result<()>

Should append the edges ending at the given vertex (pointing to / having the vertex as head). Error if id invalid cache can be any Vec and can be used to store intermediate results avoiding allocations
Source§

fn edges_of_vertex( &self, vertexid: VId, cache: &mut Vec<EId>, result: &mut Vec<EId>, ) -> Result<()>

Should append the edges connecting with the vertex. Error if id invalid cache can be any Vec and can be used to store intermediate results avoiding allocations
Source§

fn edge_tail(&self, edgeid: EId) -> Result<VId>

Should return the vertex id of the edge’s tail. Error if id invalid
Source§

fn edge_head(&self, edgeid: EId) -> Result<VId>

Should return the vertex id of the edge’s head. Error if id invalid
Source§

fn edge_next(&self, edgeid: EId) -> Result<EId>

Should return the edge id of the next edge. Error if id invalid
Source§

fn edge_prev(&self, edgeid: EId) -> Result<EId>

Should return the edge id of the previous edge. Error if id invalid
Source§

fn edge_twin(&self, edgeid: EId) -> Result<Option<EId>>

Should return the edge id of the twin edge. Error if id invalid, None if there is none
Source§

fn edge_face(&self, edgeid: EId) -> Result<FId>

Should return the face id of the edges face. Error if id invalid
Source§

fn faces_of_vertex( &self, vertexid: VId, cache: &mut Vec<EId>, result: &mut Vec<FId>, ) -> Result<()>

Appends faces a vertex is part of. Error if id invalid cache can be any Vec
Source§

fn face_edge_neighbours(&self, faceid: FId, result: &mut Vec<FId>) -> Result<()>

Appends the neighbouring faces of the given face which share the same edges. Error if id invalid
Source§

fn face_vertex_neighbours( &self, faceid: FId, cache: &mut Vec<EId>, result: &mut Vec<FId>, ) -> Result<()>

Appends the neighbouring faces of the given face which share the same vertices. Sorts and dedups the result. Error if id invalid cache can be any Vec
Source§

impl<M, T, IC> IsVertexEditableMesh<T, Face3> for SearchableMesh<M, T, IC>

Source§

fn add_vertex(&mut self, vertex: T) -> VId

Should add a vertex to the end and return its id
Source§

fn change_vertex(&mut self, vid: VId, vertex: T) -> Result<()>

Should change vertex at vId to the given vertex returning an error on failure
Source§

fn reserve_vertices(&mut self, n: usize)

Should reserve space for n additional vertices

Auto Trait Implementations§

§

impl<M, T, IC> Freeze for SearchableMesh<M, T, IC>
where M: Freeze, IC: Freeze,

§

impl<M, T, IC> RefUnwindSafe for SearchableMesh<M, T, IC>

§

impl<M, T, IC> Send for SearchableMesh<M, T, IC>
where M: Send, IC: Send, T: Send,

§

impl<M, T, IC> Sync for SearchableMesh<M, T, IC>
where M: Sync, IC: Sync, T: Sync,

§

impl<M, T, IC> Unpin for SearchableMesh<M, T, IC>
where M: Unpin, IC: Unpin, T: Unpin,

§

impl<M, T, IC> UnwindSafe for SearchableMesh<M, T, IC>
where M: UnwindSafe, IC: UnwindSafe, T: UnwindSafe,

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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<M, P> IsMesh3D<P> for M
where M: IsMesh<P, Face3>, P: IsBuildable3D,

Source§

fn face_normal(&self, faceid: FId) -> Result<Norm3D>

Returns the normal of a face
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 = 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.