Skip to main content

Mesh2D

Struct Mesh2D 

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

Concrete 2D mesh implementation referencing polygon faces through ids.

Implementations§

Source§

impl Mesh2D

Source

pub fn new( face_ids: Vec<FaceId>, vertex_table: SharedGeometryTable<PointId, CoordinateVector2D>, face_table: SharedGeometryTable<FaceId, PolygonFace2D>, ) -> Self

Creates a mesh from ordered face ids and shared point and face tables.

Trait Implementations§

Source§

impl Clone for Mesh2D

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 Mesh2D

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Mesh2D

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Mesh2D

Source§

impl GeometricPrimitive for Mesh2D

Source§

impl GeometricPrimitive2D for Mesh2D

Source§

impl HasEdges for Mesh2D

Source§

type Edge = Line2D

Edge type returned by the implementor.
Source§

fn edge_count(&self) -> usize

Number of edges available on the shape.
Source§

fn edge(&self, index: usize) -> Option<Self::Edge>

Returns an edge by index.
Source§

impl<'a> HasFaces<'a> for Mesh2D

Source§

type Point = CoordinateVector2D

Point primitive referenced by the stored faces.
Source§

type Normal = UnitVector2D

Unit normal type used by the stored faces.
Source§

type Face = PolygonFace2D

Polygon face primitive stored in the face table.
Source§

type FaceTable = Rc<RefCell<HashGeometryTable<FaceId, PolygonFace2D>>>

Borrowed face-table type.
Source§

fn face_table(&self) -> &Self::FaceTable

Returns an immutable reference to the face table.
Source§

fn face_table_mut(&mut self) -> &mut Self::FaceTable

Returns a mutable reference to the face table.
Source§

fn set_face_table(&mut self, table: &'a mut Self::FaceTable)

Rebinds the implementor to a different borrowed face table.
Source§

fn face_table_size(&self) -> usize

Returns the number of entries in the face table.
Source§

fn get_face(&self, id: &FaceId) -> Option<Self::Face>

Returns the face stored at id.
Source§

fn contains_face(&self, id: &FaceId) -> bool

Returns true if the face table contains id.
Source§

fn insert_face( &mut self, id: FaceId, value: Self::Face, ) -> Result<(), ErrorsJSL>

Inserts or replaces the face stored at id.
Source§

fn remove_face(&mut self, id: &FaceId) -> Option<Self::Face>

Removes and returns the face stored at id, if present.
Source§

impl<'a> HasVertices<'a> for Mesh2D

Source§

type Vertex = CoordinateVector2D

Point primitive stored in the vertex table.
Source§

type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector2D>>>

Borrowed point-table type.
Source§

fn vertex_table(&self) -> &Self::VertexTable

Returns an immutable reference to the vertex table.
Source§

fn vertex_table_mut(&mut self) -> &mut Self::VertexTable

Returns a mutable reference to the vertex table.
Source§

fn set_vertex_table(&mut self, table: &'a mut Self::VertexTable)

Rebinds the implementor to a different borrowed vertex table.
Source§

fn vertex_table_size(&self) -> usize

Returns the number of entries in the vertex table.
Source§

fn get_vertex(&self, id: &PointId) -> Option<Self::Vertex>

Returns the vertex stored at id.
Source§

fn contains_vertex(&self, id: &PointId) -> bool

Returns true if the vertex table contains id.
Source§

fn insert_vertex( &mut self, id: PointId, value: Self::Vertex, ) -> Result<(), ErrorsJSL>

Inserts or replaces the vertex stored at id.
Source§

fn remove_vertex(&mut self, id: &PointId) -> Option<Self::Vertex>

Removes and returns the vertex stored at id, if present.
Source§

impl Hash for Mesh2D

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> IsMesh<'a, CoordinateVector2D, UnitVector2D> for Mesh2D

Source§

fn face_ids(&self) -> Box<dyn Iterator<Item = FaceId> + '_>

Returns the ordered face-table ids that participate in this mesh.
Source§

fn set_face_id( &mut self, index: usize, face_id: FaceId, ) -> Result<(), ErrorsJSL>

Replaces the face-table id at the given mesh face position.
Source§

fn surface_area(&self) -> GeometryMeasure

Returns the total surface area of the mesh.
Source§

fn face_count(&self) -> usize

Returns the number of faces in the mesh.
Source§

fn face(&self, index: usize) -> Option<<Self as HasFaces<'a>>::Face>

Resolves and returns a face by mesh-local position.
Source§

fn face_normal(&self, index: usize) -> Option<N>

Returns the normal associated with a face, if present.
Source§

impl PartialEq for Mesh2D

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Mesh2D

§

impl !Send for Mesh2D

§

impl !Sync for Mesh2D

§

impl !UnwindSafe for Mesh2D

§

impl Freeze for Mesh2D

§

impl Unpin for Mesh2D

§

impl UnsafeUnpin for Mesh2D

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> MaybeSerialize for T
where T: ?Sized,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.