lelongg / geo-offset

Rust library containing algorithms to shrink and dilate various geometric shapes.

Home Page:https://crates.io/crates/geo-offset

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geo-offset

This crate contains algorithms to shrink and dilate various geometric shapes.

crate.io docs.rs

This code is a Rust port of the JS lib polygon-offset.

Example

The following example shows how to compute an inflated line. The offset method is provided by the Offset trait which is implemented for most geo-types.

use geo_types::{Coord, Line};
use geo_offset::Offset;

let line = Line::new(
    Coord { x: 0.0, y: 0.0 },
    Coord { x: 1.0, y: 8.0 },
);

let line_with_offset = line.offset(2.0)?;

About

Rust library containing algorithms to shrink and dilate various geometric shapes.

https://crates.io/crates/geo-offset


Languages

Language:Rust 97.4%Language:Nix 2.6%