Select to view content in your preferred language

Determine adjacent shapes

1084
2
08-29-2023 02:29 AM
biaozeng
Regular Contributor

I found this great video on YouTube, which seems to take advantage of the adjacency between shapes. I want to know how this is implemented. I saw contact detection in the function library, but I cannot determine the direction of the roof ridge from it. At the end of the video, I also saw the adjacent shape characteristics. The screenshot is video 11:51

 

https://www.youtube.com/watch?v=jLXNzoBpmf4

biaozeng_0-1693301122690.png

biaozeng_1-1693301142964.png

 

 

CityEngine User Meeting 2022 www.3d-env.tech Recording of the CEUM 22: Presentation by Romain Janil [romainjanil.com] Thanks to the event speakers: Romain Janil [romainjanil.com] Micha Franz [City of Zurich] Bernie Frischer, David Massey [indiana.edu] Jonas Obertuefer, Benjamin Neukom [Esri R&D ...
0 Kudos
2 Replies
romainjanil
Regular Contributor

Hi, I guess I'm behind this video so may be I can help a bit. Generally speaking you can leverage adjacency (occlusion) test everywhere if you build relevant labeled shape proxys beforehand (but not parent nor children) in your shape tree. In this regard you can also use some comp(f,e etc) functions that will query occlusions tests so you can then grab subsequent indexes to feed operations that work with arrays of index as input . roofRidge doesn't but you can set the scope aligned to a specific edge before. To get this edge, use comp(fe) before with some other tests to get:- the edges which are not side, nor overlapping the labeled mass of some other building (or even finer labeled mass of the walls), their length, then rank them per length in order the longest edge (or whatever else not adjacent/inside/overlapping another building or wall), then set the scope you're applying the roofRidge onto to this index. If you need further hints feel free to contact me directly. 

0 Kudos
biaozeng
Regular Contributor

Thank you very much for your reply. I will try them according to your answer. I find it difficult to find sample tutorials on using arrays. If you know where there are official examples or documents related to arrays, you can recommend them to me. Thank you again

0 Kudos