lego wall version 4.16, roofing update

   10704   12   0
User Avatar
Member
31 posts
Joined: 3月 2011
Offline
hi guys

i am still messing around with brick walls, is teaching me plenty, however have hit the wall on how to do this one:

in the attached file if you select the out node you will see that this code creates a notwindow group (selects only the points from the wall that dont have a window) and that a group is built up for the half bricks left and right edges of each window.

You also will see that the ten parameters in the windows&doors section of the interface are non dynamic (parmWindowY,parmWindowX, parmWindowInsetX, parmWindowInsetY) and are duplicated 10 times to make the window holes happen.

In the parameter interface, I have found the folder type “Multiparm Block Tabs” perfect to allow an infinite amount of windows and doors, i have added this in.

I was thinking that i would place the 3 group geo nodes for each instance in a foreach node, however i do not see how to iterate through the block tabs and output 3 groups (notwindow, half_bricks_left, half_bricks_right) as they dont seem to be an array.

your thoughts on this would be appreciated
Edited by - 2013年10月2日 17:59:26

Attachments:
test2.hipnc (221.8 KB)

User Avatar
Member
8785 posts
Joined: 7月 2007
Offline
as for everything you can get current iteration number within foreach sop (with stamp() expression)
so using that you can query correct parameter from multiparm block since they are numbered accordingly
and you will need to use that in group numbers as well since you don't want them to override each other

here is your scene adapted to that

Attachments:
test2_fix.hipnc (154.2 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
31 posts
Joined: 3月 2011
Offline
that is perfect, my thanks for your time, i wouldn't have guessed how to stamp in that fashion, very neat solution, has cut out 30 nodes, i knew needed a loop as i am a computer programmer by trade, i also get how to use the array of parms, my wall grows more powerful by the day ;0)
User Avatar
Member
31 posts
Joined: 3月 2011
Offline
i have changed this wall into a doubled up foreach loop

matching the doubled up multi block param list controlling the number of sides and the number/location of windows per side

but the first side's window gets applied to every side, whereas each separate side should be capable of multiple different openings

your first fix taught me much tamte, was hoping for similar inspiration

please anyone take a sneak peek
has been hurting my head for a week
really do appreciate it

thanks
r;0)b
Edited by - 2012年12月31日 17:22:35

Attachments:
lego_debug.hipnc (304.2 KB)

User Avatar
Member
8785 posts
Joined: 7月 2007
Offline
there is a few things you need to be aware of when using nested foreach sops

1. always use different stamping variables, it's the same as if in programming you would use the same variable like instead if

2. when stamping from top For Each, you have changed the expression to the variable to chs(“../../forstamp”) correctly, but you need to change the path to For Each node itself since now it is referencing nested For Each (“..”)instead of top For Each (“../..”)
so it should be this:
stamp(“../..”, chs(“../../forstamp”), 1)
instead of this
stamp(“..”, chs(“../../forstamp”), 1)

3. you may want to create internal parameters to hold current stamped value of both for loops, then just reference those parameters, it is shorter to write and easier to debug
btw, in every For Each node there are variables already stamped on each1 node, you can just reference those parameters

4. you don't need to create different group names for every top level For Each iteration, they will never conflict since they run separately inside and you are not outputting them out

look at the file with all changes except 3., since I was lazy for that and it's not really necesarry once it's working

Attachments:
lego_debug_fix.hipnc (295.5 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
31 posts
Joined: 3月 2011
Offline
you have my thanks for looking into that ;0)

nice easy fixes to apply, literally just
- gave each for loop a unique name
- removed the extra stamp naming on the not_any_window group/forloop
- will implement a parameters holder as these calculations badly need simplifying

again my thanks i was stuck on this ;0)


————–
PS: have simplified the math via parameters as was suggested in the attached version

Attachments:
lego_debug.hipnc (194.2 KB)

User Avatar
Member
31 posts
Joined: 3月 2011
Offline
the next iteration of this wall is to create a set of walls connected at variable angles (as opposed to all angles being 90degrees if a 4sided poly was used)

the previous version was based on a polygon circle
this version includes a switch that changes the input geo to a curve

this curve contains one point (0,0,0) and is built via a foreach looping around the multiblock params for the sides, using the angle specified against each side to add a point to the curve

the problem i have is how to store the last point added in this parm
foreach_sidepre->polyline->LastX & LastZ
copied from this parm in the previous iteration of the loop
foreach_sidepre->polyline->NextX & NextZ

