<?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: Split Shapes with different way? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490395#M6627</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Devin. The split area and the geometry area function are answering my question to a certain extent. But I want equal areas and cuttings in different axes same time.Like my example.How can I do that? btw,thanks for reply.&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/445256_IMG_20190430_111258.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Apr 2019 08:40:26 GMT</pubDate>
    <dc:creator>MikeJane</dc:creator>
    <dc:date>2019-04-30T08:40:26Z</dc:date>
    <item>
      <title>Split Shapes with different way?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490393#M6625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;How to split&amp;nbsp;blocks into equal&amp;nbsp;lots randomly.Block parameters do this, but they are minimum and maximum space based. I want to be able to do number based identification.For example recursive-offset or skeleton subdivision splitting 3,5,10(how many pieces do I want) pieces. Is it possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Apr 2019 20:27:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490393#M6625</guid>
      <dc:creator>MikeJane</dc:creator>
      <dc:date>2019-04-21T20:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Split Shapes with different way?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490394#M6626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean control the number of splits of shape? Something like this would do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;@Range(0,100)
attr NumSplits = 3

Shape--&amp;gt;
   split(x) {scope.sx/NumSplits:NewShape}*&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also split by area. This code makes sure every subshape is the same size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;@Range(0,100)
attr NumSplits = 3

Shape--&amp;gt;
   splitArea(x) {geometry.area/NumSplits:NewShape}*&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:35:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490394#M6626</guid>
      <dc:creator>DevinLavigne</dc:creator>
      <dc:date>2021-12-11T21:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Split Shapes with different way?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490395#M6627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Devin. The split area and the geometry area function are answering my question to a certain extent. But I want equal areas and cuttings in different axes same time.Like my example.How can I do that? btw,thanks for reply.&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/445256_IMG_20190430_111258.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2019 08:40:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490395#M6627</guid>
      <dc:creator>MikeJane</dc:creator>
      <dc:date>2019-04-30T08:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Split Shapes with different way?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490396#M6628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;splitArea Operation&lt;/P&gt;&lt;DIV class=""&gt;&lt;TABLE summary=""&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE class=""&gt;Lot --&amp;gt;    SplitArea(3)  SplitArea(n) --&amp;gt;    case n == 0 :       A    case scope.sz &amp;gt; scope.sx :       splitArea(z) { ~1 : SplitArea(n-1)                    | ~1 : SplitArea(n-1) }    else :       splitArea(x) { ~1 : SplitArea(n-1)                    | ~1 : SplitArea(n-1) }&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;splitArea Operation&lt;DIV class=""&gt;&lt;TABLE summary=""&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;EM&gt;The block is divided recursively three times using &lt;SPAN class=""&gt;splitArea&lt;/SPAN&gt;. Each split divides the shape perpendicular to its longest axis into two parts of equal area. Each lot is colored by its area such that lots with the same area have the same color. Using &lt;SPAN class=""&gt;splitArea&lt;/SPAN&gt;, all the lots are yellow because the block is divided into equal area lots.&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;This code is useful, but it divides the space into 8 pieces in the form of 2 * 2 * 2. But you do not divide into parts like 3,5,6,7.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2019 09:09:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490396#M6628</guid>
      <dc:creator>MikeJane</dc:creator>
      <dc:date>2019-04-30T09:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Split Shapes with different way?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490397#M6629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay I understand.&amp;nbsp; You just need to work through the logic and the math. First split off the first parcel in one direction - I think z if we align our scope. Then divide up the rest by the even number with a split on the x-axis.&amp;nbsp;If we are only doing 3 subdivisions then its easy, just divide in half. But if we are doing more than 3 we split in half and then split again for what is remaining (our EvenSplit). Hopefully you can follow the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;@Range(3,5,7,9,11)
attr NumSplits = 3

@Hidden
attr EvenSplits = NumSplits - 1

Shape--&amp;gt;
	alignScopeToGeometry(yUp,1)
   	SplitShapes

SplitShapes--&amp;gt;   
   case NumSplits == 3: 
	   splitArea(z) {geometry.area/NumSplits:NewShape | ~1: split(x){'0.5:NewShape | '0.5:NewShape}}
   else:
   		splitArea(z) {geometry.area/NumSplits:NewShape | ~1: split(x){'0.5:splitArea(z){~geometry.area/EvenSplits*2:NewShape}*  | '0.5:splitArea(z){~geometry.area/EvenSplits*2:NewShape}*}}

NewShape--&amp;gt;
	print(geometry.area)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/445297_pastedImage_1.png" /&gt;and the console reports the areas to be just about exact&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/445346_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look good?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:35:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490397#M6629</guid>
      <dc:creator>DevinLavigne</dc:creator>
      <dc:date>2021-12-11T21:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Split Shapes with different way?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490398#M6630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats cool.Thank you for your interest Devin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2019 20:28:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/split-shapes-with-different-way/m-p/490398#M6630</guid>
      <dc:creator>MikeJane</dc:creator>
      <dc:date>2019-04-30T20:28:54Z</dc:date>
    </item>
  </channel>
</rss>

