<?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: CGA Rules: Calculating the area of an offset plot shape in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1193003#M10583</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;geometry.area&lt;/EM&gt; function is related to the shape you call the function in. So for instance, if you place it within the rule for the inner shape of your plot, this will calculate the area of the inner shape only. Here is an example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;@StartRule
Lot --&amp;gt;
  offset(5) 
  NewLot
  report("The entire Lot area", geometry.area)

NewLot --&amp;gt;
  comp(f) {inside: Inner | border: Offset}

Inner --&amp;gt;
  report("The inner area only", geometry.area)
  color(1,0,0)

Offset --&amp;gt;
  report("The offset area only", geometry.area)
  color(0,1,0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps clarify it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2022 16:34:11 GMT</pubDate>
    <dc:creator>plfontes</dc:creator>
    <dc:date>2022-07-18T16:34:11Z</dc:date>
    <item>
      <title>CGA Rules: Calculating the area of an offset plot shape</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1192974#M10581</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am building a CGA rule that extrudes a building shape that is dependent on the area of the lot. I can easily attain the area of the lot using the "geometry.area" function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, now I wish to add an &lt;STRONG&gt;offset&lt;/STRONG&gt; to my building. This can be represented by the green area in the picture below. I want to extrude the red area for the new building, and doing so is simple enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DPG_0-1658159334029.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/46069iD84C73B8D426F791/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DPG_0-1658159334029.png" alt="DPG_0-1658159334029.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I want the building height to be dependent on it's footprint (the red area). How can I calculate the area of the red shape, as opposed to the entire plot area? I assume I can using the geometry.area function - but ESRI's CGA reference on geometry functions is unclear for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/2019.0/cga/cga-geometry-function.htm#ESRI_SECTION1_D013B37BD4234B3488F1E4186CE2508E" target="_blank" rel="noopener"&gt;https://doc.arcgis.com/en/cityengine/2019.0/cga/cga-geometry-function.htm#ESRI_SECTION1_D013B37BD4234B3488F1E4186CE2508E&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody offer any guidance? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 15:56:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1192974#M10581</guid>
      <dc:creator>DPG</dc:creator>
      <dc:date>2022-07-18T15:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Rules: Calculating the area of an offset plot shape</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1193003#M10583</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;geometry.area&lt;/EM&gt; function is related to the shape you call the function in. So for instance, if you place it within the rule for the inner shape of your plot, this will calculate the area of the inner shape only. Here is an example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;@StartRule
Lot --&amp;gt;
  offset(5) 
  NewLot
  report("The entire Lot area", geometry.area)

NewLot --&amp;gt;
  comp(f) {inside: Inner | border: Offset}

Inner --&amp;gt;
  report("The inner area only", geometry.area)
  color(1,0,0)

Offset --&amp;gt;
  report("The offset area only", geometry.area)
  color(0,1,0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps clarify it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 16:34:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1193003#M10583</guid>
      <dc:creator>plfontes</dc:creator>
      <dc:date>2022-07-18T16:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Rules: Calculating the area of an offset plot shape</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1193284#M10585</link>
      <description>&lt;P&gt;Thanks for your response. I would like the area of the inner plot as an attribute - not as a report. As far as I can see I don't think that this is possible with the proposed solution&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 07:16:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1193284#M10585</guid>
      <dc:creator>DPG</dc:creator>
      <dc:date>2022-07-19T07:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: CGA Rules: Calculating the area of an offset plot shape</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1193300#M10586</link>
      <description>&lt;P&gt;Hi, the code snippet above is not a solution but an example of the function use. You can use the &lt;EM&gt;geometry.area&lt;/EM&gt; function of your red area in your calculations and get the correct area as long as it is within the inner shape.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you plan to relate the building height to the building footprint?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 09:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cga-rules-calculating-the-area-of-an-offset-plot/m-p/1193300#M10586</guid>
      <dc:creator>plfontes</dc:creator>
      <dc:date>2022-07-19T09:09:59Z</dc:date>
    </item>
  </channel>
</rss>

