<?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: Rule linking coverage ratio with distances from road and boundaries. in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1592677#M11528</link>
    <description>&lt;P&gt;As an example, you can first obtain the orientations of a parcel&amp;nbsp;shape with the&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/help/help-compute-attributes.htm" target="_self"&gt;Compute Edge Attributes tool&lt;/A&gt;. Then,&amp;nbsp;the following rule lets you define a maximum building coverage ratio and setback distances per side. In case the maximum coverage is smaller then the remainder of the &lt;EM&gt;setbackPerEdge &lt;/EM&gt;operation, the front setback is increased by the &lt;EM&gt;setbackToArea&lt;/EM&gt; operation (dark blue area).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThomasFuchs_1-1741250823630.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127147iFA0DDD0B5387BDB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="ThomasFuchs_1-1741250823630.png" alt="ThomasFuchs_1-1741250823630.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;version "2024.1"

const lotArea = geometry.area
@Description("Maximum ratio of footprint to parcel area") @Percent 
attr area_ratio = 0.5 
@Description("Minimum street setback") @Distance @Range(min=0, max=15) 
attr setback_front = 5
@Description("Excact side setback") @Distance @Range(min=0, max=15) 
attr setback_side = 10
@Description("Excact rear setback") @Distance @Range(min=0, max=15) 
attr setback_rear = 15

dist(orientation) = case orientation == "front"	: setback_front
                    case orientation == "side"	: setback_side
                    case orientation == "rear"	: setback_rear
                    else                   	 	: 0

@StartRule
SetbackPerEdge --&amp;gt; setbackPerEdge( dist( edgeAttr.getString("orientations") ) ) 
	{ edgeAttr.getString("orientations") == "front"	= Grey
	| edgeAttr.getString("orientations") == "side" 	= Yellow
	| edgeAttr.getString("orientations") == "rear"	= Green
	| remainder 	= SetbackToArea }

SetbackToArea --&amp;gt; setbackToArea(lotArea * area_ratio) 
	{ edgeAttr.getString("orientations") == "front"	= Blue 
	| remainder = extrude(10) Cyan }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Mar 2025 09:03:11 GMT</pubDate>
    <dc:creator>ThomasFuchs</dc:creator>
    <dc:date>2025-03-06T09:03:11Z</dc:date>
    <item>
      <title>Rule linking coverage ratio with distances from road and boundaries.</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1590843#M11526</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;As per the title, I am trying to create a rule that links the coverage ratio of a lot with distances from the road and boundaries. I will preface this by saying that I am a beginner in cityengine.&lt;BR /&gt;I have been working on this rule for two weeks now by reading several posts and following several youtube videos. I managed to create a rule that divides the notto into 5 parts.&lt;BR /&gt;A central part where the building is extruded and 4 other free parts. I divided the lot into all these parts so that I could adjust the distance to the boundaries and the road and have control over the building surface.&lt;BR /&gt;Only there is a problem. The control not perfect, in fact to be able to change the distances, I have to act on the percentage of area of the different lots. This is quite inconvenient for, because it doesn't allow me to act directly on the distances.&lt;BR /&gt;Being a beginner, I was wondering if there is a way to achieve this result.&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 18:02:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1590843#M11526</guid>
      <dc:creator>Neri12</dc:creator>
      <dc:date>2025-02-28T18:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rule linking coverage ratio with distances from road and boundaries.</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1592271#M11527</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/885942"&gt;@Neri12&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Welcome to the ArcGIS CityEngine Community.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;BR /&gt;To give you an advice, it would be very helpful, to have a screenshot and some snippets of your CGA code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;General information:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-setback-to-area-operation.htm" target="_self"&gt;setbackToArea operation&lt;/A&gt;&amp;nbsp;allows you to define the built up area vs. the free part ratio of a lot.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;the&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-setback-per-edge-operation.htm" target="_self"&gt;setbackPerEdge operation&lt;/A&gt; allows you to define a setback distance per edge.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 05 Mar 2025 15:48:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1592271#M11527</guid>
      <dc:creator>ThomasFuchs</dc:creator>
      <dc:date>2025-03-05T15:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rule linking coverage ratio with distances from road and boundaries.</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1592677#M11528</link>
      <description>&lt;P&gt;As an example, you can first obtain the orientations of a parcel&amp;nbsp;shape with the&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/help/help-compute-attributes.htm" target="_self"&gt;Compute Edge Attributes tool&lt;/A&gt;. Then,&amp;nbsp;the following rule lets you define a maximum building coverage ratio and setback distances per side. In case the maximum coverage is smaller then the remainder of the &lt;EM&gt;setbackPerEdge &lt;/EM&gt;operation, the front setback is increased by the &lt;EM&gt;setbackToArea&lt;/EM&gt; operation (dark blue area).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThomasFuchs_1-1741250823630.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127147iFA0DDD0B5387BDB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="ThomasFuchs_1-1741250823630.png" alt="ThomasFuchs_1-1741250823630.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;version "2024.1"

