This is duplicate post of a discussion I started on ESRI’s CityEngine support forum

I know roads don't really look like that...

A quick CGA rule share here! This one allows you to place randomly a selection of tree models on a lot (with start rule “woodland”). In my city model I wanted to place some trees in open areas by a river so this was a quick solution. This places a number of random trees (100) of different sizes and ranges, I’ve also allowed for a setback so when the lot fronts a road the trees are not right up against it.

Obviously you can change the names of the rules to what you use and you could combine this with the landuses code I posted first in this discussion thread.

If you need a tree you could use SketchUp and if you have the free version you might want this OBJ exporter plugin

tree_asset = fileRandom("trees/tree*.obj") // you could just have *.obj and it would randomly pick any obj file in this directory, you can use sketchup to create an obj
attr treenumber = 100 //change this depending on your lot size, or maybe run an area test on the lot to determine the density of your woodland!
attr treeminheight = 5 // know your tree to get that realistic height, perhaps wiki it?
attr treemaxheight = 15
attr woodlandsetback = 5

woodland-->
	setback(woodlandsetback) { streetSide : woodlandborder | remainder : trees} 

trees-->
	scatter(surface, treenumber, uniform) { palmtree }
	woodlandground

singletree-->
	t(0,0,0) // you can change these numbers as well if you didn't want to place the tree at the scatter point centre
	s(0,rand(treeminheight ,treemaxheight ),0)
	r(0,rand(0,360),0) // rotates tree at a random rotation
	i(tree_asset)	

woodlandborder-->
	 extrude(1) woodlandbordercolor

woodlandground-->color("#005B00")

woodlandbordercolor-->color("#AAAA55")

As usual if anyone has any suggestions/thoughts/modifications please reply!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.