Creating custom buildings

3302
2
10-22-2014 07:14 PM
AlanKlys
Occasional Contributor

Hi there folks.

My first real question here after stumbling my way through a few approaches that gave me mixed results.

Object_Stacks2.gif

What I wish to do is define a base shape, in CityEngine, for a car park level then on top of that I would like to add some podium definitions via externally created DAE shapes, extrude them to different heights then on top of those podiums again place some more DAE tower shapes and again extrude them individually to different heights.  It's the last part that's got me stuck at this stage.  When I place the podium DAE I use comp(f) to split them into their individual indices.  The part I'm struggling with is how do I then approach the placement of the towers, which come in as one DAE, then need to be split into separate shapes, and would then need to be each raised to the individual podium levels before extrusion ?  My guess is that I need to somehow keep  tabs on what I do to each podium and have to cater for that per the corresponding tower.

Thanks.       

0 Kudos
2 Replies
MatthiasBuehler
Occasional Contributor III

Hey !

It's easiest that you do the following:

(I didn't test this code, may contain errors.)

of course, add the attributes ..

Footprint -->

    extrude(world.y, buildingHeight)

    split(y) {~floorHeight: FloorVolume}*

FloorVolume -->

    case split.index == split.total -1:

        # top base floor

        FloorVolume.

        # copy the shape now ..

        comp(f){top: # scopezUp !

            alignScopeToAxes(y) # rotate scope yUp

            i(upperFootprint) # note that assets needs to be modeled yUp.

            Continue.

            }

    else:

        # other base floors. note you can also do a '== 0' test to get the ground floor !

        FloorVolume.

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

-------------------------------

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
AlanKlys
Occasional Contributor

Thanks a lot Matthias, I will test this out as soon as I get a chance and report back.

0 Kudos