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

347

label

VEX

Attribute to match across inputs

favorite

232

label

VEX

Sphere Packing / Dart Throwing Algorithm

favorite

258

label

VEX

Deintersecting spheres with Voronoi

favorite

291

label

VEX

Fitting Planes to Point Clouds

favorite

302

label

VEX

How to analyze VEX code

favorite

140

label

VEX

Monte Carlo Geometry Processing