Select to view content in your preferred language

After splitting Lot into Garden and Building can't extrude Building

1532
5
06-19-2014 12:06 AM
MilosVajdic
Emerging Contributor
Hi Guys,
I've used this forum to get this far and I need your help once again.

After splittng Lot into Garden (front and back) and Building, I have Building on random offset and extrude, but I don't know how to make area that is not extruded to building height to extrude and match height of the sidewalk and gardens.

Any help is appreciated.

Lot -->
 setback(rand(4,10)) { street.front : Garden | street.back : Garden | remainder : Building }

Garden --> 
 color("#00ff00")
 extrude(0.1)

attr BlgOffsetMin = -1
attr BlgOffsetMax = -2.5
attr BlgExtrMin = 3
attr BlgExtrMax = 9

Building-->
 offset(rand(BlgOffsetMin, BlgOffsetMax), inside)
 extrude(world.y, rand(BlgExtrMin, BlgExtrMax))
 
 
OffsetLot  --> comp(f) { inside: Footprint }
Footprint --> extrude(60)



[ATTACH=CONFIG]34726[/ATTACH]
0 Kudos
5 Replies
MatthiasBuehler1
Deactivated User
hey ..

you're leaving the border shapes away this way and only select inside.

offset(rand(BlgOffsetMin, BlgOffsetMax), inside)


the code you have is the short form of :

offset(rand(BlgOffsetMin, BlgOffsetMax))
comp(f) {inside: DoSomething. | all : NIL }


so you have 2 options:

ugly:
duplicate the shape with the 2 short selectors:
Rule -->
    offset(rand(BlgOffsetMin, BlgOffsetMax), inside)
    offset(rand(BlgOffsetMin, BlgOffsetMax), border)


or just go for the comp(f) {}


ok ?

matt
0 Kudos
MilosVajdic
Emerging Contributor
Hi matt,
Do I use comp(f) on my Building part of the Lot or on the original Lot before splitting?
If I use it to replace the "extrude Building" formula all I get is this:
[ATTACH=CONFIG]34807[/ATTACH]
This is what I did for Lot:

Lot -->

setback(rand(4,10)) { street.front : Garden | street.back : Garden | remainder : Building }


Garden --> color("#00ff00")

attr BlgOffsetMin = -1
attr BlgOffsetMax = -2.5
attr BlgExtrMin = 3
attr BlgExtrMax = 9

Building-->
 offset(rand(BlgOffsetMin, BlgOffsetMax))
 comp(f) {inside: extrude(world.y, rand(BlgExtrMin, BlgExtrMax)) | all : extrude(0.1)}
 
 
 
OffsetLot  --> comp(f) { inside: Footprint }
Footprint --> extrude(60) 
    


Am I supposed to use the comp(f) on the Lot prior to splitting it into Garden and Building parts?
0 Kudos
MatthiasBuehler1
Deactivated User
no, the comp() is in the right place ..

does this code help ? :

( did not check the code, may contain errors.)


Lot -->
    setback(rand(4,10)) { street.front : Garden | street.back : Garden | remainder : Building }

Garden --> color(1,0,0)

attr BlgOffsetMin = -1
attr BlgOffsetMax = -2.5

Building-->
    offset(rand(BlgOffsetMin, BlgOffsetMax))
    comp(f) {inside: BuildingFootprint  | all : Base }
 

attr BlgExtrMin = 3
attr BlgExtrMax = 9
BuildingFootprint  -->
    extrude(world.y, rand(BlgExtrMin, BlgExtrMax))

Base -->
    extrude(0.1) 


If this does produce what you need, please provide an image of what you want to reach. 🙂

matt
0 Kudos
MilosVajdic
Emerging Contributor
🙂 he he he,
it works beautifully 🙂

Thanks Matt.
Let me try and explain what I'm up to.
Our architectural company does a few animations now and again for larger rail infrastructure projects.
we do animations like this:
https://www.youtube.com/watch?v=tYBezHzobFk
Since we didn't know of cityengine and its amazing features and support staff we modeled every building in sketchup, we modeled every road by tracing it in CAD and then extruding in sketchp, took a lot of time and result was average. SOmetimes we just used Googlemaps image since we ran out of time.

Before we get another large animation project like this, I am experimenting with cityengine to see if we can get similar or better city modeling.
My experiment so far has been promising but lack of coding knowledge and lack of knowledge of all possible functions that the program can use is limiting me in my experiments.


So far, with your help I have this:
[ATTACH=CONFIG]34828[/ATTACH]

Question 1- Building is split into Inside and Base. Is there a way to remove Base (marked in yellow color) or at least join it with Garden? I can always make it same texture and just leave as it is, just trying to conserve polygons 🙂
Question 2- Right now my random offset for front and back garden is the same due to the formula I'm using. Is there a way to have one random element for front and another set of random values for back garden? I tried and failed.

This is so close to what we need it for it is ridiculous 🙂
0 Kudos
MatthiasBuehler1
Deactivated User
hey !

you modeled all this in SketchUp ? (poor bastards .. hehe) 🙂
very cool animation, congrats !!


well, there's no other software better suited to your needs than CE.

did you carefully study the CGA tutorials ? I highly recommend you go through tutorials 1,2,3,6,7,8,9 IN DETAIL.

when you understand these tutorials, you will be able to create stunning cities.

yes, it takes time to learn CGA. It takes you about 3 weeks with 60% of your work time to get into the basics. But once you have those, you will be massively faster than with SketchUp and have a constant modeling quality over the whole city.

let me know if there's more questions after you studied the tutorials carefully, have taken at least 5 hours to read through the crucial parts of the manual and deeply studied the CGA reference.

let me know if you hit roadblocks [ railroad-blocks 🙂 ]

matt
0 Kudos