<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Roof orientation in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420079#M5782</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ignore that last post- i changed the rooforientationindex to 1 and that's sorted it!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Oct 2013 09:46:28 GMT</pubDate>
    <dc:creator>JamieIngall</dc:creator>
    <dc:date>2013-10-18T09:46:28Z</dc:date>
    <item>
      <title>Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420072#M5775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i have a simple Question:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The roof orientation is perpendicular to the longest side of the basis polygons or rectangles. It is possible to rotate the orientation of a gable roof by 90°?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;andi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 09:03:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420072#M5775</guid>
      <dc:creator>AndreasAmmon</dc:creator>
      <dc:date>2013-04-18T09:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420073#M5776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Roofs are the only operations which �?? this was not yet fixed, but it�??s on the to do list �?? are oriented based on the vertex order of the geometry, and NOT based on the scope orientation, as other ops.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There�??s 2 ways to fix this for rectangular geometries, basically 2 hacks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;physically rotate the geometry in that case ( e.g. rotating the scope by 90 degs and inserting a quad. [ or inserting a builtin:cube, then take the bottom face with reversed Normals ]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;make a case statement, where you call roof twice, for both ratios :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Once normal and once with :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;roofGable(angle, overhangX, overhangY, even, index)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this does a hardcoded-rotation of the geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bad side of 2] is that not all roof ops have an �??index�?? param.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You'll need to play with this a bit, but I've not always been able to make this happen correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 09:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420073#M5776</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-04-18T09:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420074#M5777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks for your help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;have tried 2. hack:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[PHP]/**&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; * File:&amp;nbsp;&amp;nbsp;&amp;nbsp; roof.cga&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; * Created: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;version "2012.1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lot --&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;extrude( 10)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;comp(f) { top: Top | all: X. }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Top&amp;nbsp; --&amp;gt; roofGable(30, 3, 3, true, 1) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/PHP]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23592[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[PHP]Lot --&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;reverseNormals &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extrude( 10)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;comp(f) { top: Top | all: X. }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Top&amp;nbsp; --&amp;gt; roofGable(30, 3, 3, true, 1) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/PHP]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;result without overhang :(:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23593[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The basis shape is an imported dxf geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 10:38:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420074#M5777</guid>
      <dc:creator>AndreasAmmon</dc:creator>
      <dc:date>2013-04-18T10:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420075#M5778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;why did you reverse the normals ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;m.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 08:27:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420075#M5778</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-04-19T08:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420076#M5779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for dragging this post back up again...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am having a similar problem whereby I want all roofs to be aligned. In my attached image you will notice that the highlighted row of buildings have roofs which don't line up. However the row of buildings on the left are aligned properly (the way i want them all to be!).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You suggest:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"make a case statement, where you call roof twice, for both ratios :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Once normal and once with :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;roofGable(angle, overhangX, overhangY, even, index)"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I am not sure what you mean by call the roof twice for both ratios? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 08:37:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420076#M5779</guid>
      <dc:creator>JamieIngall</dc:creator>
      <dc:date>2013-10-18T08:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420077#M5780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yep, that was not very clear.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue is that roofs - sadly - react to the actual geometry ( edge numbering ) rather than the scope orientation. So e.g. depending on if the first edge is on the short or long side of a rectangle, the default roof orientation may change. CityEngine does not have an awareness of how shapes and their topology 'align together in the world' and that the roofs should align in the same direction. So if the footprints were digitized differently, the roofs just will change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;not what we can do is change the roof orientation index based on the overall scope ratio.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;something like this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
@Hidden
attr roofOrientationIndex = 0


RoofBase --&amp;gt; # assuming scope is yUp
&amp;nbsp;&amp;nbsp;&amp;nbsp; case scope.sx &amp;gt; scope.sz :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CreateGableRoof
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set (roofOrientationIndex, 1)

CreateGableRoof --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; roofGable(30, 1, 1, true, roofOrientationIndex)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Does that approach make sense ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lemme know !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420077#M5780</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2021-12-11T18:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420078#M5781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;unfortunately this has aligned all the roofs the wrong way. however the rule must be working as it has changed all the previously correct orientation to the opposite way...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which part of the rule do I need to tweak in order to get all roofs to be aligned the other way??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420078#M5781</guid>
      <dc:creator>JamieIngall</dc:creator>
      <dc:date>2013-10-18T09:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420079#M5782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ignore that last post- i changed the rooforientationindex to 1 and that's sorted it!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:46:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420079#M5782</guid>
      <dc:creator>JamieIngall</dc:creator>
      <dc:date>2013-10-18T09:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Roof orientation</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420080#M5783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ok, glad it works now. the code above was just trying to get the idea over, not the actual proper code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;with some shapes that have colinear edges, try also cleanupGeometry(). possibly also alignScopeToGeometry(yUp, any, longest)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;let us know a bit the progress of your CGA journey.. ok ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 10:33:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/roof-orientation/m-p/420080#M5783</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-10-18T10:33:00Z</dc:date>
    </item>
  </channel>
</rss>

