|
POST
|
You can import your building rule files into a master file. The master file can then decide which rule to call. import rule1:"rule1.cga"
import rule2:"rule2.cga"
import rule3:"rule3.cga"
@Enum("type1", "type2", "type3")
attr building_type = "type1"
Lot -->
case building_type=="type1": rule1.Generate
case building_type=="type2": rule2.Generate
else: rule3.Generate
... View more
05-07-2019
07:48 AM
|
0
|
0
|
652
|
|
POST
|
There is an easier way to create a chimney on top of a roof. Occlusion is not necessary. Instead, you could comp the top of the roof, split out a section for the chimney footprint, insert a cube, and resize it. Roof -->
roofGable(45) Roof.
comp(f) { top= CreateChimney }
CreateChimney -->
alignScopeToAxes(y)
split(x) { ~1: NIL
| w: split(z) { ~1: NIL | w: Chimney | ~1: NIL }
| ~1: NIL }
Chimney -->
primitiveCube
s('1, h, '1)
... View more
05-07-2019
06:57 AM
|
2
|
2
|
2075
|
|
POST
|
Adding the axis world.y as an optional parameter to minimumDistance() wouldn't be sufficient to solve your problem if the result were to use the y component of the vector between two objects. For example, if the neighboring building has a short podium, and the current shape has a tall podium, then the neighboring building's podium roof could be closer (smaller y component) to the initial shape than it's own podium's roof. What would be desirable is to find the distance to an object which is in a certain direction, namely in world.y, from the initial shape. This is probably what you meant, and we don't have a operation for that yet, but we'll keep it in mind for the future. Thanks for the suggestion. Maybe there is a workaround that would work for you. If you could label your roof shapes with some sort of identifier, then your tower shape could query the minimum distance to the exactly the right shape. You could add initialShape.origin to the label name when creating the label on the podium roof. If you could create your shapes so that the have unique names, and so that those unique names match for corresponding shapes in your two layers, then you could use initialShape.name. Even better would be if you had an attribute that you could access that is unique for each building. Just append this value to your label. If using initialShape.origin, it might be good to round to the nearest integer. This is not an ideal solution. Out of the three, the best would be if you had a unique building identifier in an attribute on your shapes. label("roof_" + rint(initialShape.origin.x) + "_" + rint(initialShape.origin.z))
label("roof_" + initialShape.name)
label("roof_" + myBuildingID) initialShape Shape Attribute
... View more
05-06-2019
06:06 AM
|
2
|
1
|
1368
|
|
POST
|
I can't reproduce it. I assume you created the original cga file in CityEngine, and the umlaut is in a comment or string value (since rules and attributes can't have umlauts). How did you perform the copy? I did a Ctrl-C, Ctrl-V on the file in the Navigator, and the characters with umlauts are ok for me when I open the copy.
... View more
05-06-2019
01:45 AM
|
1
|
1
|
963
|
|
POST
|
The above python code changes the width of a street segment (graph segment) by setting the built-in street parameter streetWidth. To set the color of the roof in your building rule, you'll probably want to work with shapes, not graph segments. In your scene, you could apply your building rule to some shapes. The cga rule could have an attribute for roof color. @Color
attr roof_color = "#ffffff" In the cga code, use the *color()* operation to set the color of the roof based on the attribute value. color(roof_color) color Operation To use python to set the value of the rule attribute for the roof color, the python script should create an object attribute with the same name as the rule attribute (roof_color) and then assign the building rule file to the shape. Once the rule is assigned, rule attributes will be automatically connected to object attributes with the same name. ce.setAttribute(shape, 'roof_color', '#ff0000')
ce.setRuleFile(shape, 'building_rule.cga')
... View more
05-03-2019
07:48 AM
|
2
|
0
|
897
|
|
POST
|
First, export your shapes from Pro so that when they are imported into CityEngine, the shapes have object attributes for the data shown in your table. Then, you can create a rule attribute called Rule2_face similar to how you created one for buildhei_5. attr rule2_face = 0 Since the rule attribute has the same name, it will automatically connect to the object attribute with the same name when you assign the rule file to the shape. You can also manually connect the rule attribute to the object attribute by clicking on the drop down arrow next to the attribute in the Inspector and selecting Connect Attribute. The rule attribute has to have the same name as the object attribute. Mapping Attributes with Connection Editor
... View more
05-03-2019
05:58 AM
|
0
|
0
|
880
|
|
POST
|
Using world.xz would be the way to set up the projection, but unfortunately when the scene contents are far away from the origin, there are some problems with floating point precision. This is why you get the results above. With setupProjection(0, world.xz, 4, 4), the texture is blurry. Adding an offset in setupProjection(0, world.xz, 4, 4, 525363, -5221099), fixes the blurry textures, but the textures are discontinuous. (Offset numbers are taken from your screenshot). While we investigate the problem and see if we can fix it, there is a not-so-nice workaround to get continuous textures on the street shapes which are far away from the scene origin. This workaround imposes some limitations though (e.g. no more dynamic shapes, no more separate shapes). Convert the street shapes to static shapes (Graph -> Convert to Static Shapes) Combine the shapes into a single shape (Shapes -> Combine Shapes) Apply setupProjection using scope instead of world.
... View more
05-03-2019
05:15 AM
|
0
|
0
|
991
|
|
POST
|
What Devin is suggesting requires even simpler code, and I would recommend doing this over the polygon option since it eliminates the need for the comp(). If you set the street width to your desired edge width, then you can also skip the resizing and centering bit. Using extrude() instead of primitiveCube() is also an option if you want to control the height of your edge. Extrude will handle curvy streets better. Street -->
extrude(edge_height) # or: primitiveCube()
color(1,0,0)
... View more
05-03-2019
12:54 AM
|
0
|
0
|
1732
|
|
POST
|
If you can import your shape as a polygon (instead of polyline), then you can apply a cga rule to it which only colors the edges by using the comp operation to get the edges. You can hide the shapes (F11 or in viewport menu) so that you don't see the imported polygon face. const edge_width = 0.2
ColorEdges -->
comp(e) { all: Edge }
Edge-->
primitiveCube
s('1, edge_width, edge_width)
center(yz)
color(1,0,0)
... View more
05-02-2019
04:03 AM
|
2
|
2
|
1732
|
|
POST
|
CityEngine 2018.x System Requirements CityEngine 2018.x system requirements—Esri CityEngine | ArcGIS Desktop
... View more
11-27-2018
05:37 AM
|
0
|
0
|
1393
|
|
POST
|
Get Map Data downloads what is available in OpenStreetMap. If it doesn't exist in OpenStreetMap, then it won't exist through Get Map Data either. These footprints don't exist in OpenStreetMap as indicated by the second image I posted.
... View more
11-09-2018
07:15 AM
|
0
|
0
|
1326
|
|
POST
|
Data and Maps http://maps-semcog.opendata.arcgis.com/
... View more
11-09-2018
03:46 AM
|
0
|
1
|
1326
|
|
POST
|
The Southeast Michigan Council of Governments (SEMCOG) supports local planning through its technical, data, and intergovernmental resources. The work SEMCOG does improves the quality of the region's water, makes the transportation system safer and more efficient, revitalizes communities, and spurs economic development. About SEMCOG
... View more
11-09-2018
03:44 AM
|
0
|
0
|
1326
|
|
POST
|
When I try those exact bounds, I am able to get building footprints (shown in blue), and they match the available data on OpenStreetMap, so I don't think I'm missing any footprints. Do you not get the footprints in blue below? Here's what's available on OpenStreetMap (building footprints are dark gray):
... View more
11-09-2018
03:41 AM
|
0
|
2
|
1326
|
|
POST
|
Here is an example. 1) Create a map with red (1,0,0) in areas you want the type "Highrise Building" and green (0,1,0) in areas you want the type "Residential". 2) Add map layer to scene following instructions in Tutorial 3, Section "Control the Skyline", steps 1-10. Instead of adding the attribute called skylineValue, add an attribute called myRedValue for the red channel and an attribute called myGreenValue for the green channel. For both attributes, the min and max are [0,1]. 3) In the International City.cga rule, change the definition of getType and add two attributes: attr myRedValue = 0
attr myGreenValue = 0
# Constants
const getType =
case myRedValue==1: "Highrise Building"
case myGreenValue==1: "Residential"
else: "Open Space"
4) Select all lots and in the Inspector, connect the attributes myRedValue and myGreenValue to the desired layer attributes (the ones we created with the same name). Steps 13-15 in Tutorial 3.
... View more
11-07-2018
08:03 AM
|
1
|
1
|
2329
|
| 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
|