mapbox / earcut.hpp

Fast, header-only polygon triangulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with triangulating a polygon with 3d coords

Atuljust11 opened this issue · comments

I am creating a 3d polygon in Babylonjs . Captured points are right from 3d floor house.
Trying to get right winding order.
This point are in order of x,y,z total total 6 vertices data .

case 1
earcut([1321.229736328125, -678.8887939453125, 627.7532348632812, 143.97128295898438, -678.8887939453125, -1463.690185546875, -1583.582275390625, -678.8887939453125, -214.28005981445312, -867.3407592773438, -678.8887939453125, 1260.2886962890625, -129.64634704589844, -678.8887939453125, 1403.4495849609375, 1310.8477783203125, -678.8887939453125, 639.3106689453125], null, 3);
return []

case 2
earcut([1321, -678, 627, 143, -678, -1463, -1583, -678, -214, -867, -678, 1260, -129, -678, 1403, 1310, -6785, 639], null, 3);
return
[5, 0, 1, 4, 5, 1]

both are wrong

Sorry, this issue has been reported to the wrong repository. You probably meant to report it to https://github.com/mapbox/earcut/issues .