Skip to main content

Groups:

  • Check if a group exist : nprimsgroup(surface_node, group_name)
  • Select ends points of a curve (less than 2 neighbours points) : neighbourcount(0,@ptnum) < 2

Gradient :

 @ptnum/(@numpt-1);
 fit(@ptnum,0,@numpt,0,1);  

Geometry :

  • Create a primitive : addprim(0, « polyline »)

Controlled Random Distribution :

float prob = chf("Probability");
float seed = chf("Seed");
@group_id = prob > rand(@primnum*seed);

Neighbours :

polyneighbours: 
i[]@primnbrs = polyneighbours(0, @primnum); 

pointprims:
int ptprims[] = pointprims(0, @ptnum);
i@group_needsstairs = 0;
if(len(ptprims) >= 2){
     foreach(int currentprim; ptprims){
         setprimgroup(0, "needsstairs", currentprim, 1, "set");
         }
     }

3dsr