woodsman
1/3/2020 - 11:18 PM

Isolate Leading Primitives

Used to either color or isolate primitives of a geo object that are currently moving 'forward' based on their velocity and a threshold parameter.

// Isolate faces/points on geo that are on the side of the geo currently moving forward
vector norm = @N;
vector vel = @v;
float thresh = chf("Threshold");
int toggleDel = chi("delete_not_in_threshold");

if(dot(norm, vel) > thresh){
    v@Cd = {1,0,0};
    if (toggleDel > 0){
      removepoint(0,@ptnum,1);
    }
}
else{
    v@Cd = {0,0,0};
}