Problem with building`s floors

3370
13
Jump to solution
11-20-2014 12:36 AM
IonutAlixandroae
Occasional Contributor

Hello,

I have created a rule that will generate a building with 4 floors, the second and the 3rd one are L shaped.

If I have no terrain in my scene, everything works perfectly normal, but if I add a terrain to my scene, align the lots to my terrain and assign the rule to them, the extrusion is very weird. I attached a print so you could understand better what I mean by weird extrusion.

I`m not sure if it`s because of the rule or because the lots are aligned to a sloped terrain.

Thanks!

test2.jpg

Test.jpg

1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Put this before your extrude statement:

s('1,0,'1)

This will flatten your shape by scaling to zero in the Y direction, and relative one in X and Z. You were right about the sloping terrain causing it to not extrude right. I use this command at the start of many rules.

View solution in original post

0 Kudos
13 Replies
by Anonymous User
Not applicable

Put this before your extrude statement:

s('1,0,'1)

This will flatten your shape by scaling to zero in the Y direction, and relative one in X and Z. You were right about the sloping terrain causing it to not extrude right. I use this command at the start of many rules.

0 Kudos
by Anonymous User
Not applicable

I replied from my phone without seeing the images.  Now, I just have to say how much I like the images of your "very wierd" extruded buildings.

IonutAlixandroae
Occasional Contributor

Hi Chris,

I never knew I could use "s()" before extrude statement, thank you for the info

What do you mean by "like" ? ) haha

I used your advice and the result is better, the problem persists now only for 1st floor(also now I have a hole in my building ))) ) . I will keep on trying and let you know

Thank you again,

Ionut

1.png

2.png

0 Kudos
by Anonymous User
Not applicable

Oh, and I "like" your weird building because they look interesting in their distorted state.

0 Kudos
by Anonymous User
Not applicable

I assume the hole might be unrelated. Please let us know more about the hole, if it persists.

0 Kudos
IonutAlixandroae
Occasional Contributor

I changed the align function from "Project All" to "Project to Object Average" and it seems that now the problem is gone....

0 Kudos
by Anonymous User
Not applicable

I really should have said to run this at the very beginning of your start rule. That way the start shape is "flattened". This is the same as "Project to Object Average," except that you won't have to worry about what type of start shape you have (you can use the rule on footprints that have not been projected to average). To test this technique, project the footprint back to its distorted state using "project all" to terrain, then add that scale command as the first line of your start rule, and remove it from where you have it now. I should have been more specific, thanks!

Chris

0 Kudos
IonutAlixandroae
Occasional Contributor

Please correct me if I misunderstood your advice but I added s('1,0,'1) each time I had extrude statement ( I did the rule in a way that I used extrude for each floor ) with my buildings aligned to terrain with "Project All" function. The problem persist now only for 1st floor ( it`s aligned to slopy terrain) and the hole it`s still there ( practically it`s a remainder from LShape but it wasn`t supposed to be invisible so that I can see through the model, it should have been a free space where I could place another obj. balcony)

Thanks

0 Kudos
by Anonymous User
Not applicable

Remove that command from all places in your rule and ONLY include it at the very beginning. To explain why this works:

If the input shape is projected to a sloped terrain using "project all", then its vertices will be at different heights (different Y values). By using the scale command s('1,0,'1), you are keeping the X and Z scale exactly the same, but scaling the scope's Y dimension to zero, so you are "flattening" the shape in the Y direction. Therefore, extrusion of the initial shape will go straight up in the Y direction. Once you do that, then all of the subsequent extrusions will also be correct.

Do you see now why you would do this in the beginning of the start rule, and not before subsequent extrusions? Are you understanding exactly why this command works in this way?

Sorry, I should have been more explicit in my first reply to this thread.

0 Kudos