City Engine study clarifications Manual/Tutorial

897
6
02-23-2017 01:17 AM
MihaiAtofanei
New Contributor II

Hy there,

 

 My name is Mihai, I have been for the past two months getting acquainted with CE, we are  trying to implement it in our urbanism projects, and as I go deper into the reading/studying I find that I am missing some concepts along the way, that confuses me a bit, while I am trying to understands how all this works.

This being said I have a few questions that I have and an answer or a resource that could clarify these question will be appreciated:

 

  1. Map Layers- especially the Obstacle Map layer, how are they created (I have seen the interface from CE) but my question is what type of data do you use to build a Map Layer, a practical case where it was used will be very helpful.

    Ex. If you have a urbanism regulation that says your are allow to build in a specific array of heights..how would one use this info to put it in a map layer to be used when developing urban areas?

 

  1. Atribute Sources and Display- what is the difference between Object/Shape/Layer attribute? I understand how a attribute is defined in the rule and then is displayed in the Inspector and you can change from there, but I don't understand how the 3 sources presented above are "baked" into the Inspector view 

     A practical example from your experience would help.

 

  1. lowHeight= 50%: 0.4 else: 0.6

   attr floorheight = rand(4, 5)

RecursiveSetbacks -->

case scope.sy > 2 * floorheight :

split(y){ 'lowHeight : Mass | ~1: Setback } else: s('1, floorheight, '1) Mass

   In this case what would be the difference between the lowHeight -attribute and the floorheight attribute?

 

    This is from Turorial 8 : Mass Modeling-http://desktop.arcgis.com/en/cityengine/latest/tutorials/tutorial-8-mass-modeling.htm

 

  1. If you assign a rule to a shape is there a possibility to "unassign" it?

 

  1. I have encountered the follwing terms : function/rule/command, What is the difference between them?

 

I will stop here for now, cheers in advance for any leads.

 

Mihai A.

Tags (2)
0 Kudos
6 Replies
CherylLau
Esri Regular Contributor

4.  Yes, you can unassign rules.  In the Inspector, delete the text in the Rule File and the Start Rule fields.

CherylLau
Esri Regular Contributor

5.  A rule in the context of CGA code is code in the form of A --> B where A is the rule name, and when A is called somewhere, the set of operations B will be executed.  More generally, a rule can also refer to a rule file which contains CGA code (and thus contains CGA rules).  This is what is referred to when assigned a rule to a shape.

In CGA code, functions can also be used.  If you call a function (by writing it's name and passing the appropriate parameters), it will return a value which is specified where the function is defined.  For example, the math function abs(x) will return the absolute value of x.  Functions available for use in CGA code can be found near the end of this reference page:

CGA Reference Index 

I don't know what you mean by command.  I would have to see it in context.

CherylLau
Esri Regular Contributor

3.  lowHeight is not an attribute because it doesn't have the keyword attr before it.  It just means that when lowHeight is called, it's definition is executed, so it's like a function.  When lowHeight is called in the split, it is replaced with the value 0.4 or 0.6.  There is a 50% chance it will be 0.4 and a 50% chance it will be 0.6.  Let's say in one case, lowHeight is set to 0.4.  This means that the tower mass is split so that the bottom half of the tower is 0.4 times the height of the mass.  Then, the top half is made smaller in x and z (height is not touched) and the rule is recursively applied to the top half until the mass that is leftover has a height less than two floors.  The attribute floorheight is a random value between 4 and 5, and in this rule, it represents the height of the topmost floor.  When the recursion ends, the last piece of mass is scaled so that it's height is equal to this attribute floorheight.

CherylLau
Esri Regular Contributor

2. In the Inspector, if you click on the drop down arrow next to an attribute field, there is the choice Connect Attribute.  Here, you can connect your rule attribute to another source so that the attribute get its value from this other source.  Other sources include, Object Attributes, Shape Attributes, and Layer Attributes.

Object Attributes are attributes that can belong to a shape.  You can define these however you want.  You can also import them.  Shape Attributes are special attributes with specific names that only exist on shapes related to street networks.  Layer attributes can have values that come from different layers in your scene.  You can connect to a layer attribute to get the value of something at the same xz coordinate as the shape with your rule.  The reference page has more details:

Mapping Attributes 

CherylLau
Esri Regular Contributor

1.  The obstacle map layer and other map layers come from images where pixel values indicate the important information which is interpreted in CityEngine.  These layers are generally created outside of CityEngine perhaps in an image editing software like Photoshop or Gimp.  In some cases, perhaps GIS related data such as height maps could be exported from GIS software like ArcMap.

MihaiAtofanei
New Contributor II

Cheryl, thank you very much for the clarification, it definitely shed some light in these areas!

0 Kudos