For-each loop feedback problem
2433 2 1- choix
- Member
- 12 posts
- Joined: Oct. 2016
- Offline
Hello!
I'm using a foreach loop over each connected piece(@class), to detect intersections between boxes (see attatched pictures).
It should work like this: The loop takes one box at a time and detects if it intersects with any of the other boxes. This works by always blasting the currently run over box and feeding this into the second boolean input, first input would always be the currently run over box. Then, if an intersection occured, prims get the group axbpolys = 1 and are deleted inside the loop.
BUT unfortunately in the end I just get the old setup back. I have no idea how to check for intersection and then delete one of the intersecting boxes.
Does anybody have an idea how to solve this? Scene file attatched.
I'm using a foreach loop over each connected piece(@class), to detect intersections between boxes (see attatched pictures).
It should work like this: The loop takes one box at a time and detects if it intersects with any of the other boxes. This works by always blasting the currently run over box and feeding this into the second boolean input, first input would always be the currently run over box. Then, if an intersection occured, prims get the group axbpolys = 1 and are deleted inside the loop.
BUT unfortunately in the end I just get the old setup back. I have no idea how to check for intersection and then delete one of the intersecting boxes.
Does anybody have an idea how to solve this? Scene file attatched.
Edited by choix - April 24, 2018 06:36:16
- matthias_k
- Member
- 483 posts
- Joined: Dec. 2006
- Offline
- BabaJ
- Member
- 2024 posts
- Joined: Sept. 2015
- Offline
I'm just getting into For-Each loops.
I'm assuming you didn't want to include the large box which looks like you are referencing for the rotates and transforms. (alhtough it could be easily changed to include that as well)
In the green netbox is where I exclude any boxes that overlap each other.( not taking into account the large box ).
And I didn't do any rotates/transforms on the results.
I left the add node in, because I was testing to see if it works with more points(boxes copied too) added.
I'm assuming you didn't want to include the large box which looks like you are referencing for the rotates and transforms. (alhtough it could be easily changed to include that as well)
In the green netbox is where I exclude any boxes that overlap each other.( not taking into account the large box ).
And I didn't do any rotates/transforms on the results.
I left the add node in, because I was testing to see if it works with more points(boxes copied too) added.
Edited by BabaJ - April 24, 2018 16:14:46
-
- Quick Links