Copy Meshes to Primitives

calendar_today

02.12.2023

label

VEX, Modeling

mouse

Houdini 19.5

Description

Copying meshes to their own polygons using VEX.

1 Code discussion

The mesh is copied multiple times based on the number of the polygons of the target mesh. The copy node creates an individual copynum-attribute which is used to ad.

C
        vector bb = relbbox(0, v@P).zxy;
int copy = prim(0, 'copynum', i@primnum);

vector pos = primuv(1, 'P', copy, bb);
vector nml = prim_normal(1, copy, bb);
float area = primintrinsic(0, 'measuredarea', copy);

v@P = pos + nml * bb.z * sqrt(area);
v@Cd = bb;
    
download

Downloads

link

Related articles

favorite

415

label

VEX

Attribute to match across inputs

favorite

12

label

VEX

Curves from Ramp Parameters

favorite

308

label

VEX

Sphere Packing / Dart Throwing Algorithm

favorite

326

label

VEX

Deintersecting spheres with Voronoi

favorite

367

label

VEX

Fitting Planes to Point Clouds

favorite

360

label

VEX

How to Analyze VEX Code