stub in subtraction. jscad subtract seems to be broken at the api, though
This commit is contained in:
parent
6e2b93af0f
commit
c7298d2a9f
7 changed files with 113 additions and 47 deletions
|
|
@ -150,6 +150,20 @@ let model = {
|
|||
return base.CSG.toPositionArray(union);
|
||||
},
|
||||
|
||||
subtract(recs) {
|
||||
let bases = recs.filter(rec => !rec.tool)
|
||||
.map(rec => translate_encode(rec.id, rec.matrix))
|
||||
.map(a => base.CSG.fromPositionArray(a));
|
||||
let tools = recs.filter(rec => rec.tool)
|
||||
.map(rec => translate_encode(rec.id, rec.matrix))
|
||||
.map(a => base.CSG.fromPositionArray(a));
|
||||
let subs = [];
|
||||
for (let obj of bases) {
|
||||
subs.appendAll(base.CSG.subtract(obj, ...tools));
|
||||
}
|
||||
return base.CSG.toPositionArray(subs);
|
||||
},
|
||||
|
||||
// used to generate a list for split snapping
|
||||
zlist(data) {
|
||||
let { id, matrix, round } = data;
|
||||
|
|
|
|||
Loading…
Reference in a new issue