Selecting which edges get gables

861
2
04-26-2017 09:05 AM
CodySlater
New Contributor II

Good morning,

I'm working on a small building in CityEngine 2015.2 that (I believe) has a gabled roof.  Upon using the roofGable rule, the gables are automatically assigned.  I would like to know if there is some way I could assign which edges get gabled, as the automatic settings are assigning gables to the wrong, real-world, edges.  See images attached.

Here is my current section of code for the roofGable rule. The edge that needs to be assigned a gable is the first edge (0).

GableRoof --> 
roofGable(RoofAngle, 0, 0, true,0)
comp(f) {top:Texture("SlopedRoof") | side: Texture("RoofWall")}

Tags (3)
0 Kudos
2 Replies
CherylLau
Esri Regular Contributor

Setting the index in roofGable() does not work for concave shapes.  The index parameter only works for convex shapes with a single face.

The roof ridge usually aligns with the longest side, so you could try to double the width of your shape, create the roof, and then undo the doubling using s() commands before and after roofGable().  This might work in some cases, but I'm not sure if it will work in all cases.  For example, if the edge 0 is in the x direction:

s('2, '1, 0)
roofGable(roof_angle)
s('0.5, '1, '1)

Note that the second s() command is not the exact reverse of the first s() because roofGable changes the scope orientation.  The parameter values might have to be switched around to account for your situation.

CodySlater
New Contributor II

Cheryl, thanks so much! This solution worked great after a slight amount of tweaking.

Here is how it ended up, and below is the code that I ended up using

GableRoof --> #Sets the angle of the roof and differentiates the slants and sides of the roof, textures with an image
s('1, '2, 0)
roofGable(RoofAngle)
s('1, '0.5, '0.5)
t(0,0,'1)
comp(f) {top:Texture("SlopedRoof") | side: Texture("RoofWall")}

Again, thanks a lot, this has had me stumped for a couple days, and now I should be able to apply it to a couple more buildings.

0 Kudos