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.

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

Each point stores the height of a mesh piece.

C
        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.

C
        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.

C
        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

link

Related articles

favorite

169

label

Modeling

Adaptive Resampling of Curves

favorite

317

label

Modeling

Applying Scales to Mesh Surfaces

favorite

272

label

Modeling

Approximating subdivision surfaces

favorite

216

label

Modeling

Blending COPs SDFs into 3D Volume

favorite

308

label

Modeling

Branching Subdivision Curves

favorite

160

label

Modeling

Circuit Networks