Select to view content in your preferred language

Select roof part with a angle <45%

1160
1
Jump to solution
04-19-2017 04:25 PM
PeterVersteeg
Frequent Contributor

Good day,

i have the same problem as: https://community.esri.com/message/395796?commentID=395796#comment-395796?q=dormer 

i did try the 3  solutions but non seem to work anymore. 

the rule work becouse the gable roof angle is >45% but if i set it to <45% it fails.

I like this approach (word.north, etc) because I can use lidar data to search for the domers and then fill a field on what location on the roof they are.

@StartRule
Lot -->
extrude(20)
comp (f) {front: Front | side:Wall | top:Roof}

Front -->
color (1,0,0)

Wall -->
color (0,1,0)

Roof-->
roofGable(50)
comp(f) {world.north : Roofdormer | world.west : Wall |world.east : Wall | world.south : roof }

Roofdormer-->
color (0,0,1)
split(x){'0.40 : roof | '0.2 : DormerLocation | '0.40: roof}

DormerLocation-->
split(y){'0.4: roof | '0.3 :Dormer| '0.5: roof}

roof-->
color (1,0,0)

0 Kudos
1 Solution

Accepted Solutions
PeterVersteeg
Frequent Contributor

Ok  with help from Niels vd Vaart from Esri the Netherland I have a solution.

I am using the geometry.angle(azimuth) to get the azimuth of the roof and so get the side I want. This only works when my house is facing the right angle for my rule. I have to think how I can make this work for houses with all angles. But for now this is what I got:

@Range(1, 89)

attr GableAngle                   = 50

 

@StartRule

Lot -->

extrude(10)

comp (f) {front: Front | side:Wall | top:Roof}

Front -->

color (1,0,0)

Wall -->

color (0,1,0)

 

Roof-->

roofGable(GableAngle) GableRoof

 

GableRoof -->

       case GableAngle < 45 : RoofGableA

       case GableAngle > 45 : RoofGableB

       else :NIL

 

RoofGableB -->

       comp(f) {front : color(1,0,0) frontA. | back: color(0,0,1) backA.}

 

RoofGableA -->

       comp(f) {top : color(1,0,0) frontB | bottom: color(0,0,1) backB.}

 

frontB-->

#      comp(f) { all : color(0.5, geometry.angle(azimuth) / 360, 0.5) Shape. }

       case geometry.angle(azimuth) < 90 : color(0,1,0) Nside

       case geometry.angle(azimuth) > 90 : color(0,0,1) Sside

       else : NIL

 

Sside-->

       split(x){'0.40 : NoDormers | '0.2 : DormerLocation | '0.40: NoDormers}

 

DormerLocation-->

       split(y){'0.4: NoDormers | '0.3 :Dormer| '0.5: NoDormers}

 

Dormer -->

       color(1,0,0)

 

 

View solution in original post

0 Kudos
1 Reply
PeterVersteeg
Frequent Contributor

Ok  with help from Niels vd Vaart from Esri the Netherland I have a solution.

I am using the geometry.angle(azimuth) to get the azimuth of the roof and so get the side I want. This only works when my house is facing the right angle for my rule. I have to think how I can make this work for houses with all angles. But for now this is what I got:

@Range(1, 89)

attr GableAngle                   = 50

 

@StartRule

Lot -->

extrude(10)

comp (f) {front: Front | side:Wall | top:Roof}

Front -->

color (1,0,0)

Wall -->

color (0,1,0)

 

Roof-->

roofGable(GableAngle) GableRoof

 

GableRoof -->

       case GableAngle < 45 : RoofGableA

       case GableAngle > 45 : RoofGableB

       else :NIL

 

RoofGableB -->

       comp(f) {front : color(1,0,0) frontA. | back: color(0,0,1) backA.}

 

RoofGableA -->

       comp(f) {top : color(1,0,0) frontB | bottom: color(0,0,1) backB.}

 

frontB-->

#      comp(f) { all : color(0.5, geometry.angle(azimuth) / 360, 0.5) Shape. }

       case geometry.angle(azimuth) < 90 : color(0,1,0) Nside

       case geometry.angle(azimuth) > 90 : color(0,0,1) Sside

       else : NIL

 

Sside-->

       split(x){'0.40 : NoDormers | '0.2 : DormerLocation | '0.40: NoDormers}

 

DormerLocation-->

       split(y){'0.4: NoDormers | '0.3 :Dormer| '0.5: NoDormers}

 

Dormer -->

       color(1,0,0)

 

 

0 Kudos