anicg Posted April 14, 2022 Share Posted April 14, 2022 (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 Edited April 14, 2022 by anicg Quote Link to comment Share on other sites More sharing options...
Sepu Posted April 14, 2022 Share Posted April 14, 2022 if(rand(@ptnum + 213.23) < chf("thresh")){ removepoint(0, @ptnum); } or use the lab tool "random_selection" 1 Quote Link to comment Share on other sites More sharing options...
ikoon Posted April 14, 2022 Share Posted April 14, 2022 If you need exact number of random points, you could use Sort SOP (Point Sort: Random) and then Blast the right amount of points: This code removes approximate percentage: float thr = 0.15; float rand = rand(@ptnum + 0.654); if ( rand < thr) { removepoint(0, @ptnum); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.