pub trait IsPolygon<'a, T: IsPoint, N: IsUnitVector>:
GeometricPrimitive
+ HasVertices<'a, Vertex = T>
+ HasEdges
+ CanTranslate<Point = T>
+ CanRotate<Point = T>
+ CanShear<Point = T>
+ CanMirror<Point = T, Normal = N>
+ HasCentroid<Point = T>
+ HasMeasure
+ HasOrientation {
// Required methods
fn vertex_ids(&self) -> Box<dyn Iterator<Item = PointId> + '_>;
fn set_vertex_id(
&mut self,
index: usize,
point_id: PointId,
) -> Result<(), ErrorsJSL>;
fn normal(&self) -> N;
fn perimeter(&self) -> GeometryMeasure;
fn area(&self) -> GeometryMeasure;
fn plane(&self) -> impl IsPlane<Point = T, Normal = N>;
}Expand description
A polygon primitive defined by an ordered point table.
Required Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn perimeter(&self) -> GeometryMeasure
fn perimeter(&self) -> GeometryMeasure
Returns the polygon perimeter.
Sourcefn area(&self) -> GeometryMeasure
fn area(&self) -> GeometryMeasure
Returns the polygon area.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".