const lotArea = geometry.area
@Description("Maximum ratio of footprint to parcel area") @Percent 
attr area_ratio = 0.5 
@Description("Minimum street setback") @Distance @Range(min=0, max=15) 
attr setback_front = 5
@Description("Excact side setback") @Distance @Range(min=0, max=15) 
attr setback_side = 10
@Description("Excact rear setback") @Distance @Range(min=0, max=15) 
attr setback_rear = 15

dist(orientation) = case orientation == "front"	: setback_front
                    case orientation == "side"	: setback_side
                    case orientation == "rear"	: setback_rear
                    else                   	 	: 0

@StartRule
SetbackPerEdge --&amp;gt; setbackPerEdge( dist( edgeAttr.getString("orientations") ) ) 
	{ edgeAttr.getString("orientations") == "front"	= Grey
	| edgeAttr.getString("orientations") == "side" 	= Yellow
	| edgeAttr.getString("orientations") == "rear"	= Green
	| remainder 	= SetbackToArea }

SetbackToArea --&amp;gt; setbackToArea(lotArea * area_ratio) 
	{ edgeAttr.getString("orientations") == "front"	= Blue 
	| remainder = extrude(10) Cyan }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 09:03:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1592677#M11528</guid>
      <dc:creator>ThomasFuchs</dc:creator>
      <dc:date>2025-03-06T09:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rule linking coverage ratio with distances from road and boundaries.</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1593293#M11529</link>
      <description>&lt;P&gt;hello, thanks for the reply.&lt;/P&gt;&lt;P&gt;I tried your rule. But it doesn't work. I don't know why honestly. Anyway I somehow managed to revolve it using the function : &lt;STRONG&gt;&lt;SPAN class=""&gt;setbackToArea(&lt;/SPAN&gt;&lt;I&gt;&lt;SPAN class=""&gt;area, minDistances&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/STRONG&gt;, only I had to compromise, like the fact that the priority is not given to coverage ratio but to distances. To solve this invonvenientè, I created within the rule a report, which showed me the actual coverage ratio, so that I could then act manually to get the coverage ratio I was looking for.&lt;/P&gt;&lt;P&gt;Now I don't know if there is a more refined way to achieve the same result. If you know it, I could try it.&lt;/P&gt;&lt;P&gt;But now I resonate an additional problem, in prtica I would need to set limits to the distances from both the boundaries and the road, basically the distances need to change both according to the height of the eficio and if necessary I need to be able to eliminate a distance of one boundary from the other.&lt;/P&gt;&lt;P&gt;To explain better, I need to make the distance adjust to the height I choose, this is done by setting an attribute. So far so good, The problem I find in the moment I want the distance to cancel on the right side for example and become maximum on the left side. so as to create a building at the boundary.&lt;/P&gt;&lt;P&gt;I have actually already tried using both the @Enum function and the @Range function, but both fail to capture what I need. The latter gives me a range, the former, on the other hand, allows me to decirede predetermined numeric values, I would like those numeric values in the @enum function to be interactive and fit the input data that I enter, i.e., the alt.&lt;/P&gt;&lt;P&gt;I hope I have been clear.&lt;/P&gt;&lt;P&gt;Thanks again for the welcome in the comiunity, I hope to be able to create my own procedural rule with cityengine.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 13:28:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1593293#M11529</guid>
      <dc:creator>Neri12</dc:creator>
      <dc:date>2025-03-07T13:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rule linking coverage ratio with distances from road and boundaries.</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1594694#M11531</link>
      <description>&lt;P&gt;Thanks for your feedback. Great that you managed to resolve the your question.&lt;BR /&gt;To make my example rule work, the&amp;nbsp;&lt;SPAN&gt;parcel&amp;nbsp;shape requires the&lt;/SPAN&gt;&amp;nbsp;attribute &lt;EM&gt;edgeattr/&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;orientations&lt;/EM&gt; set by the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/help/help-compute-attributes.htm" target="_self" rel="nofollow noopener noreferrer"&gt;Compute Edge Attributes tool&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 13:20:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/rule-linking-coverage-ratio-with-distances-from/m-p/1594694#M11531</guid>
      <dc:creator>ThomasFuchs</dc:creator>
      <dc:date>2025-03-12T13:20:42Z</dc:date>
    </item>
  </channel>
</rss>

