Closed nosy-b closed 12 years ago
@zz85 any ideas?
you have a case our current triangulation algorithm doesn't work very well with - a small parameter with many holes (in this case, only 4 points for the parameter). one way is to add more points to parameters, and certain times setting useSpacedPoints:true may help.
i've thought of rewriting the hole cutting algorithm or the entire triangulation algorithm again, but i've never gotten to it.
a more "stable" solution may be use another triangulation algorithm which works with three.js and this relies on tri2poly.js (mrdoob, perhaps we could add a flag to allow tri2poly.js algorithm?)
an working example is http://jsbin.com/obajov/edit#javascript,html,live
p.s. An alternative to building geometry procedurally is using csg. See http://chandler.prallfamily.com/2011/12/constructive-solid-geometry-with-three-js/ http://learningthreejs.com/blog/2011/12/10/constructive-solid-geometry-with-csg-js/
Thanks! I actually solved my problem creating my own façade triangulation class which was easy because I suppose façade are planars and windows and doors are parallel to each other. But I'm gonna try to do something more generic after.
@mrdoob Why was this closed? The erroneous algorithm still exists within Three
@zz85 Did you ever gotten around to figuring out the correct algorithm?
@nicholaswmin i haven't have the time to reimplement the triangulation algorithm. its possible to use poly2tri.js with three.js or you could attempt writing one too.
Hi,
I'm working on a simple modeler and I used ExtrudeGeometry on a shape containing some holes. It ususally works fine with one or two holes but it seems not very stable after. I tried to keep anti-clockwise order for hole vertices but still it doesn't work fine. Here is a very simple example that doesn't work, the triangulation is wrong:
If you have any idea it would save me because I really don't get it and I don't know any other way to do some simple building façade :)