Aligning a facade index to a cardinal direction

4312
4
Jump to solution
01-07-2015 05:44 PM
LR
by
Occasional Contributor III

Hi.

I'm creating a few generic buildings with the same rule — it splits a four-sided block into front, sides and back and textures them. However, as can be seen below, that doesn't always work as the index seems to start randomly(?) on any side.. my current solution are four copies of the script that roate through the four sides, but it's pretty annoying. Is it possible to assign the facade index 0 to, say, north?

northdammit.png

0 Kudos
1 Solution

Accepted Solutions
MatthiasBuehler
Occasional Contributor III

Hi,

an index can not be set to north or so.

don't use an index for this .. familiarize yourself with the 'first edge' (see help files / manual) and just use the component selectors.

Matt

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

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

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

View solution in original post

0 Kudos
4 Replies
MatthiasBuehler
Occasional Contributor III

Hi,

an index can not be set to north or so.

don't use an index for this .. familiarize yourself with the 'first edge' (see help files / manual) and just use the component selectors.

Matt

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

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

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
LR
by
Occasional Contributor III

Thanks.

Not sure if I correctly applied it, but this is what  I came up with - might as well post it.

version "2014.0"


attr direction = "N" # N, E, S, W
attr roofindex = 0 # 1, 2


Lot -->
  case direction == "N": NorthBuilding
  case direction == "E": EastBuilding
  case direction == "S": SouthBuilding
  case direction == "W": WestBuilding
  else: NorthBuilding



NorthBuilding -->
  cleanupGeometry(all, 0.5)
  extrude (4)
  comp(f){
  world.north: front | 
  world.west: right | 
  world.east: left | 
  world.south: back | 
  top: top
  }
0 Kudos
by Anonymous User
Not applicable

Here is one that might help you. Use whichEdge to rotate the "front" to any edge. -Chris

version "2014.0"  


@Range(0,10) # Range loops modulo style if more than edge count.
attr whichEdge = 0


Lot -->
  # Flatten shape to world xz plane: 
  alignScopeToAxes(y)
  s('1,0,'1)
  # Align scope to edge specified by whichEdge attribute.
  alignScopeToGeometry(yUp, 0, whichEdge) 
  Building 


Building -->  
  extrude(4)  
  comp(f){front: Front | right: Right | left: Left | back: Back | top: Top }
  
Front --> color(1,0,0)
Right --> color(0,1,0)
Left --> color(0,0,1)
Back --> color(1,1,0)
Top --> color(1,0,1)








LR
by
Occasional Contributor III

Thanks - I ended up using my rule because it allowed bulk alignment and used your suggestion for the roofs since they didn't accept world.*.

However now I'm looking for a way to do that - fixing wrong roof(s) is pretty time-consuming in large areas.. any idea how to align the roof to cardinal directions? This is how it usually looks like when I generate a row of buildings:

roofmess.png

0 Kudos