auto-select patches
This commit is contained in:
parent
91995b5762
commit
92ece197a1
2 changed files with 6 additions and 1 deletions
|
|
@ -315,6 +315,7 @@ let tool = {
|
||||||
let newmdl = [];
|
let newmdl = [];
|
||||||
let mcore = new THREE.Matrix4().makeRotationX(Math.PI / 2);
|
let mcore = new THREE.Matrix4().makeRotationX(Math.PI / 2);
|
||||||
for (let m of models) {
|
for (let m of models) {
|
||||||
|
// todo - translate vertices with source model's matrix
|
||||||
let p = worker.model_analyze(m.id).then(data => {
|
let p = worker.model_analyze(m.id).then(data => {
|
||||||
let { areas, edges } = data.mapped;
|
let { areas, edges } = data.mapped;
|
||||||
let nm = areas.map(area => new mesh.model({
|
let nm = areas.map(area => new mesh.model({
|
||||||
|
|
@ -327,7 +328,7 @@ let tool = {
|
||||||
}
|
}
|
||||||
Promise.all(promises).then(() => {
|
Promise.all(promises).then(() => {
|
||||||
if (newmdl.length) {
|
if (newmdl.length) {
|
||||||
mesh.api.group.new(newmdl, undefined, "patch");
|
mesh.api.group.new(newmdl, undefined, "patch").select();
|
||||||
}
|
}
|
||||||
api.log.emit('analysis complete').unpin();
|
api.log.emit('analysis complete').unpin();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,10 @@ mesh.object = class MeshObject {
|
||||||
return this.applyMatrix(matrix.elements).matrixChanged();
|
return this.applyMatrix(matrix.elements).matrixChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
select() {
|
||||||
|
mesh.api.selection.set([this]);
|
||||||
|
}
|
||||||
|
|
||||||
focus() {
|
focus() {
|
||||||
mesh.api.focus(this.object);
|
mesh.api.focus(this.object);
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue