pub struct Triangle2D { /* private fields */ }Expand description
Concrete 2D triangle implementation backed by three point ids.
Implementations§
Source§impl Triangle2D
impl Triangle2D
Sourcepub fn new(
a_id: PointId,
b_id: PointId,
c_id: PointId,
vertex_table: SharedGeometryTable<PointId, CoordinateVector2D>,
) -> Self
pub fn new( a_id: PointId, b_id: PointId, c_id: PointId, vertex_table: SharedGeometryTable<PointId, CoordinateVector2D>, ) -> Self
Creates a triangle from three point ids and a shared point table.
Trait Implementations§
Source§impl CanMirror for Triangle2D
impl CanMirror for Triangle2D
Source§impl CanRotate for Triangle2D
impl CanRotate for Triangle2D
Source§impl CanShear for Triangle2D
impl CanShear for Triangle2D
Source§impl CanTranslate for Triangle2D
impl CanTranslate for Triangle2D
Source§impl Clone for Triangle2D
impl Clone for Triangle2D
Source§impl Debug for Triangle2D
impl Debug for Triangle2D
Source§impl Display for Triangle2D
impl Display for Triangle2D
impl Eq for Triangle2D
impl GeometricPrimitive for Triangle2D
impl GeometricPrimitive2D for Triangle2D
Source§impl HasCentroid for Triangle2D
impl HasCentroid for Triangle2D
Source§impl HasEdges for Triangle2D
impl HasEdges for Triangle2D
Source§impl HasMeasure for Triangle2D
impl HasMeasure for Triangle2D
Source§fn measure(&self) -> GeometryMeasure
fn measure(&self) -> GeometryMeasure
Returns the primitive’s primary measure, such as length or area.
Source§impl HasOrientation for Triangle2D
impl HasOrientation for Triangle2D
Source§fn orientation(&self) -> Orientation2D
fn orientation(&self) -> Orientation2D
Returns the primitive orientation.
Source§impl<'a> HasVertices<'a> for Triangle2D
impl<'a> HasVertices<'a> for Triangle2D
Source§type Vertex = CoordinateVector2D
type Vertex = CoordinateVector2D
Point primitive stored in the vertex table.
Source§type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector2D>>>
type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector2D>>>
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 Triangle2D
impl Hash for Triangle2D
Source§impl<'a> IsPolygon<'a, CoordinateVector2D, UnitVector2D> for Triangle2D
impl<'a> IsPolygon<'a, CoordinateVector2D, UnitVector2D> for Triangle2D
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) -> UnitVector2D
fn normal(&self) -> UnitVector2D
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 = CoordinateVector2D, Normal = UnitVector2D>
fn plane( &self, ) -> impl IsPlane<Point = CoordinateVector2D, Normal = UnitVector2D>
Returns the plane containing the polygon.
Source§impl<'a> IsTriangle<'a, CoordinateVector2D, UnitVector2D> for Triangle2D
impl<'a> IsTriangle<'a, CoordinateVector2D, UnitVector2D> for Triangle2D
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 Triangle2D
impl !Send for Triangle2D
impl !Sync for Triangle2D
impl !UnwindSafe for Triangle2D
impl Freeze for Triangle2D
impl Unpin for Triangle2D
impl UnsafeUnpin for Triangle2D
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