Jump to content

Make a loop for a few primitives.


reinforcedcc

Recommended Posts

"This is necessary for the calculation of internal power in the construction of the roof of the building. (Maxwell-Cremona diagram)"

I have several primitives - these are lines.

Each next primitive must be placed at the point # 1 of the previous primitive, and so on.

I need to automate the process in a loop (and not as I did here -
manually ).


(The problem is solved correctly if everything closes)

 

001.png

002.png

desk_21.hip

Edited by reinforcedcc
Link to comment
Share on other sites

So, what you need to be using is a for each loop. There are many ways the for each loop can be configured though, making them hard to figure out. 

Here are some differences key dofferences off the top of my head. 

A point wrangle (essentially a for loop over points) will do a set of code for each point, it will be able to access information from other points, but it will not actually commit those changes until the end.

ex. Say I had 5 points each with an attribute value “value” equal to two. If I said to add the previous points “value” to the current points “value”, the values would all wind up being: 2, 4, 4, 4, 4.  Rather than 2, 4, 6, 8, 10.

By default, a for each loop will isolate whatever piece it isn’t working on. So if you are working on primitives, it would delete every other primitive except for the current iteration. Then at the end it will merge all the iterations together. The problem with this is that you are unable to access other parts of your geometry. 

And then there is a mode that will go through each and every piece, but will do it as a whole (meaning it does NOT isolate every piece beforehand) AND it will update the entire geometry before going through the loop again. 

I am pretty sure this is the type of loop that you want, so do some research into for loops on houdini’s documentation.

  

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