Jump to content

Curves distributing points


RTHMan

Recommended Posts

@RTHMan just feed on Magnus Example
make Att-Randomize pscale than
 

matrix rot = maketransform(0,0,0,{12,0,0},1,@P);
vector temp_pos = @P +@pscale *{0,1,0};
int prim = addprim(0,"polyline",addpoint(0,temp_pos));
setprimattrib(0,"pscale",prim,@pscale);
setprimattrib(0,"center",prim,@P);
vector normal ;
     for (int i =0; i < 30;i++){
        temp_pos*= rot;
        addvertex(0,prim,addpoint(0,temp_pos));
        }
removepoint(0,@ptnum);

 

@center = prim(0,"center",@primnum);
@pscale = prim(0,"pscale",@primnum);
float offset = @pscale ;
i[]@prims= pcfind_radius(1,"P","pscale",1,@center,@pscale,25);
removevalue(@prims,i@primnum);

vector n;
float depth;

vector near_pos;
float near_pscale;
float dist;

vector r = @P- @center;
foreach(int prim;@prims){
       
       near_pos = point(1,"P",prim);
       n = normalize (near_pos-@center);
       near_pscale = point(1,"pscale",prim);
       dist = distance(@center,near_pos);
       
       
       offset =(@pscale / near_pscale)*dist/(1+(@pscale / near_pscale));
       if (dot(n,r)-offset>0){
       
       @P-= n*(dot (n,r)-offset);
       }
       
     }  
       



 

sdaaa.jpg

cvxxx.jpg

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...