earcut icon indicating copy to clipboard operation
earcut copied to clipboard

Bad triangulation in shape with duplicate vertices

Open casperlamboo opened this issue 9 years ago • 1 comments

I have data sets that can contain duplicate vertices.

In this case the holes aren't handled correctly. download When I remove the duplicate vertices the holes are handled correctly. download 1

It is possible to solve this by filtering out the duplicate vertices, but in some cases it would be useful to have the triangulation match the data set. (issue might be related to #52)

I've created an ESbin with example code

casperlamboo avatar Aug 17 '16 10:08 casperlamboo

I think the work about Cleaning & Simplify is not earcut's job. If we can't ensure the polygon is a correct simple polygon , we could use other tools (e.g. jsclipper ) to do Cleaning & Simplify. If earcut do too many works , the size & performance will be bad.

(Sorry , my english is very bad , I hope you could understand me )

finscn avatar Mar 22 '17 22:03 finscn