For each loop - problem with occumulation of result

   3362   3   2
User Avatar
Member
3 posts
Joined: 5月 2017
Offline
Hello everybody!

I'm new to houdini, and to 3d in general, and I ran into some problems. I will apprecite any help!

I want to create a simple procedural systems, where some kind of laying hoses are created from a given curves.
Also I'm taking into account surface where hoses supposed to lay.

So I am projecting original curves on the surface using intersect function in VEX. Then I'm creating pipes using sweep.
And I want to implement this algorithm to the curves one by one, so for every next curve all previous pipes will be taken into account when intersectint points are calculated.
The logical solution is to use for each loop. But I ran into a problem with my set up, it seems to me that only result of last iteratation is conciderd. And I need to use results of all previous iteration. I did choose “merge all iterations” - doesn't help.

I will be gratefull for any suggestion. My setup and the result I'm getting is on attached images.


Attachments:
basic-all.png (200.3 KB)
result.jpg (195.3 KB)

User Avatar
Member
495 posts
Joined: 7月 2005
Offline
Hi,

this is not exactly your example, but it should work similarly. I was a bit confused aswell at the beginning, before I've figured out, that I've forgotten to merge the already calculated geometry to the new calculated tubes.
In your case you can try this aswell, by adding a merge node between sweep and foreach_end and connect it with the foreach_input node (fetch feedback), but there are probably other solutions aswell.
Edited by Aizatulin - 2018年3月19日 19:41:36

Attachments:
overlaps.hipnc (161.4 KB)

User Avatar
Member
3 posts
Joined: 5月 2017
Offline
Aizatulin
Hi,

this is not exactly your example, but it should work similarly. I was a bit confused aswell at the beginning, before I've figured out, that I've forgotten to merge the already calculated geometry to the new calculated tubes.
In your case you can try this aswell, by adding a merge node between sweep and foreach_end and connect it with the foreach_input node (fetch feedback), but there are probably other solutions aswell.

Thank you! That is working indeed. Exactly what I needed.
User Avatar
Member
495 posts
Joined: 7月 2005
Offline
Hi,

nice that is working, but one little thing I've forgotten, was to set the gather method in the <block end> from “Merge Each Iteration” to “FeedBack Each Iteration”, because the merge was already done before. There is no visible different in result, but the Point count differs from 55k to 10k (in my example).

Attachments:
overlapsM.hipnc (187.8 KB)

  • Quick Links