fix triangulation of csg union
This commit is contained in:
parent
fb9e10eb6c
commit
563694a2f1
2 changed files with 26 additions and 8 deletions
|
|
@ -410,6 +410,7 @@ function orderClosest(array, fn, from) {
|
|||
// an unwrapped array in the original dimensions
|
||||
function triangulate(array, holes, dims) {
|
||||
let narray;
|
||||
let info;
|
||||
if (dims === 2) {
|
||||
narray = array;
|
||||
} else {
|
||||
|
|
@ -434,6 +435,7 @@ function triangulate(array, holes, dims) {
|
|||
d1 = i;
|
||||
}
|
||||
}
|
||||
info = { d1, d2, dmax, delta: delta.slice() };
|
||||
delta[d1] = dmax = 0;
|
||||
for (let i = 0; i < dims; i++) {
|
||||
if (delta[i] > dmax) {
|
||||
|
|
@ -455,6 +457,9 @@ function triangulate(array, holes, dims) {
|
|||
oa[e++] = array[ai + j];
|
||||
}
|
||||
}
|
||||
if (oa.length === 0) {
|
||||
console.log('debug_triangulate', {array, oa, info});
|
||||
}
|
||||
return oa;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue