pub struct PolygonFace3D { /* private fields */ }Expand description
Concrete 3D polygon face backed by ordered point ids.
Implementations§
Source§impl PolygonFace3D
impl PolygonFace3D
Sourcepub fn new(
vertex_ids: Vec<PointId>,
vertex_table: SharedGeometryTable<PointId, CoordinateVector3D>,
) -> Self
pub fn new( vertex_ids: Vec<PointId>, vertex_table: SharedGeometryTable<PointId, CoordinateVector3D>, ) -> Self
Creates a polygon face from ordered point ids and a shared point table.
The vertex order determines the derived edge sequence, orientation, and normal direction.
Sourcepub fn triangulate(&self) -> Vec<Triangle3D>
pub fn triangulate(&self) -> Vec<Triangle3D>
Decomposes the polygon into a fan of triangles rooted at the first vertex.
Sourcepub fn from_triangles(triangles: &[Triangle3D]) -> Result<Self, ErrorsJSL>
pub fn from_triangles(triangles: &[Triangle3D]) -> Result<Self, ErrorsJSL>
Composes a polygon from a set of triangles that share a common boundary.
Trait Implementations§
Source§impl CanMirror for PolygonFace3D
impl CanMirror for PolygonFace3D
Source§impl CanRotate for PolygonFace3D
impl CanRotate for PolygonFace3D
Source§impl CanShear for PolygonFace3D
impl CanShear for PolygonFace3D
Source§impl CanTranslate for PolygonFace3D
impl CanTranslate for PolygonFace3D
Source§impl Clone for PolygonFace3D
impl Clone for PolygonFace3D
Source§impl Debug for PolygonFace3D
impl Debug for PolygonFace3D
Source§impl Display for PolygonFace3D
impl Display for PolygonFace3D
impl Eq for PolygonFace3D
impl GeometricPrimitive for PolygonFace3D
impl GeometricPrimitive3D for PolygonFace3D
Source§impl HasCentroid for PolygonFace3D
impl HasCentroid for PolygonFace3D
Source§impl HasEdges for PolygonFace3D
impl HasEdges for PolygonFace3D
Source§impl HasMeasure for PolygonFace3D
impl HasMeasure for PolygonFace3D
Source§fn measure(&self) -> GeometryMeasure
fn measure(&self) -> GeometryMeasure
Returns the primitive’s primary measure, such as length or area.
Source§impl HasOrientation for PolygonFace3D
impl HasOrientation for PolygonFace3D
Source§fn orientation(&self) -> Orientation2D
fn orientation(&self) -> Orientation2D
Returns the primitive orientation.
Source§impl<'a> HasVertices<'a> for PolygonFace3D
impl<'a> HasVertices<'a> for PolygonFace3D
Source§type Vertex = CoordinateVector3D
type Vertex = CoordinateVector3D
Point primitive stored in the vertex table.
Source§type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector3D>>>
type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector3D>>>
Borrowed point-table type.
Source§fn vertex_table(&self) -> &Self::VertexTable
fn vertex_table(&self) -> &Self::VertexTable
Returns an immutable reference to the vertex table.
Source§fn vertex_table_mut(&mut self) -> &mut Self::VertexTable
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)
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
fn vertex_table_size(&self) -> usize
Returns the number of entries in the vertex table.
Source§fn contains_vertex(&self, id: &PointId) -> bool
fn contains_vertex(&self, id: &PointId) -> bool
Returns
true if the vertex table contains id.Source§impl Hash for PolygonFace3D
impl Hash for PolygonFace3D
Source§impl<'a> IsPolygon<'a, CoordinateVector3D, UnitVector3D> for PolygonFace3D
impl<'a> IsPolygon<'a, CoordinateVector3D, UnitVector3D> for PolygonFace3D
Source§fn vertex_ids(&self) -> Box<dyn Iterator<Item = PointId> + '_>
fn vertex_ids(&self) -> Box<dyn Iterator<Item = PointId> + '_>
Returns the ordered point-table ids that define this polygon.
Source§fn set_vertex_id(
&mut self,
index: usize,
point_id: PointId,
) -> Result<(), ErrorsJSL>
fn set_vertex_id( &mut self, index: usize, point_id: PointId, ) -> Result<(), ErrorsJSL>
Replaces the point-table id at the given polygon vertex position.
Source§fn normal(&self) -> UnitVector3D
fn normal(&self) -> UnitVector3D
Returns the polygon normal.
Source§fn perimeter(&self) -> GeometryMeasure
fn perimeter(&self) -> GeometryMeasure
Returns the polygon perimeter.
Source§fn area(&self) -> GeometryMeasure
fn area(&self) -> GeometryMeasure
Returns the polygon area.
Source§fn plane(
&self,
) -> impl IsPlane<Point = CoordinateVector3D, Normal = UnitVector3D>
fn plane( &self, ) -> impl IsPlane<Point = CoordinateVector3D, Normal = UnitVector3D>
Returns the plane containing the polygon.
Auto Trait Implementations§
impl !RefUnwindSafe for PolygonFace3D
impl !Send for PolygonFace3D
impl !Sync for PolygonFace3D
impl !UnwindSafe for PolygonFace3D
impl Freeze for PolygonFace3D
impl Unpin for PolygonFace3D
impl UnsafeUnpin for PolygonFace3D
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