Hello,
I'm populating building OBJ on the lots with insert function,
one very important restriction is,
I want to keep the size of source OBJ (keepSizeAlignPosition)
I'm wondering if there's way to get rid of overlapping between geometry
potential solution would be
- detect the volume of the OBJ file than create Lot shape based on it (This might be the best for me)
- pick a OBJ file that fits perfectly inside of given lot
- if overlapping happens, NIL
-------------
update -
I'm switching LOD by user-created attribute
I found that
Test --> case overlaps(all) : Red
else : Green
Red --> color(1,0,0)
Green --> color(0,1,0)
occlusion detection on bounding box (which is still box OBJ files) works great
but not with high-poly OBJ like img below
It only detects if model touches street
Hi @GunSikKim,
Quoting from the inside / overlaps / touches function cga reference:
In any case, tests are only performed against geometries which form a closed surface (i.e. a waterproof mesh which has no boundary edges).
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:
Lot -->
i("myBuilding.obj", yUp, keepSizeAlignPosition)
footprint()
extrude(20)
Test
Test -->
case touches(all) : Red
else : Green
Red --> color(1,0,0)
Green --> color(0,1,0)
Also in your case its probably enough to test using touches() instead of overlaps()
Hope this helps!
Best,
Jonas
You could use assetInfo() to get the size of an obj or assetsSortSize() to sort a list of obj files according to how well they match your current scope. assetsSortRatio() also exists which sorts files by how well they match the reference ratio, but this may or may not be helpful in your case.
https://doc.arcgis.com/en/cityengine/latest/cga/cga-asset-info-function.htm
https://doc.arcgis.com/en/cityengine/latest/cga/cga-assets-sort-size-function.htm