Hi all.
Is it possible to add overhang to a pyramid roof and a shed roof?
Like the overhang attribute in a Gable roof and Hip roof.
Any suggestions?
This isn't always perfect, but it's a trick I use and works well - I scale up the roofplane and then center it.
/** * File: Geonet_Overhang.cga * Created: 27 Sep 2017 15:58:51 GMT * Author: Devin Lavigne */ version "2017.0" #THIS IS A PERCENTAGE @Range(1.0,2.0) attr overHang=1 @Range("Shed","Pyramid") attr roofStyle = "Shed" @StartRule Generate--> extrude(10) comp(f) {top:RoofPlane | side:Wall} RoofPlane--> s('1*overHang,'1*overHang,'1) center(xy) BuildRoof BuildRoof--> case roofStyle=="Shed": roofShed(10) else: roofPyramid(40) <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Here's some ancient code I wrote once to make a "true" overhang, unfortunately it only works properly for buildings with equal width and depth due to the trig used to calculate the y-offset. You could always eyeball it, though. Or just change it to have a floating "tent" hovering close above the structure.
attr overHang <SPAN class="operator token">=</SPAN> <SPAN class="number token">5</SPAN> attr roofAngle <SPAN class="operator token">=</SPAN> <SPAN class="number token">30</SPAN> @StartRule Lot <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> extrude<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> s<SPAN class="punctuation token">(</SPAN><SPAN class="number token">20</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">10</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">20</SPAN><SPAN class="punctuation token">)</SPAN> center<SPAN class="punctuation token">(</SPAN>xz<SPAN class="punctuation token">)</SPAN> comp<SPAN class="punctuation token">(</SPAN>f<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>top<SPAN class="punctuation token">:</SPAN> Roof RoofOverhang<SPAN class="operator token">|</SPAN> all<SPAN class="punctuation token">:</SPAN> NIL<SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">}</SPAN> Roof <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> roofPyramid<SPAN class="punctuation token">(</SPAN>roofAngle<SPAN class="punctuation token">)</SPAN> RoofOverhang <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> s<SPAN class="punctuation token">(</SPAN>scope<SPAN class="punctuation token">.</SPAN>sx<SPAN class="operator token">+</SPAN>overHang<SPAN class="operator token">*</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN> scope<SPAN class="punctuation token">.</SPAN>sy<SPAN class="operator token">+</SPAN>overHang<SPAN class="operator token">*</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN>'<SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> roofPyramid<SPAN class="punctuation token">(</SPAN>roofAngle<SPAN class="punctuation token">)</SPAN> center<SPAN class="punctuation token">(</SPAN>xz<SPAN class="punctuation token">)</SPAN> split<SPAN class="punctuation token">(</SPAN>y<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>overHang<SPAN class="operator token">*</SPAN>tan<SPAN class="punctuation token">(</SPAN>roofAngle<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> Overhang <SPAN class="operator token">|</SPAN> <SPAN class="operator token">~</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">:</SPAN> NIL<SPAN class="punctuation token">}</SPAN> Overhang <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> t<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="operator token">-</SPAN><SPAN class="punctuation token">(</SPAN>overHang<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">*</SPAN>tan<SPAN class="punctuation token">(</SPAN>roofAngle<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN> comp<SPAN class="punctuation token">(</SPAN>f<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>top<SPAN class="punctuation token">:</SPAN> styleOverhang <SPAN class="operator token">|</SPAN> bottom<SPAN class="punctuation token">:</SPAN> NIL<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks!
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.