Control of lot/building orientation

3617
9
Jump to solution
05-09-2014 12:03 AM
tealli
by
New Contributor
hi matt,

I've got a question about orientation, maybe it's a simple one but I need help badly.

I think I briefly understand the concept of "scope". However, the lots divided by the tool of "block parameter" have different directions of FirstEdge, when I want all the wider wings exactly seated the rear of each lot, no matter how the block is divided, and no matter how the proportion of scope.sx and scope.sz of the lot is, I just cannot control that.

The image is shown below(left: nothing to do with scope, right: add "alignScopeToGeometry(yUp, any, world.lowest)rotateScope(0,90, 0)" and a little close to objective, apparently)
[ATTACH=CONFIG]33697[/ATTACH][ATTACH=CONFIG]33698[/ATTACH]

Again I need types of buildings in each lot are the same,  directions of open side of U-shape, wider wing, thinner wing and the connection, always the same.

Please help.
0 Kudos
1 Solution

Accepted Solutions
MatthiasBuehler1
Frequent Contributor
like so ?

[ATTACH=CONFIG]33863[/ATTACH]


attr streetSetbackDistance   = 5  attr wing_1_width    = 50 attr wing_2_width    = 24 attr wing_3_width    = 12  @StartRule Lot -->  StreetSetbacks   StreetSetbacks -->  setback(streetSetbackDistance) { all : ParcelBorder | remainder : ParcelInner }   ParcelInner -->  alignScopeToAxes()  # align to grid ( north, south, west, east )  setback(wing_1_width) { back : Wing1 | remainder : # setback relative to now oriented scope. namely, back, front, right.   setback(wing_2_width) { front : Wing2 | remainder :     setback(wing_3_width) { right : Wing3 | remainder : Yard    }   }   }  ParcelBorder -->  color(.7,.7,.7)   Wing1 -->  color(.2,.2,.9)   Wing2 -->  color(.9,.6,.2)  Wing3 -->  color(.9,.2,.2)  Yard -->  color(.7,.9,.7)

View solution in original post

0 Kudos
9 Replies
MatthiasBuehler1
Frequent Contributor
Hi,

then you did not understand the scope. 🙂

The FirstEdge DEFINES the orientation of the scope (x axis). 'Front' 'back', .. are all terms relative to the scope.
So, the FirstEdge DEFINES 'front', 'back', ..


Try:
alignScopeToGeometry(yUp, any, longest)

Note that you can either rotate the scope by 90 degrees ( as you did ) .. or just split differently in x/z.


ok ?
0 Kudos
by Anonymous User
Not applicable
Original User: lialia

hi matt,

Thx for reply and I understand the complex "scope" a little more. But, I'm not quite sure if I get the points 'cause my problem hasn't been solved. I tried your suggestion but it's not ok for my objective (figure 1). And some different cases occur when directions(real world) of the longest edges are different from others, just as shown in figure 2, the circle part. 

Below I attached my text and images which would make that clear. Also I wonder if the mechanism of Cityengine's defining scopes of shapes can align my grey parts of buildings to the red line(shown in figure 2),as shown in figure 3 which is what I want but achieved by several CGA rules slightly changed by rotate degrees (for different locations of lots within a block lead to different front,back...,which are relative to the real world orientations). If there exist solutions?



Lot --> 
alignScopeToGeometry(yUp, any, world.lowest) sublot 
sublot-->setback(10) { all : setbacks | remainder : footprint }
setbacks --> color("#808080")
footprint --> split(z) { 12 : mass |\1: wing |20: mass2 } 
wing --> split(x) { 12 : mass |\1: inner }
mass --> extrude(world.y, 24) Shape
mass2 --> extrude(world.y, 50) grey
grey --> color("#E0E0E0")  
inner --> color("#CAF497") 


[ATTACH=CONFIG]33713[/ATTACH][ATTACH=CONFIG]33714[/ATTACH][ATTACH=CONFIG]33715[/ATTACH]
0 Kudos
MatthiasBuehler1
Frequent Contributor
Hi,


you still use
alignScopeToGeometry(yUp, any, world.lowest)


as posted before, try and use
alignScopeToGeometry(yUp, any, longest)


does this work ?

matt
0 Kudos
by Anonymous User
Not applicable
Original User: lialia

hi,

