split comp operation by "planar surfaces"?

1330
3
09-25-2018 03:24 AM
AbeleGiandoso
Occasional Contributor

Hi All

I posted a Suggestion in the Idea section, 

comp operation by "flat island" in CityEngine 

but I thought maybe there is a way to do just that already and I haven't thought about it.

If you ppl have some sugestions it would be amazing! And if you like the suggestion please vote for it  so it maybe gets implemented. 

It is a problem I encounter all the times, as I work with imported FBX assets, lots created from curved streets, L, U and O shapes, so very irregular base shapes. 

My question:

Is there a way to do a Comp by islandcomp 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.

ALTERNATIVELY

If this is not possible, is there any method, taking the above example, AFTER doing

comp(f) { front= X} 

therefore eliminating surface B, to separate surface A from Surface C without splitting them into 18 microfacets?

UPDATE I see there is a function called geometry.isPlanar, maybe something involving that..  😕

3 Replies
CherylLau
Esri Regular Contributor

I agree that this would be useful.  This is a common use case that we have been considering, and hopefully we will have something to handle this in the future.  Thank you for your enthusiasm and for sharing your use case with us.

For now, unfortunately, I can't think of a good workaround.

AbeleGiandoso
Occasional Contributor

Thanks!

Ideally it is two different separsed problems:

- separating surfaces into shells accordingly to their normals independently by the number of faces.

- splitting geometries by continuity, like the 2 front faces of a O shaped building (external front and internal front) independently by the number of faces.

Having these two extra operations should cover all situations

0 Kudos
AbeleGiandoso
Occasional Contributor

Bump

0 Kudos