pub struct PathTessellator {
pub tolerance: f64,
pub vertices: Vec<[f32; 2]>,
pub indices: Vec<u32>,
}Expand description
Path tessellation for GPU rendering.
Fields§
§tolerance: f64Tolerance for curve flattening
vertices: Vec<[f32; 2]>Generated vertices (x, y)
indices: Vec<u32>Triangle indices
Implementations§
Source§impl PathTessellator
impl PathTessellator
Sourcepub fn with_default_tolerance() -> Self
pub fn with_default_tolerance() -> Self
Create with default tolerance.
Sourcepub fn tessellate_polygon(&mut self, points: &[Point2D])
pub fn tessellate_polygon(&mut self, points: &[Point2D])
Tessellate a filled polygon.
Sourcepub fn tessellate_stroke(&mut self, points: &[Point2D], width: f64)
pub fn tessellate_stroke(&mut self, points: &[Point2D], width: f64)
Tessellate a stroked polyline.
Sourcepub fn tessellate_circle(
&mut self,
center: Point2D,
radius: f64,
segments: usize,
)
pub fn tessellate_circle( &mut self, center: Point2D, radius: f64, segments: usize, )
Tessellate a circle.
Sourcepub fn tessellate_rect(&mut self, x: f64, y: f64, width: f64, height: f64)
pub fn tessellate_rect(&mut self, x: f64, y: f64, width: f64, height: f64)
Tessellate a rectangle.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Get vertex count.
Sourcepub fn index_count(&self) -> usize
pub fn index_count(&self) -> usize
Get index count.
Sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
Get triangle count.
Trait Implementations§
Source§impl Clone for PathTessellator
impl Clone for PathTessellator
Source§fn clone(&self) -> PathTessellator
fn clone(&self) -> PathTessellator
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathTessellator
impl Debug for PathTessellator
Source§impl Default for PathTessellator
impl Default for PathTessellator
Source§fn default() -> PathTessellator
fn default() -> PathTessellator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PathTessellator
impl RefUnwindSafe for PathTessellator
impl Send for PathTessellator
impl Sync for PathTessellator
impl Unpin for PathTessellator
impl UnwindSafe for PathTessellator
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)