Jump to content

Growth effect with the nearpoints function and foreach loop in a sop solver | VEX


Recommended Posts

Hi there,

I am facing a problem where I am trying to create a growth effect with the foreachloop, where it creates a polyline for every new point it found with the nearpoint function and add it to the group "start".

So the issue is mainly that the foreach loop starts always from the first point of the starting group and not the last it has been added, therefore it creates overlapping points and lines. :/

How would you solve this in VEX with the foreach loop? Thanks for any help in advance!

 

 

 

 

 

Screenshot 2023-04-13 170443.png

odForce_growthEffect.hiplc

Link to comment
Share on other sites

On 4/18/2023 at 6:25 AM, hannes603 said:

thats interesting..  I dont really get the find function part. how can it avoid  that all points connect?

For example, you have points 1,2,3. Point 1 found point 2 as closest and add this point into array (taken), then point 3 found point 2 as well, so point 3 checks array if this point is already taken, if taken = skip, if not taken = create line and add this point into array (taken).

Function "Find" - Returns the position of the first occurrence of the target value within the array. OR checking array for existing value in it, in our case searching taken point number.

  • Thanks 2
Link to comment
Share on other sites

17 hours ago, fencer said:

For example, you have points 1,2,3. Point 1 found point 2 as closest and add this point into array (taken), then point 3 found point 2 as well, so point 3 checks array if this point is already taken, if taken = skip, if not taken = create line and add this point into array (taken).

Function "Find" - Returns the position of the first occurrence of the target value within the array. OR checking array for existing value in it, in our case searching taken point number.

 

19 hours ago, fencer said:

For example, you have points 1,2,3. Point 1 found point 2 as closest and add this point into array (taken), then point 3 found point 2 as well, so point 3 checks array if this point is already taken, if taken = skip, if not taken = create line and add this point into array (taken).

Function "Find" - Returns the position of the first occurrence of the target value within the array. OR checking array for existing value in it, in our case searching taken point number.

thanks a lot! got it 

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