<?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: detecting terrain intersetion with a shape to achieve more realistic window texturing in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609208#M8143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK you can't query the raster. You could however create a fine triangular mesh and project it onto the terrain. That way you could use the occlusion query with the terrain height - the accuracy of this would depend on your triangle size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the query itself, it doesn't report&amp;nbsp;the touching height. To save polygons, you could do incremental querying. For example, if you have a wall with four floors you'd first check if the whole wall&amp;nbsp;is touching the ground at all (maybe add a little offset from the bottom or else it'll always trigger). If it returns a positive, divide it (floorcount/2)&amp;nbsp;and check again with the separate parts. The parts that don't touch won't need further splitting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2017 21:17:04 GMT</pubDate>
    <dc:creator>LR</dc:creator>
    <dc:date>2017-02-15T21:17:04Z</dc:date>
    <item>
      <title>detecting terrain intersetion with a shape to achieve more realistic window texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609207#M8142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a static model of a building (converted to a shape to be able to texture it using cga)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while texturing buildings on non-flat terrain, I often encounter a problem as on picture that the windows are (partially) burried under ground:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="322687" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/322687_pastedImage_4.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to fix this problem so that it looks more realistic. The possible solutions that I can think of are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;solution A&lt;/STRONG&gt;: (better)&amp;nbsp;- to be able to detect the highest point where terrain intersects a face and from that point make a horizontal line so that I subdivide this face into two subfaces and then place a non-window texture at bottom&amp;nbsp;where the windows might get buried under ground and place a window texture at the top of face&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="322709" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/322709_pastedImage_5.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;solution B:&lt;/STRONG&gt; subdivide this face into regular grid and then check if each subface intersects with terrain.&lt;/P&gt;&lt;P&gt;If so, then put non-widnow texture, otherwise place widnow texture. this looks like a worse solution because it produces lots of useless&amp;nbsp;polygons&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="322711" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/322711_pastedImage_6.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so can cityEngine detect if a face collides with a terrain and detect an exact position&amp;nbsp;where it collides using cga/python?&lt;/P&gt;&lt;P&gt;so far I only found occlusion query functions but looks like they work only between shapes and not between shapes and terrains&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or If there is a&amp;nbsp;better way how to texture static models of buildings (not extruded using footprints) so that their windows don't collide with terrain please let me know&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2017 16:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609207#M8142</guid>
      <dc:creator>testtest24</dc:creator>
      <dc:date>2017-02-15T16:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: detecting terrain intersetion with a shape to achieve more realistic window texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609208#M8143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK you can't query the raster. You could however create a fine triangular mesh and project it onto the terrain. That way you could use the occlusion query with the terrain height - the accuracy of this would depend on your triangle size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the query itself, it doesn't report&amp;nbsp;the touching height. To save polygons, you could do incremental querying. For example, if you have a wall with four floors you'd first check if the whole wall&amp;nbsp;is touching the ground at all (maybe add a little offset from the bottom or else it'll always trigger). If it returns a positive, divide it (floorcount/2)&amp;nbsp;and check again with the separate parts. The parts that don't touch won't need further splitting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2017 21:17:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609208#M8143</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2017-02-15T21:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: detecting terrain intersetion with a shape to achieve more realistic window texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609209#M8144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for help, it worked! it produces more useless polygons but I guess that's the downside...&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt; &lt;/DIV&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/324267_pastedImage_1.jpg" style="width: 620px; height: 481px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to "merge" the polygons that have same textures?&amp;nbsp;to save performance and allow better texturing (because of bigger polygons)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried&amp;nbsp;cleanupGeometry(all, 1) or&amp;nbsp;&lt;SPAN class=""&gt;reduceGeometry(1) but none of them seems to work&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 14:29:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609209#M8144</guid>
      <dc:creator>MarekDekys</dc:creator>
      <dc:date>2017-02-16T14:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: detecting terrain intersetion with a shape to achieve more realistic window texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609210#M8145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CGA is unfortunately one-way. I think you could try a two-pass method using python, looking something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: square;"&gt;&lt;LI&gt;extrude the mesh straight downwards, so it at least covers the bottom-most building's floor.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: square;"&gt;&lt;LI&gt;give the walls attributes:&lt;UL&gt;&lt;LI&gt;some height variable&amp;nbsp;(let's call it myHeight)&lt;/LI&gt;&lt;LI&gt;some kind of UID, if not already present&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: square;"&gt;&lt;LI&gt;write a cga rule that splits the wall every 0.1m (or smaller, depends on how accurate you want to be). Each slice then does an occlusion query and reports its UID&amp;nbsp;if touched. This means every slice below ground will report back.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: square;"&gt;&lt;LI&gt;write a python script to export the report and then pull the values back. Using the report you can now write the touch-height into &lt;SPAN&gt;myHeight&lt;/SPAN&gt;: the UID value can be used to target the proper walls, the report count of the UID * your split height equals the (building-) height at which the building touches the triangle surface.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: square;"&gt;&lt;LI&gt;Now that you have the touch-height permanently written as attribute, you can write a rule that uses&amp;nbsp;&lt;SPAN&gt;myHeight as split value.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2017 16:44:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609210#M8145</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2017-02-17T16:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: detecting terrain intersetion with a shape to achieve more realistic window texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609211#M8146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi LR,&lt;/P&gt;&lt;P&gt;Read this discussion that is helpful for me. I wonder if I can query the inserted OBJ model?&lt;/P&gt;&lt;P&gt;Because I saw the&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;fine triangular mesh&amp;nbsp;&lt;SPAN&gt;created could be queried, I tried my case it seems the model to be ignored..&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;Any suggestion about it? Thank you.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;CHEN&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 07:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609211#M8146</guid>
      <dc:creator>HangyuChen</dc:creator>
      <dc:date>2017-03-28T07:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: detecting terrain intersetion with a shape to achieve more realistic window texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609212#M8147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rightclick on the OBJ and import it through the dialog. Uncheck the "import as static model" option, then apply the rule to it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 12:41:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609212#M8147</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2017-03-31T12:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: detecting terrain intersetion with a shape to achieve more realistic window texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609213#M8148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean obj model which is imported by CGA rule using i (insert operation).&lt;/P&gt;&lt;P&gt;i try to detect intersection between the new shape (new building) and existing building. for this building i use the obj model created by sketchup. just give it a scope and i() it. then new shape can't query it.&lt;/P&gt;&lt;P&gt;is there something i should do to obj model before i() it?&lt;/P&gt;&lt;P&gt;CHEN&lt;/P&gt;&lt;H1 style="color: #ffffff; font-size: 1.15rem; margin: 0px 0px 15px; padding: 12px 0px 6px 10px;"&gt;&lt;/H1&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 13:47:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609213#M8148</guid>
      <dc:creator>HangyuChen</dc:creator>
      <dc:date>2017-03-31T13:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: detecting terrain intersetion with a shape to achieve more realistic window texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609214#M8149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like this is not possible, generated models aren't triggered by the OBJ, only the other way around.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2017 12:07:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/detecting-terrain-intersetion-with-a-shape-to/m-p/609214#M8149</guid>
      <dc:creator>LR</dc:creator>
      <dc:date>2017-04-11T12:07:42Z</dc:date>
    </item>
  </channel>
</rss>

