<?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 Aligning a facade index to a cardinal direction in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561689#M7583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating a few generic buildings with the same rule — it splits a four-sided block into front, sides and back and textures them. However, as can be seen below, that doesn't always work as the index seems to start randomly(?) on any side.. my current solution are four copies of the script that roate through the four sides, but it's pretty annoying. Is it possible to assign the facade index 0 to, say, north? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="northdammit.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/48282_northdammit.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jan 2015 01:44:10 GMT</pubDate>
    <dc:creator>LR</dc:creator>
    <dc:date>2015-01-08T01:44:10Z</dc:date>
    <item>
      <title>Aligning a facade index to a cardinal direction</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561689#M7583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating a few generic buildings with the same rule — it splits a four-sided block into front, sides and back and textures them. However, as can be seen below, that doesn't always work as the index seems to start randomly(?) on any side.. my current solution are four copies of the script that roate through the four sides, but it's pretty annoying. Is it possible to assign the facade index 0 to, say, north? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="northdammit.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/48282_northdammit.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 01:44:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561689#M7583</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2015-01-08T01:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Aligning a facade index to a cardinal direction</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561690#M7584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an index can not be set to north or so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;don't use an index for this .. familiarize yourself with the 'first edge' (see help files / manual) and just use the component selectors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN-US"&gt;Matthias Buehler&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN lang="EN-US"&gt;Head of 3D Technologies&lt;/SPAN&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999; font-size: 10pt;"&gt;&lt;SPAN lang="EN-US"&gt;twitter: @MattB3D&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;--------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Garsdale Design Limited &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:matthias.buehler@garsdaledesign.co.uk" target="_blank"&gt;matthias.buehler@garsdaledesign.co.uk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.garsdaledesign.co.uk/" target="_blank"&gt;www.garsdaledesign.co.uk&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 11:42:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561690#M7584</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2015-01-08T11:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Aligning a facade index to a cardinal direction</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561691#M7585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if I correctly applied it, but this is what&amp;nbsp; I came up with - might as well post it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;version "2014.0"


attr direction = "N" # N, E, S, W
attr roofindex = 0 # 1, 2


Lot --&amp;gt;
&amp;nbsp; case direction == "N": NorthBuilding
&amp;nbsp; case direction == "E": EastBuilding
&amp;nbsp; case direction == "S": SouthBuilding
&amp;nbsp; case direction == "W": WestBuilding
&amp;nbsp; else: NorthBuilding



NorthBuilding --&amp;gt;
&amp;nbsp; cleanupGeometry(all, 0.5)
&amp;nbsp; extrude (4)
&amp;nbsp; comp(f){
&amp;nbsp; world.north: front | 
&amp;nbsp; world.west: right | 
&amp;nbsp; world.east: left | 
&amp;nbsp; world.south: back | 
&amp;nbsp; top: top
&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561691#M7585</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2021-12-12T00:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Aligning a facade index to a cardinal direction</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561692#M7586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is one that might help you. Use whichEdge to rotate the "front" to any edge. -Chris&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;version "2014.0"&amp;nbsp; 


@Range(0,10) # Range loops modulo style if more than edge count.
attr whichEdge = 0


Lot --&amp;gt;
&amp;nbsp; # Flatten shape to world xz plane: 
&amp;nbsp; alignScopeToAxes(y)
&amp;nbsp; s('1,0,'1)
&amp;nbsp; # Align scope to edge specified by whichEdge attribute.
&amp;nbsp; alignScopeToGeometry(yUp, 0, whichEdge) 
&amp;nbsp; Building 


Building --&amp;gt;&amp;nbsp; 
&amp;nbsp; extrude(4)&amp;nbsp; 
&amp;nbsp; comp(f){front: Front | right: Right | left: Left | back: Back | top: Top }
&amp;nbsp; 
Front --&amp;gt; color(1,0,0)
Right --&amp;gt; color(0,1,0)
Left --&amp;gt; color(0,0,1)
Back --&amp;gt; color(1,1,0)
Top --&amp;gt; color(1,0,1)








&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:13:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561692#M7586</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T00:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Aligning a facade index to a cardinal direction</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561693#M7587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - I ended up using my rule because it allowed bulk alignment and used your suggestion for the roofs since they didn't accept world.*.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However now I'm looking for a way to do that - fixing wrong roof(s) is pretty time-consuming in large areas.. any idea how to align the roof to cardinal directions? This is how it usually looks like when I generate a row of buildings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="roofmess.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/57752_roofmess.png" style="width: 620px; height: 288px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 01:07:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/aligning-a-facade-index-to-a-cardinal-direction/m-p/561693#M7587</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2015-02-02T01:07:04Z</dc:date>
    </item>
  </channel>
</rss>

