auto-scale tiny obj imports
This commit is contained in:
parent
7d59cf7714
commit
e80e22026c
1 changed files with 9 additions and 1 deletions
|
|
@ -97,7 +97,15 @@ mesh.group = class MeshGroup extends mesh.object {
|
|||
}
|
||||
|
||||
promote() {
|
||||
return this.centerModels().centerXY().floor();
|
||||
this.centerModels();
|
||||
let { dim } = this.bounds;
|
||||
let { x, y, z } = dim;
|
||||
let max = Math.max(x, y, z);
|
||||
if (max < 2) {
|
||||
mesh.api.log.emit(`auto-scaling import from ${max.round(5)}`);
|
||||
this.scale(1000, 1000, 1000);
|
||||
}
|
||||
return this.centerXY().floor();
|
||||
}
|
||||
|
||||
// center objects to group bounds
|
||||
|
|
|
|||
Loading…
Reference in a new issue