any thoughts on this appreciated

Attachments:
lego_debug.hipnc (202.3 KB)

User Avatar
Member
8785 posts
Joined: 7月 2007
Offline
1. if you want to use foreach as a loop where you can get geometry from previous iteration uncheck Merge Results

2. you need to store previous accumulated angle as well to continue in correct direction

3. try to utilize all houdini arsenal, instead of writing millions of expressions which are difficult to debug
simply take last point rotate it's normal, offset in normal direction by wall length and merge with all previous points as a new one, no expressions needed

4. it may not be the best idea to copy center of the wall to the points, copy start or end of the wall so that the wall will align nicely along the polyline edges

5. due to 4. I changed your circular polygon computation so it works for both methods

6. in the future you may want to implement various wall side lengths and therefore even accepting any polyline and creating wall per each edge

here is the file with changes 1.-5.

Attachments:
lego_debug_fix.hipnc (213.5 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
31 posts
Joined: 3月 2011
Offline
my thanks for the critique/corrections, and taking the time out of your schedule to educate me on this, i will take your points on board and hope my errors and your corrections help open the eyes of many an apprentice.

you sir are a star ;0)

PPS the vop sop was an eye opener
PPPS version 15 attached, updates toms version with variable length walls ;0)


—— some items of interest found after analysis ————-
opinputpath(name, index) access connected nodes
index is the 0-based number of the input. For example, to get the path of the node connected to the first input, use opinputpath(“.”, 0), and for the second input, use opinputpath(“.”, 1)
arclen(surface_node, prim_num, ustart, ustop) returns the literal arc length of an indexed primitive, in this case the curves of a circle connected to input 0
ch(“../circle_building_sides/divs”)*(ch(“../foreach_sides/wall/sizex”)+ch(“../foreach_sides/brick/sizex”))/arclen(opinputpath(“.”,0), 0, 0, 1)
how to set the point normals to a different direction by using sort to shift the points back 1 point. Then feed the original and the sorted version of the circle primitive into the add sop setting the normals to $TX-$TX2, $TY-$TY2, $TZ-$TZ2. Very cute as the direction of the normal alters depending upon the number of divisions in the circle and the offset in the sort shift sop.

ifs(expression, true_value, false_value) finally found the equivalent of iif in VB.NET
ifs( ch(“../../fixed_or_variable/input”), stamps(“..”, chs(“../forstamp”), 1),“”)

Attachments:
lego_debug.hipnc (206.8 KB)

User Avatar
Member
31 posts
Joined: 3月 2011
Offline
could do with a little VOP's help,

i am trying to use VOPs to apply a ramp parameter(s) to the front and back edges of the wall, the idea is to allow the cross section of the wall to be controlled from two ramps allowing for a curved wall,

thanks
r;0)b


am well pleased to get to grips with VOPs, have sorted this cross section out, working version attached ;0)

Attachments:
lego_ramped_crosssection.hipnc (151.3 KB)

User Avatar
Member
31 posts
Joined: 3月 2011
Offline
hi guys
i was playing with the ramped version of the wall, attempting to allow infinite ramp choice via multi block folder

whilst i have managed to get the python working that fills a ordered menu with the names of the wall styles defined in the multi block folder

the ramps on the interface refuses to link to the one on the VOP, i edited the expression on the VOP's ramp parameter to point to the ramp in the multi block folder

ch(“../wallstyle_rear” + chs(“../wallstyle”))

but this does not pull in the dynamic ramp from the interface
ideas anyone

thanks
r;0)b

Attachments:
lego_ramped_crosssection.hipnc (231.0 KB)

User Avatar
Member
31 posts
Joined: 3月 2011
Offline
a cleaned up and debugged version attached, no questions for this version, the above questions were un answered so i have trimmed the feature creep to pure working features only including:
- any size bricks
- variable mortar width
- fixed polygon/variable angled multiple walls
- multiple windows per wall
- arched/square windows
- window edges
- mutli point pyramid

missing is :
- roof
- nice corners when the angle isnt 90
- cross section (does not corner nicely)
;0)

Attachments:
legoV0.414.hipnc (356.7 KB)

User Avatar
Member
31 posts
Joined: 3月 2011
Offline
elusive roof added along with a major variable cleanup and detachment from the interface/other dependant nodes

happy with my roof though is missing the connecting slates as per the original python version, not happy with it's cook speed though

more work to do

Attachments:
legoV0.416.hipnc (446.8 KB)

  • Quick Links