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

367

label

Modeling

Adaptive Resampling of Curves

favorite

447

label

Modeling

Applying Scales to Mesh Surfaces

favorite

418

label

Modeling

Approximating subdivision surfaces

favorite

31

label

Modeling

Copying Barb Wire along Curve

favorite

356

label

Modeling

Blending COPs SDFs into 3D Volume

favorite

462

label

Modeling

Branching Subdivision Curves