fix model center on regroup, duplicate relative to group dimensions

This commit is contained in:
Stewart Allen 2024-09-01 20:39:49 -04:00
commit 0da9019acb
3 changed files with 9 additions and 5 deletions

View file

@ -1154,7 +1154,11 @@ const tool = {
models = fallback(models, true);
if (models.length) {
log(`regrouping ${models.length} model(s)`);
return mesh.api.group.new(models.map(m => m.ungroup()));
let group = mesh.api.group.new(models.map(m => m.ungroup()));
let bounds = group.bounds;
models.forEach(m => m.centerTo(bounds.mid));
console.log({ bounds, group, models });
return group;
}
},