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.unfreezeWorldMatrix();
|
||||
});
|
||||
const c = CSG.FromMesh(nodes[0]);
|
||||
nodes.slice(1).forEach(n => c.unionInPlace(CSG.FromMesh(n)));
|
||||
const cs = nodes.flatMap(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());
|
||||
return c;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue