Extrude Multipatch buildings in CE

10-11-2013 01:29 AM
New Contributor II

I'm quite newbie users of CE and I'm trying to create the first 3D building model by using our own sample data. My problem is that I cannot visualize correctly the building data which has both flat and pitched (gable) roof buildings in CE.

All building data is in one Multipatch shapefile which has several attributes describing e.g. terrain height, highest quota of buildings and building height itself. One field (HCL) describes eave heights in case of gable roofs. Pleas see attachments 1 and 2. The highlighted buildings are also shown in the attachments 3-6 (in the left).

I visualized the buildings in 3D e.g. in ArcGlobe (attachment 3) where you can see some gable roofs.

When I import the data to CE, I can still see gable roofs in when I use the tumble/Rotate tool (attachments 4-5). However, when I create a simple CGA rule to extrude building heights based on H2 field, the result is shown in attachment 6.

attr. H2 = 0
lOT--> extrude (H2)

My question is, how to extrude the buildings to show their gable roofs and avoid situation shown in the attachment 6? How to create a rule to show the buildings based on their necessary attribute information from the shapefile?

Thanks for any help you can provide!

Tags (2)
0 Kudos
2 Replies
New Contributor

I actually have the same question. How do I import multipatch shape files and retain the attributes in CE?

0 Kudos
Esri Regular Contributor

It looks like the data contains shapes that are not quite flat.  Are they supposed to be building footprints?  If so, then that's great because that makes it easy to create your building models using cga.  The rule you started with is a good start.  It extrudes the footprint to create the building with a flat roof.  Then, you can use comp to get the top face and then create a gable roof on top of that with height determined by the HCL attribute.  It looks like you were able to link the attributes correctly, so it looks like the code is getting the height information from the H2 attribute on the shapes.  To link the rule attributes to the object attributes, you have to use the same names in the rule file, which you have done.  In some cases, you might need to specify the connection in the Inspector by clicking on the drop down box for the attribute -> Connect Attribute -> select Object attribute, but in your case, it seems to have done this automatically for you.

attr H2 = 0
attr HCL = 0

Lot -->
     extrude(H2) Mass.
     comp(f) { top : roofGable(byHeight, HCL) Roof. }

In screenshot6, it looks like the shapes you started with are not flat building footprints.  If you can get the building footprints, you can create the models using cga code.  Or, if you have the building shells instead, you can just import those into CityEngine without needing to write any cga rules to generate the shells.

0 Kudos