pub struct Line { /* private fields */ }Expand description
An owned line string.
Implementations§
Source§impl Line
impl Line
pub fn rect(&self) -> Rect
pub fn num_points(&self) -> usize
pub fn point_at(&self, index: usize) -> Option<Point>
pub fn points(&self) -> &[Point]
pub fn num_segments(&self) -> usize
pub fn segment_at(&self, index: usize) -> Option<Segment>
pub fn clockwise(&self) -> bool
pub fn length(&self) -> f64
Sourcepub fn nearest_segment<RD, SD, I>(
&self,
rect_dist: RD,
seg_dist: SD,
iter: I,
) -> bool
pub fn nearest_segment<RD, SD, I>( &self, rect_dist: RD, seg_dist: SD, iter: I, ) -> bool
Iterates segments by distance. Returns true if completed.
pub fn new(points: &[Point]) -> Result<Self>
pub fn new_ix(points: &[Point], ix: IndexKind) -> Result<Self>
Sourcepub unsafe fn from_raw(ptr: *mut tg_line) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut tg_line) -> Option<Self>
§Safety
The pointer must be valid and not owned elsewhere.