Select to view content in your preferred language

Incorrect orientation of buildings when dividing the block

229
3
a week ago
maziaryousefi
Emerging Contributor

Hello everyone - I have two blocks that you can see in the attached clips 1 and 2 -. In the left block which is divided into two parts and then each part is divided into buildings. Now my question is why in the left part of the block the division of the structures is not done in one direction while the right side of the building block is divided correctly - of course this does not happen for a block that has a regular shape and this problem occurs when the shape of the block is like the block on the left. Does anyone have a solution to solve this problem. Thanks

Tags (2)
0 Kudos
3 Replies
nicolaisteino
Occasional Contributor

Hi Maziar, if I understand you correctly, you want all subdivided lots to behave the same, but they don’t. It is not possible to analyse your problem without access to your script. If you share your script – along with a description (graphic, verbal or both)  of what you want it to do – I’d be happy to take a look at it and see, if I can detect were it’s gone sour for you.

Regards, Nic

0 Kudos
maziaryousefi
Emerging Contributor

Hi Nic

 

maziaryousefi_0-1745853724761.png

 

 

maziaryousefi_1-1745853754236.png

 

 

0 Kudos
nicolaisteino
Occasional Contributor

Hi Maziar, I am still not quite sure what exactly you want to achieve. I found your script rather obtuse, so I made another script from scratch. First I tried using the setback operation, as it allows to respond to real world orientation (north, south, etc.), using the world.north, world.south, etc. selectors, as this was part of your script, without having any relation to the actual corners of the world. However, it lead to problems on irregular blocks (start shapes), similar to the ones you describe (I couldn't reproduce them from your script, as I didn't have your shapes).

Long story short, I used a much simpler approach with simple splits, as you can see in the script below. Basically it allows you to

  • Mirror the lots along the two long edges or not
  • Rotate the split direction to possibly fit better with irregular blocks
  • Align buildings along or across the direction of the street
  • Position the buildings left/back, center, or right/front on the lots
  • Keep a uniform height for all buildings or vary the heights within a min and max height

Check out the visuals below.

Rather than working from a ground cover ratio for buildings (which I think you do), I simply used a uniform building width, which can be set. I also used the InnerRectangle operation to make buildings rectangular, even on irregular lots.

Maybe that's not what you want/need, but I couldn't easily analyse your script 🙂. Nonetheless, I'm sure that you can draw inspiration from my script (below) and/or edit it to suit your needs. You may also wish to add some padding around the buildings, to avoid that they develop back-to-back.

Regards, Nic

version "2024.1"

#### ATTRIBUTES

@Order(2)
attr mirrorLots = true
@Order(3)
@Range(min=10,max=50,stepsize=1,restricted=true)
attr lotWidth	= 20
@Order(1)
@Range(min=-45,max=45,stepsize=5,restricted=true)
attr rotateLots = 0
@Order(7)
attr buildingWidth = 12
@Order(5)
@Enum("along","across")
attr buildingOrientation = "along"
@Order(6)
@Enum("center","left/front","right/back")
attr buildingPosition = "center"
@Order(9)
@Range(min=3,max=24,stepsize=3,restricted=true)
attr buildingHeight = 12
@Order(8)
@Enum("uniform","varied")
attr buildingHeightVariation = "uniform"		
@Order(14)
attr buildingHeightMin	= 3
@Order(15)
attr buildingHeightMax	= 45

#### RULES

Lot -->
	case scope.sz >scope.sx	:
		rotateScope(0,rotateLots+90,0) A00
	else					:
		rotateScope(0,rotateLots,0) A00
		
A00 -->
	split(z)
		{ '0.5	: A02
		| '0.5	: A01
		}

A01 -->
	case mirrorLots == true	:
		rotateScope(0,180,0) A02
	else					:
		A02
		
A02 -->
	split(x)
		{ ~lotWidth	: A03
		}*

A03 -->
	innerRectangle(edge)
		{ shape		: A04
		| remainder	: OpenSpace
		}

A04 -->
	case buildingOrientation == "along"	:
		A05
	else								:
		rotateScope(0,90,0) A05

A05 -->
	case buildingPosition == "left/front"	:
		split(z)
			{ buildingWidth	: Footprint
			| ~1			: OpenSpace
			}
	case buildingPosition == "right/back"	:
		split(z)
			{ ~1			: OpenSpace
			| buildingWidth	: Footprint
			}
	else								:
		split(z)
			{ ~1			: OpenSpace
			| buildingWidth	: Footprint
			| ~1			: OpenSpace
			}
		
Footprint -->
	case buildingHeightVariation == "uniform"	:
		extrude(buildingHeight) Envelope
	else										:
		extrude(rint((rand(buildingHeightMin,buildingHeightMax)/3)))  Envelope

Envelope -->
	color(0.9,0.8,0.7)
	
OpenSpace -->
	color(0.7,1,0.7)
			

 

 

0 Kudos