Select to view content in your preferred language

about window split cga

407
1
12-09-2019 06:11 AM
chojeo
by
Emerging Contributor

hi

always thank you for good anwser

i am beginner in cityengine

i would like to split window like attached image

can you  make sample cga

0 Kudos
1 Reply
CherylLau
Esri Regular Contributor

Facade A

The code assumes that the scope of your facade is aligned such that x is along the width and y is along the height.

// Define facade width and height here or set to scope.sx or scope.sy
const facade_width = scope.sx
const facade_height = 9

const door_width = 0.3*facade_width
const door_height = 0.7*(facade_height/3)
const window_width = 0.7*facade_width
const window_height = 0.5*(facade_height/3)


Facade -->
	split(y) { ~1: Floor1
			 | ~1: Floor2
			 | ~1: Floor3. }
	
Floor1 -->
	split(y) { door_height: split(x) { ~1: Wall
									 | door_width: Door
									 | ~1: Wall
									 | door_width: Door
									 | ~1: Wall }
			 | ~1: Wall }
		
Floor2 -->
	split(x) { ~1: Wall
			 | window_width: WindowTile
			 | ~1: Wall }
			 
WindowTile -->
	split(y) { ~1: Wall
			 | window_height: Window
			 | ~1: Wall }
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Facade B

Modify the Facade A code above by changing the definition of window_width and the Floor2 rule as follows.

const window_width = 0.2*scope.sx

Floor2 -->
	split(x) { ~1: Wall
			 | window_width: WindowTile
			 | ~1: Wall
			 | window_width: WindowTile
			 | ~1: Wall }
0 Kudos