Smicksus Posted January 18, 2023 Share Posted January 18, 2023 Hi I need your help with something. For a project I have a faceted plane and for each facet: - I scatter some points - sort the points in x+ direction - make a group for each point that is point nr. 0 - set infection start for each point that is in that 0 group. That works all fine! Now here's the problem. When I wire in my for each end into the solver the infection starts spreading correctly but (of course) it infects all it's neighbors even when it's not from the same original primitive. In an ideal world I would place my solver at the very end of the for each block so that it solves it for each primitive (but that doesn't work sadly) But in theory that's exactly what I need! Is there someone that can bring me on the right track and solve this for me? My idea is to maybe create a point group for each primitive's scattered points and tell that to the solver somehow? But I have no idea how... I've attached the hip file to the thread and want to thank everyone in advance for their reply! For_each_primitive_point_infection_system.hip Quote Link to comment Share on other sites More sharing options...
fencer Posted January 18, 2023 Share Posted January 18, 2023 Try to limit pcfind by group per primitive. For_each_primitive_point_infection_system_v02.hip 1 Quote Link to comment Share on other sites More sharing options...
Ziyad Posted January 18, 2023 Share Posted January 18, 2023 Alternatively you could store the iteration number from the for-each loop as a point attribute, then use that inside the solver to only infect points with matching iteration number. Hope this helps! For_each_primitive_point_infection_system.hiplc 1 Quote Link to comment Share on other sites More sharing options...
Smicksus Posted January 19, 2023 Author Share Posted January 19, 2023 15 hours ago, fencer said: Try to limit pcfind by group per primitive. For_each_primitive_point_infection_system_v02.hip 260.19 kB · 3 downloads 10 hours ago, Ziyad said: Alternatively you could store the iteration number from the for-each loop as a point attribute, then use that inside the solver to only infect points with matching iteration number. Hope this helps! For_each_primitive_point_infection_system.hiplc 252.92 kB · 2 downloads Thank you so much for both your reply's. These work really well! Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted January 19, 2023 Share Posted January 19, 2023 You can speed up this solution alot if you get rid of the "foreach" network and dont search for nearby points inside the solver. The iteration-time on your solution will remove any kind of creativity. For_each_primitive_point_infection_system_solution.hip 1 Quote Link to comment Share on other sites More sharing options...
Smicksus Posted January 19, 2023 Author Share Posted January 19, 2023 4 hours ago, ThomasPara said: You can speed up this solution alot if you get rid of the "foreach" network and dont search for nearby points inside the solver. The iteration-time on your solution will remove any kind of creativity. For_each_primitive_point_infection_system_solution.hip 236.04 kB · 1 download This is an incredible setup! I've learned a lot from your file. Sometimes I think of ways to do it like that, but then I have just no idea where to start. Thank you so much for this 1 Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted January 20, 2023 Share Posted January 20, 2023 Whenever you put down a foreach, try to do the same operation without it, it will in most cases be faster. 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.