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

445

label

VEX

Attribute to Match across Inputs

favorite

149

label

VEX

Curves from Ramp Parameters

favorite

401

label

VEX

Sphere Packing / Dart Throwing Algorithm

favorite

415

label

VEX

Deintersecting spheres with Voronoi

favorite

463

label

VEX

Fitting Planes to Point Clouds

favorite

458

label

VEX

How to Analyze VEX Code