Skip to content

Rust library for robust 2D geometric predicates. Wrapper for Jonathan Schewchuk's C library https://www.cs.cmu.edu/~quake/robust.html

Notifications You must be signed in to change notification settings

andersforsgren/robust2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

robust2d Build Status

Robust geometric predicates based on Jonathan Schewchuk's library https://www.cs.cmu.edu/~quake/robust.html Provides a simple ffi wrapper for the C library as well as some ergonomic Rust types and functions.

Example

let _ = arithmetic::Library::init();  // Must initialize some static constants for the robust arithmetic

// Circle center at (0.0, 1.0) r=1.0
let a = Point::new(-1.0, 1.0);
let b = Point::new(1.0, 1.0);
let c = Point::new(0.0, 2.0);

// Test point
let p2 = Point::new(0.1, 0.5);

println!("{:?}", p2.orient_to_circle(&a, &b, &c)); // "Inside"

About

Rust library for robust 2D geometric predicates. Wrapper for Jonathan Schewchuk's C library https://www.cs.cmu.edu/~quake/robust.html

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published