How to get hole(innerboundary) of a shape in cityengine?

2169
3
01-31-2016 02:52 PM
zhihanlu
New Contributor

I tried to get hole of shape in cityengine, but it doesn't work. I have exported 'vertices' of shapes by python, while the 'vertices' attribute of object includes both outerboundary and innerboundary, which cannot distinguish innerboundary from outerboundary.

Is there any method to get the hole from a shape ?

0 Kudos
3 Replies
CherylLau
Esri Regular Contributor

Maybe you could export the vertices marked on the inner boundary as a separate shape.  Then you can apply a rule to that shape.

0 Kudos
zhihanlu
New Contributor

But I don't know which vertices are inner boundary...

It's obvious that cityengine can recognize inner boundaries and render them correctly, but I cannot get the inner boundaries information by cityengine functions.

0 Kudos
CherylLau
Esri Regular Contributor

Sorry, I misunderstood the situation (I thought you knew the inner and outer boundaries while exporting in Python).

No, I don't think you can get the hole using CGA operations on a shape with a hole.  However, if you are creating your shape in Python, then you might be able to create a face for the hole.  (I don't really know how you are getting your initial shapes, but if you can create a face for everything including the hole, then the following will work.)  Then, if there are multiple faces, you can use the comp split to separate the border faces from the inside faces.

comp(f) { border = Border | inside = Hole }

(Note, the = is used instead of : to keep all the border faces (if there are multiple) together as a single shape, but you can use : if you'd rather separate the faces into different shapes.)

0 Kudos