Control the edge index for the roofshed, or where it's built from.

2107
3
12-03-2014 11:25 AM
KennethLindhardt
Occasional Contributor

Hi, I got an issue. One among others, but this is regarding the roofShed. I got to exactly alike buildings, but they are rotated 90 degrees from each other ( an example I got around 50 rotated in all kinds of directions) My buildings are around 20m long and 8m wide. I know which side there is the lowest of height, and I know if that side was calculated as left, right, front or back. I can manually change where it is building the shed from, by changing the index, but can I make it always run from left as an example? Or how is it possible to control it, other than manually?    

0 Kudos
3 Replies
MatthiasBuehler
Regular Contributor

Hey ..

Go this route:

define a generic attr:

@Hidden

attr orientationIndex = 0

Then:

alignScopeToGeometry(yUp, any, longest)

Test

Test -->

    case scope.sx >= scope.sz:

        set(orientationIndex, 0)

        ContinueWithRoof

    else:

        set(orientationIndex, 1)

        ContinueWithRoof

ContinueWithRoof -->

    roof(..., orientationIndex)

OK ?

Matt

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

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

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
KennethLindhardt
Occasional Contributor

Hi Matt, I apologize for the late: “thanks” on this one, but thanks. It is in fact doing the first step. All the roofsheds are getting the slope in the prober either sx or sz direction, but is it not always the right direction of the slope. Right now whenever sz is the smallest, it will go from right (as lowest) to left (those values are delivered from the InnerRect function). But I know when left is lower than right, in that case is it then possible to rotate the scope, to make the roofshed go the other direction?

At the pictures, the highlighted needs to go the other way around, I can do that manually by flipping thru the indexes, but when I already know from the attributes, which side that is the tallest, it could be great to use that information procedural.Capture.PNG

By the way, I live in the one turning the right direction similar to those marked :)

0 Kudos
MatthiasBuehler
Regular Contributor

hey ..

sure you could feed the index from the GIS side.

note you mind the vertex order of GIS polygons are inverse to CityEngine shapes..

Matt

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

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

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos