Knowledge Garden

Search

Search IconIcon to open search

Maintain gaps in a resample houdini

Last updated May 9, 2023 Edit Source

This solves a problem I have often encountered where I need the gaps to stay the same as things are instanced onto a resampled line.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
if(@ptnum<@numpt-1){
vector nextP = point(0, "P", @ptnum+1);
@boardSize = distance(@P, nextP);
}
else{
vector lastP = point(0, "P", @ptnum-1);
@boardSize = distance(@P, lastP);
}
float taper = chramp("ShrinkShape",@grad);
//if you want to art direct the gap, and space them tighter closer
//one side or something

//@boardSize*=ch("ShrinkPercent")*taper;
//if you want to maintain a gap based on percentage of board size
@boardSize -= ch("ShrinkAmt")*taper;
//for a measured gap