i have attached an image with this post and i have two questions
1 . in the image my building is not straight and it is slightly tilted or slanted becuase of the elevation. can u kindlly tell me is there any function or something which i can use so that my building is constructed erect or straight even if there is elevation or depression in the geometry (e.g. any function to construct a basement with correct height)
2. i manipulated the image using the facade wizard of city engine and u can see that the .cga rule file is applied on all the 3 faces of front side of my building. is there any way to avoid this or is there any way to just make city engine create just one face at the front side?
waiting for response
Hi Muhammad,
1] Yes, this is possible.
Use the following code right at the beginning of your StartRule:
"
alignScopeToAxes(y)
s('1,0,'1)
"
this will flatten the shape.
2] I assume you have 3 edges on the front of your building footprint, right?
--> if yes:
maybe clean the input polygon or use the cleanupGeometry() operation
otherwise, use the 'comp.index' to drive on which facade polygon you want which facade wizard rule applied.
Hope this helps!
Matt
Matthias Buehler
Head of 3D Technologies
twitter: @MattB3D
---------------------------------------
Garsdale Design Limited
1] i tried what u said... i got something like half of the house above the street and half below the street and also this way the facade is messed up
2] i also tried the cleanupgeometry() oepration. this doesn't work also
the code
House1 -->
setback(2){street.front : FrontYard | remainder : Building1}
Facade -->
facade_house_1.Facade
FrontYard -->
setupProjection(0, scope.xy, '1, '1)
projectUV(0)
texture("Grass/green grass 4.png")
Building1-->
alignScopeToAxes(y)
s('1,0,'1)
extrude(ceil(rand(8,10)))
comp(f) { front: Facade | top: Top1 | all: X }
cleanupGeometry(faces, 0)
Top1 --> roofHip(30, 1, false) Roof1
Roof1 --> setupProjection(0, scope.xy, '1, '1)
texture("Roof/roof4.jpg")
projectUV(0)
set(trim.horizontal, true)
comp(f) { all : X }
I see.
Maybe use extrude(world.y, ceil(rand(8,10)))
I thought you want to flatten the footprint. This code extrudes exactly vertically up.
You will have to deal with more precise code to get a bit better results for the facades.
But this should get you a bit further for now.
Matt
Matthias Buehler
Head of 3D Technologies
twitter: @MattB3D
------------------------------------
Garsdale Design Limited
i have one more query... i have around 20 or 30 cga facade rule files and i want to put these rule files randomly on the footprints in my scene. any idea how do i do that? like some code snippet?