From a18bce59e1eb2227842dfe097e4b66e3d4be2398 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sun, 16 Jan 2022 00:42:36 -0500 Subject: [PATCH] select bottom of new split (for easy deletion) --- src/main/mesh.js | 1 + src/mesh/model.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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); }); }); }