mapbox / delaunator

An incredibly fast JavaScript library for Delaunay triangulation of 2D points
https://mapbox.github.io/delaunator/
ISC License
2.24k stars 139 forks source link

How recieve from delaunator only trialgles lays in borders of original polygon? #77

Closed DigitCell closed 1 year ago

DigitCell commented 1 year ago

If polygon not convex (concave), delanuator put in answer also triangles out of border of polygon, so need some check. How to do that in code?

Fil commented 1 year ago

Maybe https://observablehq.com/@mourner/adaptive-concave-hull can help?

mourner commented 1 year ago

Delaunator is operating purely on points, not on polygons. You might be looking for Constrained Delaunay instead — see discussion in #9, and check out https://github.com/kninnug/constrainautor