diff --git a/src/main/mesh.js b/src/main/mesh.js index d2219fc7..f75e912c 100644 --- a/src/main/mesh.js +++ b/src/main/mesh.js @@ -201,6 +201,7 @@ let split = { let { models, plane, zlist } = split.state; log.emit(`splitting ${models.length} model(s) at ${plane.z.round(3)}`).pin(); Promise.all(models.map(m => m.split(plane))).then(models => { + mesh.api.selection.set(models); log.emit('split complete').unpin(); split.end(); }); diff --git a/src/mesh/model.js b/src/mesh/model.js index b9f5fe42..f0229544 100644 --- a/src/mesh/model.js +++ b/src/mesh/model.js @@ -357,14 +357,14 @@ mesh.model = class MeshModel extends mesh.object { file: `${this.file}`, mesh: o2 }).applyMatrix4(m4)).select(); - // this becomes bottom if (o1.length) { + // this becomes bottom this.reload(o1); + resolve(this); } else { this.remove(); + resolve(model); } - // return the split model - resolve(model); }); }); }