Jump to content

Distance Based Connect Adjacent Points


Recommended Posts

With SOPs:
Connect adjacent pieces-node, activate length attribute.
Blast node set to primitives, group field: @restlength<0.02

With VEX:

float radius_min = chf('radius_min');
float radius_max = chf('radius_max');
int pts_max = chi('maximum_points');

float dists[];
int pts[] = pcfind(0, 'P', v@P, radius_max, pts_max, dists);
foreach(int i; int pt; pts){
    if(dists[i] > radius_min){
        addprim(0, 'polyline', i@ptnum, pt);
    }
}

 

Edited by konstantin magnus
  • Like 2
Link to comment
Share on other sites

10 minutes ago, konstantin magnus said:

With SOPs:
Connect adjacent pieces-node, activate length attribute.
Blast node set to primitives, group field: @restlength<0.02

With VEX:


float dist_min = chf('min_dist');
float dist_max = chf('max_dist');

int pts[] = nearpoints(0, v@P, dist_max);
foreach(int pt; pts){
    vector pos_pt = point(0, 'P', pt);
    float dist_pt = distance(pos_pt, v@P);
    if(dist_pt > dist_min){
        addprim(0, 'polyline', i@ptnum, pt);
    }
}

 

Amazing! Thanks so much!

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...