<?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 Matching object's front elevation with a street segment | inscribed rectangle in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/matching-object-s-front-elevation-with-a-street/m-p/1105136#M10330</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that the image clearly shows what I have been trying to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;gt; I have an urban block, divided into separate lots, and would like the buildings to be created on each so that the front elevation matches the street segment orientation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I tried with this piece of a code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;BaseArea --&amp;gt;&lt;BR /&gt;reverseNormals()&lt;/P&gt;&lt;P&gt;innerRectangle(scope) {shape : Lot |&lt;BR /&gt;remainder = JustGround}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;### Rules&lt;/P&gt;&lt;P&gt;@StartRule&lt;/P&gt;&lt;P&gt;# divide the block into 2 parts: Lot and JustGround.&lt;BR /&gt;BaseArea --&amp;gt;&lt;BR /&gt;reverseNormals()&lt;/P&gt;&lt;P&gt;innerRectangle(scope) {shape : Lot |&lt;BR /&gt;remainder = JustGround}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Lot --&amp;gt;&lt;BR /&gt;case isBuildingType(0):&lt;BR /&gt;print("total area = " + geometry.area)&lt;BR /&gt;splitArea(x) { ~1 : splitArea(z) { '0.5 : Red&lt;BR /&gt;| '0.5 : Yellow }&lt;BR /&gt;| ~1 : splitArea(z) { '0.5 : Turqoise&lt;BR /&gt;| '0.5 : Cyan }&lt;BR /&gt;| ~1 : splitArea(z) { '0.5 : Blue&lt;BR /&gt;| '0.5 : Magenta }&lt;BR /&gt;}&lt;BR /&gt;case isBuildingType(1):&lt;BR /&gt;print(geometry.area)&lt;BR /&gt;splitArea(z) { '0.5 : Pink&lt;BR /&gt;| '0.5 : Blue }&lt;BR /&gt;else:&lt;BR /&gt;print("total area = " + geometry.area)&lt;BR /&gt;splitArea(z) { '1 : Pink }&lt;BR /&gt;&lt;BR /&gt;Red --&amp;gt; // red&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//SHOP&lt;/P&gt;&lt;P&gt;Yellow --&amp;gt; // yellow&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;Turqoise --&amp;gt; // green&lt;BR /&gt;Garden&lt;BR /&gt;//GREENERY&lt;/P&gt;&lt;P&gt;Cyan --&amp;gt; // cyan&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;Blue --&amp;gt; // blue&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;Magenta --&amp;gt; // magenta&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;Pink --&amp;gt; // semi-transparent pink&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Divide BuiltupArea into an O shape: the area of O shape is FootageA; the remainder is Garden.&lt;BR /&gt;BuiltupArea --&amp;gt;&lt;/P&gt;&lt;P&gt;shapeO(FrontDepth,RightWidth,BackDepth,LeftWidth) {shape: FootageA|remainder: Garden}&lt;/P&gt;&lt;P&gt;FootageA --&amp;gt;&lt;BR /&gt;split(x){~15:FootageB|{~8:FootageC|~15: FootageB}*}&lt;/P&gt;&lt;P&gt;# split FootageB by z axial into 2 parts: FootageD and FootageE. FootageE is the OutHouse. FootageD is the Building.&lt;BR /&gt;FootageB --&amp;gt;&lt;BR /&gt;split(z){~10:FootageD|{~5:FootageE|~10: FootageF}*}&lt;BR /&gt;&lt;BR /&gt;FootageC --&amp;gt;&lt;BR /&gt;Garden&lt;/P&gt;&lt;P&gt;# extrude FootageE&lt;BR /&gt;FootageE --&amp;gt;&lt;BR /&gt;case FloorNumber &amp;gt; 1 :&lt;BR /&gt;extrude(FloorHeight)OutHouse&lt;BR /&gt;else : Garden&lt;BR /&gt;&lt;BR /&gt;# extrude FootageD&lt;BR /&gt;FootageD --&amp;gt;&lt;BR /&gt;case FloorNumber &amp;lt; 2 : Ground&lt;BR /&gt;case FloorNumber &amp;gt; 3 :&lt;BR /&gt;extrude(FloorHeight)Building&lt;BR /&gt;else : extrude(Height-FloorHeight)Building&lt;BR /&gt;&lt;BR /&gt;# extrude FootageD&lt;BR /&gt;FootageF --&amp;gt;&lt;BR /&gt;extrude(Height)Building&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...and the script goes on. I have read about two options of fitting the rectangle (that is meant to be the building footprint) into a polygon (which is the shape of my lots) -&amp;gt;&amp;nbsp;innerRectangle(scope)&amp;nbsp; and&amp;nbsp;innerRectangle(edge). I do wonder whether there is any other solution that I may apply to the project.&lt;/P&gt;&lt;P&gt;Have a nice day!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 13:46:04 GMT</pubDate>
    <dc:creator>aginside_out</dc:creator>
    <dc:date>2021-10-06T13:46:04Z</dc:date>
    <item>
      <title>Matching object's front elevation with a street segment | inscribed rectangle</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/matching-object-s-front-elevation-with-a-street/m-p/1105136#M10330</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that the image clearly shows what I have been trying to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;gt; I have an urban block, divided into separate lots, and would like the buildings to be created on each so that the front elevation matches the street segment orientation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I tried with this piece of a code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;BaseArea --&amp;gt;&lt;BR /&gt;reverseNormals()&lt;/P&gt;&lt;P&gt;innerRectangle(scope) {shape : Lot |&lt;BR /&gt;remainder = JustGround}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;### Rules&lt;/P&gt;&lt;P&gt;@StartRule&lt;/P&gt;&lt;P&gt;# divide the block into 2 parts: Lot and JustGround.&lt;BR /&gt;BaseArea --&amp;gt;&lt;BR /&gt;reverseNormals()&lt;/P&gt;&lt;P&gt;innerRectangle(scope) {shape : Lot |&lt;BR /&gt;remainder = JustGround}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Lot --&amp;gt;&lt;BR /&gt;case isBuildingType(0):&lt;BR /&gt;print("total area = " + geometry.area)&lt;BR /&gt;splitArea(x) { ~1 : splitArea(z) { '0.5 : Red&lt;BR /&gt;| '0.5 : Yellow }&lt;BR /&gt;| ~1 : splitArea(z) { '0.5 : Turqoise&lt;BR /&gt;| '0.5 : Cyan }&lt;BR /&gt;| ~1 : splitArea(z) { '0.5 : Blue&lt;BR /&gt;| '0.5 : Magenta }&lt;BR /&gt;}&lt;BR /&gt;case isBuildingType(1):&lt;BR /&gt;print(geometry.area)&lt;BR /&gt;splitArea(z) { '0.5 : Pink&lt;BR /&gt;| '0.5 : Blue }&lt;BR /&gt;else:&lt;BR /&gt;print("total area = " + geometry.area)&lt;BR /&gt;splitArea(z) { '1 : Pink }&lt;BR /&gt;&lt;BR /&gt;Red --&amp;gt; // red&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//SHOP&lt;/P&gt;&lt;P&gt;Yellow --&amp;gt; // yellow&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;Turqoise --&amp;gt; // green&lt;BR /&gt;Garden&lt;BR /&gt;//GREENERY&lt;/P&gt;&lt;P&gt;Cyan --&amp;gt; // cyan&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;Blue --&amp;gt; // blue&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;Magenta --&amp;gt; // magenta&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;Pink --&amp;gt; // semi-transparent pink&lt;BR /&gt;BuiltupArea&lt;BR /&gt;//HOUSE&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Divide BuiltupArea into an O shape: the area of O shape is FootageA; the remainder is Garden.&lt;BR /&gt;BuiltupArea --&amp;gt;&lt;/P&gt;&lt;P&gt;shapeO(FrontDepth,RightWidth,BackDepth,LeftWidth) {shape: FootageA|remainder: Garden}&lt;/P&gt;&lt;P&gt;FootageA --&amp;gt;&lt;BR /&gt;split(x){~15:FootageB|{~8:FootageC|~15: FootageB}*}&lt;/P&gt;&lt;P&gt;# split FootageB by z axial into 2 parts: FootageD and FootageE. FootageE is the OutHouse. FootageD is the Building.&lt;BR /&gt;FootageB --&amp;gt;&lt;BR /&gt;split(z){~10:FootageD|{~5:FootageE|~10: FootageF}*}&lt;BR /&gt;&lt;BR /&gt;FootageC --&amp;gt;&lt;BR /&gt;Garden&lt;/P&gt;&lt;P&gt;# extrude FootageE&lt;BR /&gt;FootageE --&amp;gt;&lt;BR /&gt;case FloorNumber &amp;gt; 1 :&lt;BR /&gt;extrude(FloorHeight)OutHouse&lt;BR /&gt;else : Garden&lt;BR /&gt;&lt;BR /&gt;# extrude FootageD&lt;BR /&gt;FootageD --&amp;gt;&lt;BR /&gt;case FloorNumber &amp;lt; 2 : Ground&lt;BR /&gt;case FloorNumber &amp;gt; 3 :&lt;BR /&gt;extrude(FloorHeight)Building&lt;BR /&gt;else : extrude(Height-FloorHeight)Building&lt;BR /&gt;&lt;BR /&gt;# extrude FootageD&lt;BR /&gt;FootageF --&amp;gt;&lt;BR /&gt;extrude(Height)Building&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...and the script goes on. I have read about two options of fitting the rectangle (that is meant to be the building footprint) into a polygon (which is the shape of my lots) -&amp;gt;&amp;nbsp;innerRectangle(scope)&amp;nbsp; and&amp;nbsp;innerRectangle(edge). I do wonder whether there is any other solution that I may apply to the project.&lt;/P&gt;&lt;P&gt;Have a nice day!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 13:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/matching-object-s-front-elevation-with-a-street/m-p/1105136#M10330</guid>
      <dc:creator>aginside_out</dc:creator>
      <dc:date>2021-10-06T13:46:04Z</dc:date>
    </item>
  </channel>
</rss>

