earcut icon indicating copy to clipboard operation
earcut copied to clipboard

Fix bug #74

Open finscn opened this issue 8 years ago • 8 comments

Only water-huge2 failed . the log says :

not ok 18 4464 triangles when expected 4461

I think maybe something is wrong in the test-case.

finscn avatar Dec 09 '17 23:12 finscn

With this PR , it could solve the problem in #74 :

image

finscn avatar Dec 09 '17 23:12 finscn

Cool! Can you describe the logic in more detail here?

mourner avatar Dec 10 '17 10:12 mourner

the key code is :

        var toRemove = false;

        if (!p.steiner) {
            if (equals(p, p.next) || equals(p.prev, p)) {
                toRemove = true;
            } else if (area(p.prev, p, p.next) === 0) {
                // If `p.prev, p & p.next` are on holes (not outer edge) ,
                // And `p.prev & p` are on the same hole ,
                // Then do NOT remove `p` .
                if (prevHole && nextHole && prevHole !== nextHole && prevHole === currentHole) {
                    toRemove = false;
                } else {
                    toRemove = true;
                }
            }
        }

But there is something I can't understand about

            if (equals(p, p.next) || equals(p.prev, p)) {
                toRemove = true;

if no || equals(p.prev, p) , the test-case in #74 will be failed.

finscn avatar Dec 10 '17 13:12 finscn

Is there any news about this pr & issue ?

finscn avatar May 06 '18 14:05 finscn

Is there any news about this pr & issue ???

finscn avatar Jun 07 '18 21:06 finscn

@finscn sorry, I didn't have the chance to thoroughly review it yet. It's on my list. Feel free to use your forked version in the mean time.

mourner avatar Jun 09 '18 17:06 mourner

I don't mean to add useless noise, but I'd be interested if there is a chance of this PR getting merged anytime soon.

stefnotch avatar Jul 28 '19 08:07 stefnotch