awfully sorry, that not work.:( both "lowest" and "longest" show the similar patterns, and also the problems as i mentioned in my last thread. So I think it may need something special?

figure left :lowest, right:longest, you can see the differences, but still not point to the problem.:confused:

[ATTACH=CONFIG]33828[/ATTACH][ATTACH=CONFIG]33829[/ATTACH]
0 Kudos
MatthiasBuehler1
Frequent Contributor
sorry, I don't seem to follow.


can you make a very clear text of the rules of what part should be aligned where ?

you say the 'grey part' must be aligned to the 'red line'. but all parts are grey ..

maybe use colors for each building wing .. and tell me how the red line is actually defined... ok ?

sry .. matt .. 😮
0 Kudos
by Anonymous User
Not applicable
Original User: lialia

ok,matt. well, let's do it all again. thx for your patient.:o

i'll show you 4 figures, and you can see my way of thinking.
i define three wings different colors(blue, magenta and orange) and different height(50,24,12), street setbacks light grey and inner block light green.

figure 1: nothing to do with the "scope", so all directions of the opening which i don't expect at all.
[ATTACH=CONFIG]33855[/ATTACH]
Lot --> sublot 
sublot-->setback(10) { all : setbacks | remainder : footprint }
setbacks --> color("#C0C0C0")
footprint --> split(z) { 12 : mass |\1: midpart |20: mass2 } 
midpart --> split(x) { 12 : mass3 |\1: inner }
mass --> extrude(world.y, 24) mass1color 
mass2 --> extrude(world.y, 50) mass2color
mass1color --> color("#FF8000")
mass3 --> extrude(world.y, 12) mass3color
mass2color --> color("#0000FF") 
mass3color --> color("#FF0080") 
inner --> color("#CAF497")


then figure 2, alignScopeToGeometry(yUp, any, world.lowset) which a big step in my right direction but not perfect.
[ATTACH=CONFIG]33856[/ATTACH]
Lot --> 
alignScopeToGeometry(yUp, any, world.lowset) sublot 
sublot-->setback(10) { all : setbacks | remainder : footprint }
setbacks --> color("#C0C0C0")
footprint --> split(z) { 12 : mass |\1: midpart |20: mass2 } 
midpart --> split(x) { 12 : mass3 |\1: inner }
mass --> extrude(world.y, 24) mass1color 
mass2 --> extrude(world.y, 50) mass2color
mass1color --> color("#FF8000")
mass3 --> extrude(world.y, 12) mass3color
mass2color --> color("#0000FF") 
mass3color --> color("#FF0080") 
inner --> color("#CAF497")


and figure 3 , as your suggestion, alignScopeToGeometry(yUp, any, longest), and the 3d image. it looks like the  "lowest" one.
[ATTACH=CONFIG]33857[/ATTACH]
Lot --> .
alignScopeToGeometry(yUp, any, longest) sublot 
sublot-->setback(10) { all : setbacks | remainder : footprint }
setbacks --> color("#C0C0C0")
footprint --> split(z) { 12 : mass |\1: midpart |20: mass2 } 
midpart --> split(x) { 12 : mass3 |\1: inner }
mass --> extrude(world.y, 24) mass1color 
mass2 --> extrude(world.y, 50) mass2color
mass1color --> color("#FF8000")
mass3 --> extrude(world.y, 12) mass3color
mass2color --> color("#0000FF") 
mass3color --> color("#FF0080") 
inner --> color("#CAF497")


last, figure 4 illustrates my target pattern. the red line is defined as the rear of each lot or the same direction(i cannot define that in cityengine so i draw the red lines in photoshop...). I want all the blue wings of building align to the red lines, just as the right figure(achieved by several rules slightly changed by degrees of rotatescope).
[ATTACH=CONFIG]33858[/ATTACH]

A long thread and hope to make that clear. thanku:)


sorry, I don't seem to follow.


can you make a very clear text of the rules of what part should be aligned where ?

you say the 'grey part' must be aligned to the 'red line'. but all parts are grey ..

maybe use colors for each building wing .. and tell me how the red line is actually defined... ok ?

sry .. matt .. 😮
0 Kudos
MatthiasBuehler1
Frequent Contributor
like so ?

[ATTACH=CONFIG]33863[/ATTACH]


attr streetSetbackDistance   = 5  attr wing_1_width    = 50 attr wing_2_width    = 24 attr wing_3_width    = 12  @StartRule Lot -->  StreetSetbacks   StreetSetbacks -->  setback(streetSetbackDistance) { all : ParcelBorder | remainder : ParcelInner }   ParcelInner -->  alignScopeToAxes()  # align to grid ( north, south, west, east )  setback(wing_1_width) { back : Wing1 | remainder : # setback relative to now oriented scope. namely, back, front, right.   setback(wing_2_width) { front : Wing2 | remainder :     setback(wing_3_width) { right : Wing3 | remainder : Yard    }   }   }  ParcelBorder -->  color(.7,.7,.7)   Wing1 -->  color(.2,.2,.9)   Wing2 -->  color(.9,.6,.2)  Wing3 -->  color(.9,.2,.2)  Yard -->  color(.7,.9,.7)
0 Kudos
by Anonymous User
Not applicable
Original User: lialia

Yes! it works! thank you matt. 🙂 that is exactly what i want.

Well, maybe another question arises, that is how I fully study cityengine. I just learn it from the tutorials and forum which is just small part of the whole things I think. And I cannot solve some problems like the above one by myself. So would you give some good suggestions or tell me how you know the answers? thank you again.:o
0 Kudos
MatthiasBuehler1
Frequent Contributor
well, we're all learning in life.


I'm here to help, so: sure I'll try to help in future.


How I know this ?

Well, I work here in the CityEngine development team since 2009, about 4.5 years now.

😉

matt
0 Kudos