Stacking bounding boxes

calendar_today

26.01.2023

label

Modeling

mouse

Houdini 19.5

Description

Transfering the height of pieces to point positions for copying.

1 Process

The number of individual mesh pieces gets assigned to the number of points on a vertical line.

nuniquevals('../MESH', D_PRIMITIVE, 'class')

Each point stores the height of a mesh piece.

string grp = '@class==' + itoa(i@ptnum);
vector size = getbbox_size(1, grp);
f@h = size.y;

All height values are promoted to an array in order to be sliced and summed up for setting the vertical point positions. These points are now spaced to accomodate for the accumulated height of each mesh piece.

float h[] = detail(0, 'h_arr', 0);
v@P.y = sum(h[0:i@ptnum]);

All mesh pieces are aligned to the floor so their bottom sits right at their corresponding line points when copied.

int class = prim(0, 'class', i@primnum);
string grp = '@class==' + itoa(class);

vector pos_center = getbbox_center(0, grp);
vector pos_min = getbbox_min(0, grp);

v@P -= set(pos_center.x, pos_min.y, pos_center.z);
download

Downloads