pub fn skeleton_of_polygon_to_linestring(
input_polygon: &Polygon,
orientation: bool,
) -> Vec<LineString>Expand description
This function returns a set of LineSting which represents an instantiated straight skeleton of the given polygon.
Each segment of the straight skeleton is represented as a single LineString, and the returned vector is a set of these LineStrings.
If either endpoints of a LineString is infinitely far from the other, then this LineString will be clipped to one which has shorter length.
The order of these LineStrings is arbitrary. (There is no gauranteed order on segments of the straight skeleton.)
Click ‘Result’ below to see how this function works.
§Arguments
input_polygon:Polygonto get the straight skeleton.orientation: determines the region where the straight skeleton created. The value of thisbooleanvariable will be:trueto create the staright skeleton on the inward region of the polygon, and,falseto create on the outward region of the polygon.
§Example
use geo_buffer::buffer_polygon;
use geo::{Polygon, MultiPolygon, LineString};
let p1 = Polygon::new(
LineString::from(vec![(0., 0.), (2., 0.), (2., 2.), (0., 2.)]), vec![],
);
let ls1: Vec<LineString> = skeleton_of_polygon_to_linestring(&p1, true);