Jump to content
Sign in to follow this  
Mdonovan

Deleting Points from a Primitive Wrangle

Recommended Posts

 

Hi Guys,

I am trying to learn more VEX and I am definitely in need of some assistance here. This is very basic. 

I have stacked rows of curves that have 3 points each. 

I want to delete from 0 to 2 pts per curve randomly. 

Curently I am assigning an @del_qty to each primitive that will tell me how many point on that primitive I am to delete. 

I dont know how to delete the points using a wrangle since my @del_qty lives on the primitive. 

Below is an imag that show what I am attempting to do (the red x's are deleted points). .

 

image.png

image.png

Edited by Mdonovan
bottom image does not represent data in spreadsheet.

Share this post


Link to post
Share on other sites

Here is another image kind of showing my progress ....

What I want to do based on this data is randomly delete:

1 point on prim1

2 points on prim2

1 point on prim5

1 point on prim6

1 point on prim9

I underlined some points in the return value from primpoints just to illlustrate possible points to delete.

 

image.thumb.png.04bfcf19c494b3988e237d9e40b24550.png

Edited by Mdonovan

Share this post


Link to post
Share on other sites

you can use removepoint() function to delete any input point you want

Edited by anim

Share this post


Link to post
Share on other sites

Maybe this image will help ... 

I think I need to iterate over each primitive and then get the min and max value of a static id to delete the points.

image.thumb.png.dd388f95920cd3b3b5743092fc613b0d.png

Share this post


Link to post
Share on other sites

Hi,

I would go with two steps:

  • get the number of points to be deleted for each prim (already done)
  • use this number to calculate a random selection of points for each prim (the selection can be obtained using the primpoints() function to get all points from each prim)

 

 

random_selection.hipnc

Edited by Aizatulin

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
Sign in to follow this  

×