Jump to content
anicg

Remove a given % of points randomly

Recommended Posts

Posted (edited)

I attach a file where need to remove randomly a percentage of the points say for example 15%, whether using vex or not. I know I can reduce the number in the scatter, but that happens before further processing on the points, I'd like to keep the the point positions but just remove some of them.

 

 

remove_randomly_pct_points_.hiplc

remove_randomly_percentage_of_points.png

Edited by anicg

Share this post


Link to post
Share on other sites
if(rand(@ptnum + 213.23) < chf("thresh")){
    removepoint(0, @ptnum);
}

 or use the lab tool "random_selection"

  • Like 1

Share this post


Link to post
Share on other sites

If you need exact number of random points, you could use Sort SOP (Point Sort: Random) and then Blast the right amount of points:

image.png.c0ef7423446f66e1b1c9d77c1d60aba7.png

 

This code removes approximate percentage:

float thr  = 0.15;
float rand = rand(@ptnum + 0.654);

if ( rand < thr)
{
    removepoint(0, @ptnum);
}

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×