Jump to content

foreach changing point order in solver sop


Recommended Posts

Hey guys,

I am using a foreach block in a solver sop but the foreach causes my point orders to changes, if I bypass the the foreach my point order stays intact as the points accumulate. In the foreach I am using a static point attribute that exists on the points before they enter the solver, and in the solver I want to use the attribute to apply different transforms to the points based on geometry with a matching attribute. Everything about the setup works apart from the point orders changing as the point increase messing up my system later down the line.

I attached a simple example to illustrate the problem. Any ideas for what I am doing wrong or could do differently?

Thanks,

Zybrand

foreach_point_order.hip

Link to comment
Share on other sites

It's like splitting pieces and merging back. Point order will be reordered to eliminate gaps within clusters: 0 1 2 3 4 5 will became 0 1 2 3 4 5, since it is impossible to have geometry with four points numbered as 0 1 2 and 5. Use @id point attribute for this.

There is also bad expression in Delete node. Metadata node creates "iteration" and "numiterations" attributes. Nonenexistent "iterations" attribute was used, result is always zero. Also every point will be deleted if expression result is non-zero. Not sure what need to be deleted there.

 

foreach_point_id.hipnc

  • Like 1
Link to comment
Share on other sites

Thanks for the help guys.

acey195 thanks for reminding me of the sort sop, so handy but I always forget about it. Your solution is clever but it does not work in my full setup because I am applying forces to the points and I can't have it re-sort in the solver each timestep.

F1 the delete sop iteration was a typo on my part in the example file, I see I didn't even write out the expression properly on that one, my bad. Thanks for the explanation on splitting pieces and merging them back that makes sense.

I changed my setup to calculate unique point ids for the points when they first enter the solver and I am using a sort sop after the solver to sort the point numbers according to the ids.  Attached is my setup with moving points.

 

foreach_point_order_fix.hip

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