Hack to allow CSG of Turtle meshes to work
This commit is contained in:
parent
a2124faebc
commit
7d1f6fe249
|
@ -462,8 +462,15 @@ export function buildCSG(name: string, scene: Scene, expr: Shapes.CSGExpr): Buil
|
||||||
n.freezeWorldMatrix(matrix, true);
|
n.freezeWorldMatrix(matrix, true);
|
||||||
n.unfreezeWorldMatrix();
|
n.unfreezeWorldMatrix();
|
||||||
});
|
});
|
||||||
const c = CSG.FromMesh(nodes[0]);
|
const cs = nodes.flatMap(n => {
|
||||||
nodes.slice(1).forEach(n => c.unionInPlace(CSG.FromMesh(n)));
|
try {
|
||||||
|
return [CSG.FromMesh(n)];
|
||||||
|
} catch (_e) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const c = cs[0];
|
||||||
|
cs.slice(1).forEach(d => c.unionInPlace(d));
|
||||||
nodes.forEach(n => n.dispose());
|
nodes.forEach(n => n.dispose());
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue