pub struct Triangle3D { /* private fields */ }Expand description
Concrete 3D triangle implementation backed by three point ids.
Implementations§
Source§impl Triangle3D
impl Triangle3D
Sourcepub fn new(
a_id: PointId,
b_id: PointId,
c_id: PointId,
vertex_table: SharedGeometryTable<PointId, CoordinateVector3D>,
) -> Self
pub fn new( a_id: PointId, b_id: PointId, c_id: PointId, vertex_table: SharedGeometryTable<PointId, CoordinateVector3D>, ) -> Self
Creates a triangle from three point ids and a shared point table.
The ids are interpreted in order as vertices a, b, and c.
Trait Implementations§
Source§impl CanMirror for Triangle3D
impl CanMirror for Triangle3D
Source§impl CanRotate for Triangle3D
impl CanRotate for Triangle3D
Source§impl CanShear for Triangle3D
impl CanShear for Triangle3D
Source§impl CanTranslate for Triangle3D
impl CanTranslate for Triangle3D
Source§impl Clone for Triangle3D
impl Clone for Triangle3D
Source§impl Debug for Triangle3D
impl Debug for Triangle3D
Source§impl Display for Triangle3D
impl Display for Triangle3D
impl Eq for Triangle3D
impl GeometricPrimitive for Triangle3D
impl GeometricPrimitive3D for Triangle3D
Source§impl HasCentroid for Triangle3D
impl HasCentroid for Triangle3D
Source§impl HasEdges for Triangle3D
impl HasEdges for Triangle3D
Source§impl HasMeasure for Triangle3D
impl HasMeasure for Triangle3D
Source§fn measure(&self) -> GeometryMeasure
fn measure(&self) -> GeometryMeasure
Returns the primitive’s primary measure, such as length or area.
Source§impl HasOrientation for Triangle3D
impl HasOrientation for Triangle3D
Source§fn orientation(&self) -> Orientation2D
fn orientation(&self) -> Orientation2D
Returns the primitive orientation.
Source§impl<'a> HasVertices<'a> for Triangle3D
impl<'a> HasVertices<'a> for Triangle3D
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 Triangle3D
impl Hash for Triangle3D
Source§impl<'a> IsPolygon<'a, CoordinateVector3D, UnitVector3D> for Triangle3D
impl<'a> IsPolygon<'a, CoordinateVector3D, UnitVector3D> for Triangle3D
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.
Source§impl<'a> IsTriangle<'a, CoordinateVector3D, UnitVector3D> for Triangle3D
impl<'a> IsTriangle<'a, CoordinateVector3D, UnitVector3D> for Triangle3D
Source§fn set_a_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_a_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Sets the point-table id of the first vertex.
Source§fn set_b_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_b_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Sets the point-table id of the second vertex.
Auto Trait Implementations§
impl !RefUnwindSafe for Triangle3D
impl !Send for Triangle3D
impl !Sync for Triangle3D
impl !UnwindSafe for Triangle3D
impl Freeze for Triangle3D
impl Unpin for Triangle3D
impl UnsafeUnpin for Triangle3D
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