Skip to main content

IsPolygon

Trait IsPolygon 

Source
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§

Source

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>

Replaces the point-table id at the given polygon vertex position.

Source

fn normal(&self) -> N

Returns the polygon normal.

Source

fn perimeter(&self) -> GeometryMeasure

Returns the polygon perimeter.

Source

fn area(&self) -> GeometryMeasure

Returns the polygon area.

Source

fn plane(&self) -> impl IsPlane<Point = T, Normal = N>

Returns the plane containing the polygon.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§