|
POST
|
This means that there is something already in the scene (or there was something in the scene). Once something is put into the scene, the coordinates are set accordingly. (Option 0) Try starting with a brand new scene. Then, import the map data. Option 1: Or, if you have stuff in a scene that you want to move to another location, you can select all the objects in the scene and move them using the move tool in the toolbar and by typing the amount you want to move. You'll have to calculate this amount. To calculate the amount you need to move the shapes, first, turn on the navigation display (drop down arrow next to settings icon in viewport toolbar). Then, switch to CityEngine coordinates (same drop down as before -> View Coordinate System -> CityEngine CS). Move the mouse over a shape in your scene and note its coordinates that appear in the navigation display at the bottom of the viewport. Make a new scene and import OSM data from the desired city. Using the same procedure as above, find the coordinates of a shape in this scene. Then, subtract the first shape's coordinates from the city shape's coordinates to get the move amount. Once you've moved the contents of your first scene, you'll have to export it as a CEJ (File -> Export -> CityEngine -> Export selected objects as .cej file) and import it into the second scene which contains the map data. Option 2: If you know the coordinate system you want, you can set it directly using Edit -> Preferences -> Scene -> Scene Coordinate System. However, setting the coordinate system will not move the current objects in the scene, so you'll have to move them to within the valid bounds of the new coordinate system. Use the procedure from Option 1 to move the contents.
... View more
03-21-2017
09:20 AM
|
2
|
0
|
900
|
|
POST
|
In addition to extruding in the negative direction, one could also translate in the negative direction and extrude in the positive direction. When extruding in the negative direction, I think normals might be reversed (but in some cases one might not care about that). This means that the textures on the side walls may look different from the result you would get if you translated and extruded in the positive direction.
... View more
03-21-2017
08:48 AM
|
0
|
0
|
1184
|
|
POST
|
If you need to know the positions of the buildings relative to the world, you could also convert scope coordinates to world coordinates using convert() (but using split.index is easier). convert Function
... View more
03-21-2017
08:25 AM
|
0
|
0
|
1431
|
|
POST
|
I'm not entirely sure what you mean by spatial relationships, but in your example, I think you want some houses to have gable roofs and some to have shed roofs depending on their position in the world. This you can accomplish by converting scope coordinates to world coordinates with the convert() operation. convert Function In general, knowing information about other shapes is currently difficult and limited in CGA. There are the occlusion queries that allow you to detect if something intersects/touches another shape, but currently, that's about it. Occlusion Query Functions Python may provide more options for this. For example, it is possible to get a list of shapes in the scene and get their positions.
... View more
03-21-2017
08:00 AM
|
0
|
0
|
774
|
|
POST
|
There are some street lamp assets in the Philadelphia Redevelopment example in the folder assets/streets/lamps/. This example is downloadable through CityEngine (Help -> Download Tutorials and Examples).
... View more
03-21-2017
07:43 AM
|
1
|
0
|
1564
|
|
POST
|
I'm not sure the second piece of code with p() actually does the same thing as the first piece of code. In the second piece of code, the case statements are run through sequentially, which the second case statement is only reached if the first case statement fails. Consider the following example. Let's say we want our result to be: 30%: A. 20%: B. 10%: C. else: D. I don't think the following is a replacement for the above: case p(0.3): A. case p(0.2): B. case p(0.1): C. else: D. because the second statement will only be reached if the first statement is false. The chance that the first statement is false is 0.7. When considering the combination with the first statement, he second statement's code (B) will be evaluated with probability 0.7*0.2. Then, the third statement's code (C) has probability 0.7*0.8*0.1 of being reached. I think that's how it would theoretically work, but you can write tests to evaluate it and see if this does happen. Workaround: Here's a workaround for the above example. You could pick a random number in [0,1] and based on its value, choose to evaluate the appropriate case statement. This way, you can vary the attributes a, b, and c which control the percentages. attr a = 0.3 attr b = 0.2 attr c = 0.1 Rule1 --> Rule2(rand(0,1)) Rule2(x) --> case x<a: A. case x>=a && x<a+b: B. case x>=a+b && x<a+b+c: C. else: D.
... View more
03-21-2017
07:01 AM
|
1
|
2
|
1321
|
|
POST
|
Yes, Get Map Data is available in the trial version, which is the Advanced version of CityEngine. You will also need an ArcGIS Online account. With the free public account, there is access to the basemaps and the OpenStreetMap data. However, to access the elevation data, an organizational account for ArcGIS Online is required. Trial access for this can also be obtained if elevation data is desired. Get map data from ArcGIS Online / Portal
... View more
03-20-2017
11:28 AM
|
0
|
0
|
791
|
|
POST
|
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.
... View more
03-20-2017
10:56 AM
|
1
|
1
|
1291
|
|
POST
|
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
... View more
03-20-2017
10:44 AM
|
1
|
0
|
1291
|
|
POST
|
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.
... View more
03-20-2017
10:31 AM
|
1
|
0
|
1291
|
|
POST
|
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.
... View more
03-20-2017
10:08 AM
|
1
|
0
|
1291
|
|
POST
|
4. Yes, you can unassign rules. In the Inspector, delete the text in the Rule File and the Start Rule fields.
... View more
03-20-2017
10:00 AM
|
1
|
0
|
1291
|
|
POST
|
Could you please provide a screen shot and step by step instructions on how you got to the screen shot so that we can try to reproduce it? Did you start with a new scene? Please also include the version of CityEngine that you are using.
... View more
03-20-2017
09:57 AM
|
0
|
0
|
3627
|
|
POST
|
That should work, but if you want to get smaller numbers than typically present in seedian values, then here's another workaround. You could select all your lots, export them to a FileGDB (File -> Export Models), and then import the gdb into a scene (find file in models folder -> drag file into scene). Exporting as a GDB automatically creates a unique object attribute called OBJECTID on each shape (see Object Attributes section in Inspector). Then, you can link a rule attribute to this object attribute by either creating an attribute called OBJECTID and linking the attribute (in Inspector, click on drop down next to attribute -> Connect Attribute-> Object Attribute) or by linking an attribute of any name to the OBJECTID (Inspector -> click on drop down next to attribute -> Connect Attribute -> Layer attribute). However, the latter might not directly work in 2016.1 due to a known bug. To make the second option work in 2016.1, you'll have to create a temporary object attribute with the same name as your rule attribute, then try to connect the attribute to OBJECTID through the layer attribute, and then go back and delete the object attribute with the same name as your rule attribute.
... View more
03-20-2017
09:25 AM
|
0
|
0
|
465
|
|
POST
|
The comp split takes each side face and calls the rule Sides(counter) where counter=2, so for each side face the value of counter starts at 2, and the rule is applied independently to each side face, so counter will be increased to 3 for each side face. In the Model Hierarchy (Window -> Show Model Hierarchy -> select object in Viewport), you can see the shape tree. Before the comp, there is one shape. At this point in the shape tree, the code sets counter=2. Then, the comp split creates four side faces represented by the nodes called Sides. These side faces are independent of each other. Each of the side faces gets the value counter=2 and increases it to 3. -> Attributes in CityEngine do not act like global static variables. They can be set anywhere in the shape tree, and calling set in one rule only affects the value of that attribute in the shape generated by that rule and it's children. -> Sibling shapes are independent of each other. This means, a shape will not know what its sibling shape has for the value of counter. The inspector shows the rule default as set by the rule or what the user sets the attribute to. (Or, it shows the value it was set to through other links like layer or object attributes.) Calling set in the rules only changes the attribute value for that particular shape in the shape tree and its descendants, and these values are not shown in the Inspector because different shapes in the shape tree can have different values for the same attribute. Perhaps comp.index and/or comp.total would help you count the sides. comp Shape Attribute There is also a similar way to count components from a split using split.index and split.total. split Shape Attribute
... View more
03-20-2017
09:00 AM
|
0
|
0
|
1025
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-14-2022 07:18 AM | |
| 1 | 06-22-2020 04:54 AM | |
| 1 | 02-17-2020 03:10 AM | |
| 1 | 07-03-2023 03:37 AM | |
| 1 | 06-07-2023 05:26 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-19-2023
12:40 PM
|