mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
103.08k stars 35.41k forks source link

Holes in contours causes triangulation failure #3386

Closed timo22345 closed 10 years ago

timo22345 commented 11 years ago

Not sure if this is a bug, but the triangulation fails, although shape is simple. See the images, code and description of the problem:

http://stackoverflow.com/questions/16241854/holes-in-polygons-causes-triangulation-failure-in-three-js

Without holes works.

Every combination of orientation has no effect.


UPDATE: I checked the Three.js code and there is a link to http://www.sakri.net/blog/2009/06/12/an-approach-to-triangulating-polygons-with-holes/, which says that 90% of times it works.

If that method is used for triangulation in Three.js, 90% propability is not acceptable in production environments.

gero3 commented 10 years ago

I think this one is fixed for now.

timo22345 commented 10 years ago

wow the version 66dev works perfectly

Also I have had good experiences so far. No need anymore for poly2tri. Thanks!

mrdoob commented 10 years ago

@jahting ftw! :D

zz85 commented 10 years ago

@jahting :+1:

dineshkrishnareddy commented 6 years ago

This comment is moved to a new issue. Please check 13160

Mugen87 commented 6 years ago

@svcew-dinesh Please don't post at threads which are closed for years. Instead, open a new issue and provide a reduced test case to show the bug.