<?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: rand height &amp; color for containers in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621538#M8272</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr containerHeight = 2.6

@StartRule
Lot --&amp;gt;
&amp;nbsp; extrude(floor(rand(1,5))*containerHeight)
&amp;nbsp; print("Height: " +scope.sy +"\nContainers: " +scope.sy/containerHeight +"\n---") #print for control
&amp;nbsp; split(y){containerHeight: ColorContainer}* #optional split

ColorContainer --&amp;gt;
&amp;nbsp; color(rand,rand,rand)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:30:02 GMT</pubDate>
    <dc:creator>LR</dc:creator>
    <dc:date>2021-12-12T02:30:02Z</dc:date>
    <item>
      <title>rand height &amp; color for containers</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621536#M8270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I am drawing a storage area.&lt;/P&gt;&lt;P&gt;and at the moment i am struggling with the containers.&lt;/P&gt;&lt;P&gt;Those are an imported shapefile. The containers have always the same height = 2.6.&lt;/P&gt;&lt;P&gt;The goal is to randomize several heights (multiples of 2.6 to a maximum of 10.4 = 4 containers over each other).&lt;/P&gt;&lt;P&gt;and colors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my failed attempt. I'am sure is simpler than this. I just probably went in the wrong direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@StartRule&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attr A= 2.6&lt;/P&gt;&lt;P&gt;attr B= 5.2&lt;/P&gt;&lt;P&gt;attr C= 7.6&lt;/P&gt;&lt;P&gt;attr D= 10.4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Containers--&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extrude (rand(2.6, 2.6), rand (5.2,5.2), rand(7.6,7.6), rand(10.4,10.4)) HGT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HGT--&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case HGT == A: ContainerColor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case HGT== B:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; split(y) {'0.5 : ContainerColor | ~0.5: ContainerColor}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case HGT==C:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; split(y) {'0.33 : ContainerColor | '0.33 : ContainerColor | ~0.33: ContainerColor}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; split(y) {'0.25 : ContainerColor | '0.25 : ContainerColor | '0.25 : ContainerColor | ~0.25: ContainerColor}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ContainerColor--&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color(rand(0,1), rand(0,1))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 13:25:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621536#M8270</guid>
      <dc:creator>PmssS</dc:creator>
      <dc:date>2016-08-01T13:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: rand height &amp; color for containers</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621537#M8271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;getting there with this but not yet accomplished:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attr cont_ht&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =2.6&lt;/P&gt;&lt;P&gt;attr total_ht&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 10.4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lot --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extrude (total_ht) Container&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Container --&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;split(y) {cont_ht : ContainerColor | cont_ht: ContainerColor}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;ContainerColor--&amp;gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color(rand(0,1), rand(0,1))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 14:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621537#M8271</guid>
      <dc:creator>PmssS</dc:creator>
      <dc:date>2016-08-01T14:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: rand height &amp; color for containers</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621538#M8272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr containerHeight = 2.6

@StartRule
Lot --&amp;gt;
&amp;nbsp; extrude(floor(rand(1,5))*containerHeight)
&amp;nbsp; print("Height: " +scope.sy +"\nContainers: " +scope.sy/containerHeight +"\n---") #print for control
&amp;nbsp; split(y){containerHeight: ColorContainer}* #optional split

ColorContainer --&amp;gt;
&amp;nbsp; color(rand,rand,rand)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:30:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621538#M8272</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2021-12-12T02:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: rand height &amp; color for containers</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621539#M8273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;although it looks easy it would take me ages to get that!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;Pedro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 14:59:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621539#M8273</guid>
      <dc:creator>PmssS</dc:creator>
      <dc:date>2016-08-01T14:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: rand height &amp; color for containers</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621540#M8274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Hello,&lt;/P&gt;&lt;P&gt;indeed it worked. But i have more than 1700 objects that use this rule... and the the performance of the resulting webscene has been reduced drastically with the inclusion of those. &lt;/P&gt;&lt;P&gt;I have seen webscenes of cities with much more objects than I have. and those are working very well.&lt;/P&gt;&lt;P&gt;How can I improve the performance of the webscene.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;Pedro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 09:06:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621540#M8274</guid>
      <dc:creator>PmssS</dc:creator>
      <dc:date>2016-08-02T09:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: rand height &amp; color for containers</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621541#M8275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's usually the amount of faces/polygons what makes a scene choke. If you look closely, those large scenes generally consist of just simple textured blocks, so more or less building_number*6 polygons. However you're splitting (ergo multiplying) your polygon count. Maybe it would be better to skip the split and visualize it with a series of textures instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 10:08:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621541#M8275</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2016-08-02T10:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: rand height &amp; color for containers</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621542#M8276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well indeed that is the problem! Sadly I needed to reduce the detail of the objects, this is the new rule in case someone will have the same problem:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/cry.png" /&gt;&lt;/P&gt;&lt;P&gt;I still don't understand how these cities of the wizard_cities or ESRI lib, perform so well... they have much more data than mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attr containerHeight = 2.6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@StartRule&lt;/P&gt;&lt;P&gt;Lot --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; extrude(floor(rand(1,5))*containerHeight)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 13:00:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rand-height-color-for-containers/m-p/621542#M8276</guid>
      <dc:creator>PmssS</dc:creator>
      <dc:date>2016-08-02T13:00:32Z</dc:date>
    </item>
  </channel>
</rss>

