<?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: overlapping OBJ buildings in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1291023#M11007</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/676881"&gt;@GunSikKim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Quoting from the &lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-inside-function.htm" target="_self"&gt;inside / overlaps / touches function&lt;/A&gt; cga reference:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;SPAN&gt;In any case, tests are only performed against geometries which form a closed surface (i.e. a waterproof mesh which has no boundary edges).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So you need to simplify your inserted buildings first somehow. One possible solution would be to create a footprint out of the imported building, extrude the footprint and then do the occlusion query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Lot --&amp;gt;
	i("myBuilding.obj", yUp, keepSizeAlignPosition)
	footprint()
	extrude(20)
	Test
	
Test --&amp;gt; 
	case touches(all) : Red
	else : Green

Red --&amp;gt; color(1,0,0)
Green --&amp;gt; color(0,1,0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also in your case its probably enough to test using touches() instead of overlaps()&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Jonas&lt;/P&gt;</description>
    <pubDate>Fri, 19 May 2023 13:09:22 GMT</pubDate>
    <dc:creator>JonasObertuefer</dc:creator>
    <dc:date>2023-05-19T13:09:22Z</dc:date>
    <item>
      <title>overlapping OBJ buildings</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1289916#M11000</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GunSikKim_0-1684286803543.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70883i79C263E0D2F3979B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GunSikKim_0-1684286803543.png" alt="GunSikKim_0-1684286803543.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;BR /&gt;I'm populating building OBJ on the lots with insert function,&lt;BR /&gt;&lt;BR /&gt;one very important restriction is,&lt;BR /&gt;I want to keep the size of source OBJ (keepSizeAlignPosition)&lt;/P&gt;&lt;P&gt;I'm wondering if there's way to get rid of overlapping between geometry&lt;BR /&gt;&lt;BR /&gt;potential solution would be&lt;BR /&gt;&lt;BR /&gt;- detect the volume of the OBJ file than create Lot shape based on it (This might be the best for me)&lt;BR /&gt;&lt;BR /&gt;- pick a OBJ file that fits perfectly inside of given lot&lt;BR /&gt;&lt;BR /&gt;- if overlapping happens, NIL&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-------------&lt;/P&gt;&lt;DIV&gt;villa_bldg_1 --&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;innerRectangle(edge) {shape : letsoffsetResidential | remainder = NIL}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;letsoffsetResidential --&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;offset(bldOffset*-1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;comp(f) { inside : villa_bldg_1_i | border : NIL }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;villa_bldg_1_i&amp;nbsp; --&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;alignScopeToAxes(y) s('1,0,'1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i(getInstanceNameResidential, yUp, keepSizeAlignPosition)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 May 2023 01:37:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1289916#M11000</guid>
      <dc:creator>GunSikKim</dc:creator>
      <dc:date>2023-05-17T01:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping OBJ buildings</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1290252#M11001</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GunSikKim_0-1684346775138.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70979i867B7C62A9EF2E86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GunSikKim_0-1684346775138.png" alt="GunSikKim_0-1684346775138.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;update -&amp;nbsp;&lt;BR /&gt;I'm switching LOD by user-created attribute&lt;BR /&gt;&lt;BR /&gt;I found that&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Test --&amp;gt; case overlaps(all) : Red&lt;BR /&gt;else : Green&lt;BR /&gt;&lt;BR /&gt;Red --&amp;gt; color(1,0,0)&lt;BR /&gt;Green --&amp;gt; color(0,1,0)&lt;BR /&gt;&lt;BR /&gt;occlusion detection on bounding box (which is still box OBJ files) works great&lt;BR /&gt;but not with high-poly OBJ like img below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GunSikKim_1-1684346903005.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70981i07F9B8B4166AFCF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GunSikKim_1-1684346903005.png" alt="GunSikKim_1-1684346903005.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It only detects if model touches street&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 18:09:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1290252#M11001</guid>
      <dc:creator>GunSikKim</dc:creator>
      <dc:date>2023-05-17T18:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping OBJ buildings</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1291023#M11007</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/676881"&gt;@GunSikKim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Quoting from the &lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-inside-function.htm" target="_self"&gt;inside / overlaps / touches function&lt;/A&gt; cga reference:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;DIV&gt;&lt;SPAN&gt;In any case, tests are only performed against geometries which form a closed surface (i.e. a waterproof mesh which has no boundary edges).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So you need to simplify your inserted buildings first somehow. One possible solution would be to create a footprint out of the imported building, extrude the footprint and then do the occlusion query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Lot --&amp;gt;
	i("myBuilding.obj", yUp, keepSizeAlignPosition)
	footprint()
	extrude(20)
	Test
	
Test --&amp;gt; 
	case touches(all) : Red
	else : Green

Red --&amp;gt; color(1,0,0)
Green --&amp;gt; color(0,1,0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also in your case its probably enough to test using touches() instead of overlaps()&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Jonas&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 13:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1291023#M11007</guid>
      <dc:creator>JonasObertuefer</dc:creator>
      <dc:date>2023-05-19T13:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping OBJ buildings</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1296581#M11032</link>
      <description>&lt;P&gt;You could use &lt;FONT face="courier new,courier"&gt;assetInfo()&lt;/FONT&gt; to get the size of an obj or &lt;FONT face="courier new,courier"&gt;assetsSortSize()&lt;/FONT&gt; to sort a list of obj files according to how well they match your current scope.&amp;nbsp; &lt;FONT face="courier new,courier"&gt;assetsSortRatio()&lt;/FONT&gt; also exists which sorts files by how well they match the reference ratio, but this may or may not be helpful in your case.&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-asset-info-function.htm" target="_blank"&gt;https://doc.arcgis.com/en/cityengine/latest/cga/cga-asset-info-function.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-assets-sort-size-function.htm" target="_blank"&gt;https://doc.arcgis.com/en/cityengine/latest/cga/cga-assets-sort-size-function.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 09:23:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/overlapping-obj-buildings/m-p/1296581#M11032</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2023-06-07T09:23:02Z</dc:date>
    </item>
  </channel>
</rss>

