21 releases

Uses old Rust 2015

0.1.20 Apr 10, 2020
0.1.19 Apr 24, 2019
0.1.18 Dec 24, 2018
0.1.16 Nov 8, 2018
0.1.4 Jul 18, 2018

#2436 in Algorithms

Download history 30/week @ 2023-11-10 13/week @ 2023-11-17 76/week @ 2023-11-24 70/week @ 2023-12-01 12/week @ 2023-12-08 32/week @ 2023-12-15 56/week @ 2023-12-22 11/week @ 2023-12-29 12/week @ 2024-01-05 16/week @ 2024-01-12 53/week @ 2024-01-19 59/week @ 2024-01-26 40/week @ 2024-02-02 55/week @ 2024-02-09 330/week @ 2024-02-16 645/week @ 2024-02-23

1,081 downloads per month
Used in michelangelo

MIT license

155KB
3.5K SLoC

descartes

descartes is a...

  • Error-tolerant 2D geometry engine
  • that allows for arbitrary error tolerances
  • dealing with both floating-point inaccuracies and much larger user input inaccuracies

With the following primitives:

  • line
  • circle
  • line/circle segment

And the following compound objects:

  • Path (continuous concatenation of line/circle segments)
  • Shape (Path outline with 0..n Path holes)
  • Band (a path with a thickness)

It offers...

  • Reexported 2D & 3D Point/Vector operations from nalgebra
  • Projections from and onto lines, circles, segments, paths, bands
  • Intersections
    • between lines & circles
    • between line/circle segments
    • between paths
  • Axis-aligned bounding boxes for
    • line/circle segments
    • paths
  • Boolean operations between shapes
  • Orthogonal offsets of segments
  • True Orthogonal offsets of paths (without producing self-intersections)
  • A RoughEq Trait for comparing things within a tolerance, with implementations for P2, P3 and V2, P3

It internally uses...

  • "Thick" primitives for tolerances

descartes is named after René Descartes, the father of analytical geometry.

Dependencies

~5.5MB
~104K SLoC