comp operation by "flat island" in CityEngine

09-13-2018 03:56 AM
Status: Open
Occasional Contributor

Hi all.

It would be lovely to add a type of comp split that separates objects into "islands", or "flat shells" as long as they are continuous, so if the angle between faces does not exceed a certain amount. Independently from the number of faces this "island" contains. 

Take this example, where bot the C faces and A faces are orientated in the same way, let's say parallel to the object front, while the B faces are at 70 degrees . 

comp(f) { front= X} would produce a single mesh composed of A and C, thus not creating a flat surface.

comp(f) { front: X} will create 18  separates faces (12 in A plus 6 in B)

I suggest adding a comp(i) operation so that writing

comp(i) { front: X} produces 2 separated meshes, A and C.

I think it could be very useful especially with the buildings created from L, U and O shapes.

There could be an extra parameter defining what is the angle between faces in degree that is the limit to consider a shell "flat", like a threshold parameter. So that if there is an angle of 3 degrees between 2 faces and I type "4" in this parameter, the 2 faces will still be considered as part of the same shell.