pixelsandcandy / poly2tri

Automatically exported from code.google.com/p/poly2tri
Other
0 stars 0 forks source link

js version failes to parse this polygon #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. open http://javascript.poly2tri.googlecode.com/hg/index.html?kjuvj
2. paste 71 161,100 66,280 97,282 223,201 238,75 243 as a poly contour
3. paste 101 102,103 204,205 206,207 108 as a hole
4. zero offsets
5. click "Triangulate!"

What is the expected output? What do you see instead?
triangulated mesh drawn; instead, nothing happens.

What version of the product are you using? On what operating system?
javascript

Please provide any additional information below.
fails on this line:
            if (px == nx) {
                // We might have two nodes with same x value for a short time
                if (point.equals(node.prev.point)) {
because node.prev is null

following fixes it in my as3 port:
            if (px == nx) {
                // We might have two nodes with same x value for a short time
                if (node.prev && point.equals(node.prev.point)) {
                    node = node.prev;
                } else if (node.next && point.equals(node.next.point)) {
                    node = node.next;
                } else if (point.equals(node.point)) {

Original issue reported on code.google.com by makc.the...@gmail.com on 15 Feb 2012 at 11:42

GoogleCodeExporter commented 9 years ago
I've also stumbled aboiut this problem in my code and the suggested fix is also 
working for me!

=> I suggest updating the source

Original comment by maye...@gmail.com on 19 Feb 2012 at 12:20

GoogleCodeExporter commented 9 years ago
You're more then welcome to submit a patch.

Original comment by mason.gr...@gmail.com on 4 Apr 2012 at 1:23

GoogleCodeExporter commented 9 years ago
Anyone is welcome to submit a patch. C++ and Java are now the officially 
supported languages.

Original comment by mason.gr...@gmail.com on 7 Apr 2012 at 5:14