My goal is to uniformly scale down any input geometry so it fits in a 1x1x1 box.
For this I need to find a way to measure the size of the geometry for each axis, see in which axis it has the largest size and finally scale this down to one (by dividing it) and scaling the rest down by the same value.
Can anyone help me with the measuring?
Cheers!
Measure size of geometry for every axis
4669 4 1-
- aarondornez
- Member
- 25 posts
- Joined: Nov. 2016
- Offline
-
- Dougie0047
- Member
- 107 posts
- Joined:
- Offline
Hello aarondornez,
I've made a preset for doing this for my transform nodes. Basically here is what I put in my various fields:
In translate: -$CEX, -$CEY, -$CEZ
In scale, in all fields: 1/max(max($SIZEX,$SIZEY), $SIZEZ)
In pivot: $CEX, $CEY, $CEZ
This should scale any geometry to unit size and center it at the origin of your scene.
Cheers,
Dag
I've made a preset for doing this for my transform nodes. Basically here is what I put in my various fields:
In translate: -$CEX, -$CEY, -$CEZ
In scale, in all fields: 1/max(max($SIZEX,$SIZEY), $SIZEZ)
In pivot: $CEX, $CEY, $CEZ
This should scale any geometry to unit size and center it at the origin of your scene.
Cheers,
Dag
-
- jlait
- Staff
- 6818 posts
- Joined: July 2005
- Offline
-
- aarondornez
- Member
- 25 posts
- Joined: Nov. 2016
- Offline
-
- Konstantin Magnus
- Member
- 721 posts
- Joined: Sept. 2013
- Offline
In order to scale any object proportionally to unit size, you can also put this into a point wrangle:
float max_size = max( getbbox_size(0) ); @P *= 1.0 / max_size;
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
-
- Quick Links



