let subtract behave like union

This commit is contained in:
Stewart Allen 2022-04-20 17:28:07 -04:00
commit df3d3941c8
2 changed files with 5 additions and 5 deletions

View file

@ -384,10 +384,10 @@ const tool = {
return { id: m.id, matrix: m.matrix, tool: m.tool() } return { id: m.id, matrix: m.matrix, tool: m.tool() }
})) }))
.then(data => { .then(data => {
let group = api.group.new(data.map(el => new mesh.model({ let group = api.group.new([new mesh.model({
file: `subtracted`, file: `subtracted`,
mesh: el mesh: data
}) )).promote(); })]).promote();
api.selection.set([group]); api.selection.set([group]);
api.log.emit('subtract complete').unpin(); api.log.emit('subtract complete').unpin();
}); });

View file

@ -160,9 +160,9 @@ let model = {
let subs = []; let subs = [];
for (let obj of bases) { for (let obj of bases) {
let sub = base.CSG.subtract(obj, ...tools); let sub = base.CSG.subtract(obj, ...tools);
subs.append(base.CSG.toPositionArray(sub)); subs.appendAll(base.CSG.toPositionArray(sub));
} }
return subs; return subs.toFloat32();
}, },
// used to generate a list for split snapping // used to generate a list for split snapping