fix bounding box update for model changes. add menu for it

This commit is contained in:
Stewart Allen 2022-01-08 22:42:57 -05:00
commit a6b85d4a59
4 changed files with 8 additions and 1 deletions

View file

@ -191,6 +191,7 @@ function ui_build() {
h.button({ _: 'analyze', disabled: true }),
h.button({ _: 'repair', onclick: api.tool.repair }),
h.div({ class: "vsep" }),
h.button({ _: 'bounds', onclick() { api.selection.boundsBox({toggle:true}) } }),
h.button({ _: 'gridlines', onclick() { api.grid() } }),
h.button({ _: 'wireframe', onclick() { api.wireframe() } }),
]),

View file

@ -227,6 +227,11 @@ mesh.model = class MeshModel extends mesh.object {
this.removed = 'complete';
}
}
updateBoundsBox() {
mesh.util.defer(this.group.deferUBB);
}
};
})();

View file

@ -20,6 +20,7 @@ mesh.object = class MeshObject {
constructor(id) {
this.id = id || mesh.util.uuid();
this.deferUBB = () => { this.updateBoundsBox() };
worker.object_create({id: this.id, type: this.type});
}