Skip to main content

offset_paths

Function offset_paths 

Source
pub fn offset_paths(
    paths: &(impl PathSource + ?Sized),
    delta: i64,
    join: Join,
    cap: EndCap,
    tol: ArcTol,
) -> Result<PolygonSet>
Expand description

Offsets open paths. See offset_paths_tree.

use polyclip::{offset_paths, ArcTol, EndCap, Join, Path, Side};
let track = Path::from([(0, 0), (1000, 0)]);
let s = offset_paths(&track, 100, Join::Round, EndCap::Butt, ArcTol::new(1, Side::Outside)).unwrap();
assert_eq!(s[0].outer.signed_area2(), 2 * 1000 * 200);