2d-polygon-boolean
2d-polygon-boolean copied to clipboard
Error : when I use 'not' operation
var subject = [
[0, 0],
[100, 0],
[100, 100],
[0, 100]
];
var clip = [
[40, 0],
[60, 0],
[60, 100],
[40, 100]
];
var cut = this.polygonBoolean(subject, clip, 'not');
console.log('cut results', cut);
above is my code , what i expect is two rect [[0,0],[0,40],[40,100],[0,100]]
and [[0,60],[60,100],[100,100],[60,100]]
but,your program return me a square [[40,0],[0,0],[0,100],[40,100],[60,100],[100,100],[100,0],[60,0],[40,0]]
can you fix this bug?