Struct geom::tessellation::Tessellation
source · [−]Expand description
A tessellated polygon, ready for rendering.
Fields
points: Vec<Pt2D>
These points aren’t in any meaningful order. It’s not generally possible to reconstruct a
Polygon
from this.
indices: Vec<u16>
Groups of three indices make up the triangles
Implementations
sourceimpl Tessellation
impl Tessellation
pub fn new(points: Vec<Pt2D>, indices: Vec<usize>) -> Self
sourcepub fn from_ring(points: Vec<Pt2D>) -> Self
pub fn from_ring(points: Vec<Pt2D>) -> Self
The points
are not necessarily a Ring
, which has strict requirements about no duplicate
points. We can render various types of invalid polygon.
pub fn triangles(&self) -> Vec<Triangle>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn get_bounds(&self) -> Bounds
pub fn center(&self) -> Pt2D
fn transform<F: Fn(&Pt2D) -> Pt2D>(&mut self, f: F)
pub fn translate(&mut self, dx: f64, dy: f64)
pub fn scale(&mut self, factor: f64)
pub fn scale_xy(&mut self, x_factor: f64, y_factor: f64)
pub fn rotate(&mut self, angle: Angle)
pub fn rotate_around(&mut self, angle: Angle, pivot: Pt2D)
sourcepub fn inplace_multi_transform(
&mut self,
scale: f64,
translate_x: f64,
translate_y: f64,
rotate: Angle,
pivot: Pt2D
)
pub fn inplace_multi_transform(
&mut self,
scale: f64,
translate_x: f64,
translate_y: f64,
rotate: Angle,
pivot: Pt2D
)
Equivalent to self.scale(scale).translate(translate_x, translate_y).rotate_around(rotate, pivot)
, but modifies the polygon in-place and is faster.
pub fn union(self, other: Self) -> Self
pub fn union_all(list: Vec<Self>) -> Self
Trait Implementations
sourceimpl Clone for Tessellation
impl Clone for Tessellation
sourcefn clone(&self) -> Tessellation
fn clone(&self) -> Tessellation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl From<Polygon<f64>> for Tessellation
impl From<Polygon<f64>> for Tessellation
Auto Trait Implementations
impl RefUnwindSafe for Tessellation
impl Send for Tessellation
impl Sync for Tessellation
impl Unpin for Tessellation
impl UnwindSafe for Tessellation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more