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() }
}))
.then(data => {
let group = api.group.new(data.map(el => new mesh.model({
let group = api.group.new([new mesh.model({
file: `subtracted`,
mesh: el
}) )).promote();
mesh: data
})]).promote();
api.selection.set([group]);
api.log.emit('subtract complete').unpin();
});

View file

@ -160,9 +160,9 @@ let model = {
let subs = [];
for (let obj of bases) {
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