|
POST
|
Starting with CityEngine 2019.0, the plant models are not included in the installer (to avoid taking up a lot of space in the installer package as we increase our 3D model asset library). They are now downloadable along with other 3D models through File -> Manage ESRI.lib -> Webstyles/Vegetation. The plant rules in ESRI.lib have also been updated to work with the new file structure and gltf format. See also: https://community.esri.com/message/854679-cityengine-2019-missing-plant-library
... View more
08-08-2019
08:25 AM
|
1
|
0
|
1028
|
|
POST
|
getObjectAttr() does not work in cga rule files. It is meant to only work in layer attribute code, which you can see in the Inspector when selecting a layer. Code can be manually entered here, but it is more likely that it will be automatically entered here when connecting rule attributes to layer attributes. L R's suggestion is a good way of getting values from an object attribute into a rule attribute with a different name. I would go with this. However, I want to describe another method so that I can give an example of how getObjectAttr is used. Another way of doing this would be to connect your rule attribute to the object attribute through the layer. Click on the drop down box next to your rule attribute in the Inspector and select Connect Attribute. Then, connect through a layer attribute, and select the layer and name of the object attribute. Then, if you select the layer, you'll see that the Layer Attributes section in the Inspector contains the code: attr a = getObjectAttr("b") Note: getObjectAttr() will most likely be deprecated soon to be replaced by separate functions for floats, strings, and bools. The above automatic behavior is expected to work, but the code generated will use the new functions instead of the deprecated one.
... View more
08-08-2019
07:59 AM
|
0
|
0
|
4723
|
|
POST
|
Where did you get this scene file and cga file? Your particular scene file and cga file may be designed to be used with a 2018 version since I see 2018 in the scene file name. However, we did not add support for gltf and glb files until CityEngine 2019.0.
... View more
08-08-2019
06:29 AM
|
0
|
0
|
1800
|
|
POST
|
I would recommend starting with street shapes since they have UVs that curve with the street as it curves to the left and right and goes up and down hills. If you want to design your own rules, you could use operations like split in uv space (i.e. split in v to split along the street; split in u splits across the street) and insertAlongUV to maintain the curved nature of the streets. Make your own asset to use with insertAlongUV by exporting your own creation to obj. Using alignScopeToAxes(y) before inserting the object would make sure the asset is extruded upwards, which would mean that you could avoid those disconnecting cuts you get between the hilly segments. This would also mean the hilly segments would get sheared assets, but maybe this is ok for you. split operation—CGA | ArcGIS insertAlongUV operation—CGA | ArcGIS Alternatively, you could apply the rule ESRI.lib/rules/Fences/Fence_On_Graph.cga to your street shape. The tapered base asset in ESRI.lib/assets/Fences/Objects/taperedBase.obj looks similar to your first image. Try setting the style to Jersey_Barrier and then changing the attr baseMiddle_asset to the tapered base asset. You could also make your own assets to use in this rule. Here's what the fence styles look like:
... View more
08-08-2019
06:17 AM
|
1
|
1
|
7316
|
|
POST
|
The special streetWidth attribute code attr streetWidth(i) = 0 will only work if the shape has an object attribute called streetWidth[] which is an array of floats. This object attribute is automatically generated on dynamic shapes (shapes created by graph networks). This object attribute does not inherently exist on non-dynamic shapes, but it can be created using Shapes -> Compute First/Street Edges. https://doc.arcgis.com/en/cityengine/latest/help/help-shape-edge-tools.htm
... View more
05-29-2019
12:06 AM
|
1
|
0
|
4558
|
|
POST
|
In 2019.0, you can create custom edge attributes manually in the Inspector by adding new object attributes. Edge attributes must have the prefix /edgeattr/. When creating an edge attribute, choose an array type (BOOL[], FLOAT[], or STR[]) and enter in as many values as you have edges, and terminate each value with a semicolon. After the edge attribute has been created, you can also change a value for an edge in the Inspector by selecting the individual edge. For example, if I had a triangle shape and I wanted to create an edge attribute for the color of each edge, I would create the following edge attribute. Edge attributes can also be created using Python using ce.setAttribute. On non-dynamic shapes (shapes not created by street networks), you can calculate edge attributes for each shape using the built in menu option (Shapes -> Compute Edge Attributes). This uses the nearest streets to calculate information like /edgeattr/orientations, /edgeattr/streetcategories, and /edgeattr/streetwidths. https://doc.arcgis.com/en/cityengine/latest/help/help-compute-attributes.htm In CGA, you can access these edge attributes using edgeAttr.getFloat(), edgeAttr.getString(), edgeAttr.getBool(). https://doc.arcgis.com/en/cityengine/latest/cga/cga-edge-attr-function.htm In the triangle example above, I could color the edges of the triangle using edgeAttr.getString("color"). comp(fe) { all: color(edgeAttr.getString("color")) primitiveCube s('1, w, w) center(yz) Edge. }
... View more
05-17-2019
06:31 AM
|
0
|
0
|
562
|
|
POST
|
No, the streetWidth attribute is a special case. See this post: https://community.esri.com/message/722386-re-designate-multiple-street-edges?commentID=722386&et=watches.email.outcome#c…
... View more
05-17-2019
02:52 AM
|
1
|
4
|
4558
|
|
POST
|
In 2019.0, the new comp function (the existing comp operation co-exists with the new comp function) allows you to access attributes for each edge by returning an array, with one element per edge. You can use comp to get an array of edge lengths. getEdgeLengths = comp(fe) { all: scope.sx }
Lot -->
print(getEdgeLengths)
print(size(getEdgeLengths)) // size of array
print(getEdgeLengths[0]) // element at index 0
print(index(getEdgeLengths, 10, 0.1)) // index of first occurrence of value=10 with eps=0.1
https://doc.arcgis.com/en/cityengine/latest/cga/cga-comp-function.htm Here are the help pages to get array info like size, item, index: https://doc.arcgis.com/en/cityengine/latest/cga/cga-size-function.htm https://doc.arcgis.com/en/cityengine/latest/cga/cga-item-operator-function.htm https://doc.arcgis.com/en/cityengine/latest/cga/cga-index-function.htm For more examples, check out how comp is used to when definining dists in the examples on the help page for the setback operation. https://doc.arcgis.com/en/cityengine/latest/cga/cga-setback.htm Your above approach doesn't work because shapes created from a comp do not know about each other. Let's say you have 4 edges. The comp will create 4 different shapes in the shape tree, one for each edge, and these shapes do not know about each other. The code in the Edges rule is run 4 times, once for each edge, but these are run independently of each other; they do not build on each other sequentially.
... View more
05-15-2019
03:31 AM
|
0
|
0
|
1357
|
|
POST
|
In 2019.0, the new operation setbackPerEdge() allows you to create a setback with different setback distances on each edge. It takes as input a function that specifies the setback distance per edge. The function is evaluated per edge, and comp and scope attributes are accessible within this function. https://doc.arcgis.com/en/cityengine/latest/cga/cga-setback-per-edge-operation.htm This code creates a setback where the setback distances are equivalent to the street width on each edge. attr streetWidth(i) = 0
myFunc = streetWidth(comp.index)
Lot -->
setbackPerEdge(myFunc) { all: Green | remainder: Red }
... View more
05-15-2019
02:15 AM
|
0
|
9
|
4558
|
|
POST
|
I can't tell what the problem is, but if your object should be rotated 180 degrees, then use the r() operation to rotate it. https://doc.arcgis.com/en/cityengine/latest/cga/cga-r.htm Hint: You can use the Model Hierarchy (Window -> Show Model Hierarchy -> Inspect Model -> click on shapes) to view the scope of your shapes at any point in the shape tree. This will help you determine which axis you need to rotate around.
... View more
05-09-2019
08:18 AM
|
2
|
0
|
2237
|
|
POST
|
Occlusion queries are performed with a two pass generation which means we run through the code twice. In general, on the first pass, the code is evaluated such that the occlusion query functions inside, overlaps, and touches return false. This generates a shape tree. The geometries in this shape tree become possible occluders for the next pass. Then, on the second pass, the occlusion query functions are tested against the shapes that were generated in the first pass. When evaluating the occlusion query touches, we ask if the current shape touches closed shapes that were generated in the first pass. The geometry generated in the second pass is the final result. https://doc.arcgis.com/en/cityengine/latest/cga/cga-context-queries.htm
... View more
05-09-2019
06:56 AM
|
0
|
0
|
2074
|
|
POST
|
You can split your parcel shape into a grid of building footprints and use geometry.isRectangular to discard the ones that are not rectangular. Parcel -->
split(x) { { ~spacing: NIL
| width: ParcelSlice }*
| ~spacing: NIL }
ParcelSlice -->
split(z) { { ~spacing: NIL
| width: TestFootprint }*
| ~spacing: NIL }
TestFootprint -->
case geometry.isRectangular(0.1):
Footprint.
else:
NIL
https://doc.arcgis.com/en/cityengine/latest/cga/cga-split.htm https://doc.arcgis.com/en/cityengine/latest/cga/cga-geometry-function.htm#ESRI_SECTION1_7DBA4E7E8618412EAFD572CFA19B17E3 If you want an aligned grid, use the noAdjust option in the split.
... View more
05-09-2019
05:24 AM
|
1
|
0
|
1377
|
|
POST
|
1) It seems like you want roofHip() for the rear part and roofGable() for the front part. Maybe you could make both roofs, split them in half, and use the gable roof for the first half and the hip roof for the second half. 2) You could use comp(v) to get the vertices and insert primitive cubes there. CreateCornersFromMass -->
comp(f) { bottom: comp(v) { all: Vertex } }
Vertex -->
alignScopeToAxes(y)
primitiveCube
s(w, h, w)
center(xz)
r(scopeCenter, 0, 45, 0) Or, you could just insert primitiveCubes, use t() and r() to position them and rotate them. You could use scope.sx and scope.sy to get the current scope's size. 3) You can handle conditions using case statements to test attribute values. case orientation=="East":
... // insert code to create church facing East
case orientation=="West":
... // insert code to create church facing West
else:
... // insert code to create church facing default direction
... View more
05-08-2019
06:01 AM
|
1
|
0
|
1508
|
|
POST
|
const asset_sx = assetInfo(asset, sx)
const asset_sz = assetInfo(asset, sz)
Lot -->
InsertAsset(min(scope.sx/asset_sx, scope.sz/asset_sz))
InsertAsset(factor) -->
i(asset, yUp, keepSizeAndPosition)
s('factor, 'factor, 'factor)
center(xz)
... View more
05-08-2019
04:46 AM
|
0
|
0
|
1363
|
| 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
|