log split
This commit is contained in:
parent
1958bd0c5f
commit
9149376874
3 changed files with 9 additions and 2 deletions
|
|
@ -175,8 +175,13 @@ let split = {
|
|||
},
|
||||
|
||||
select() {
|
||||
let { log } = mesh.api;
|
||||
let { models, plane } = split.state;
|
||||
Promise.all(models.map(m => m.split(plane))).then(split.end);
|
||||
log.emit(`splitting ${models.length} model(s) at ${plane.z.round(3)}`).pin();
|
||||
Promise.all(models.map(m => m.split(plane))).then(() => {
|
||||
log.emit('split complete').unpin();
|
||||
split.end();
|
||||
});
|
||||
},
|
||||
|
||||
end() {
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ mesh.model = class MeshModel extends mesh.object {
|
|||
// new model becomes top
|
||||
if (o2.length)
|
||||
this.group.add(new mesh.model({
|
||||
file: `${this.file}-split`,
|
||||
file: `${this.file}`,
|
||||
mesh: o2
|
||||
}).applyMatrix4(m4)).select();
|
||||
// this becomes bottom
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ let model = {
|
|||
return data;
|
||||
},
|
||||
|
||||
// split a model along an axis at a given point
|
||||
// return two arrays of vertices for each resulting object
|
||||
split(data) {
|
||||
let { id, matrix, z } = data;
|
||||
let o1 = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue