POST
|
Hello @ChrisKo3 Thanks for reaching out with your question! That's a tricky one, indeed. When dealing with such challenges, you could gradually increase the Segment Width by partitioning the segment. In case of asymmetric lane distributions, as in this example, also adjust the Segment Offset. To smoothen out the transition in the Joint Nodes, set the Curb Radius to the max value of 10.
... View more
07-09-2025
03:56 AM
|
0
|
0
|
128
|
IDEA
|
Thank you @romainjanil for bringing up this topic. You want to have more control over the triangulation algorithm that is used for generating models. So far there are no plans to offer this. But, the upcoming release of CityEngine 2025.0 comes with many improvements for the boolean 3D operations, including better cleanup of the resulting shapes. This also affects the triangulation. The triangulation of Initial Shapes for rendering in the CE viewport is not the same as the triangulation used for creating models. If there are differences, it's recommended to hide the Initial Shapes. Can you please give more insights, why you need to apply a specific triangulation algorithm for generating Models?
... View more
06-11-2025
07:27 AM
|
0
|
0
|
129
|
POST
|
Hello @JackCurran1 Have you tried to adjusted the base colour in 3ds Max areal image texture like this: color_new = pow(color_old, 1 / 2.2) It will impact the multiplier on the material in CityEngine. If this doesn't give the expected result, it would be good to analyze the aerial imagery texture.
... View more
04-04-2025
02:40 AM
|
0
|
0
|
255
|
POST
|
Thanks for your feedback. Great that you managed to resolve the your question. To make my example rule work, the parcel shape requires the attribute edgeattr/orientations set by the Compute Edge Attributes tool.
... View more
03-12-2025
06:20 AM
|
0
|
0
|
350
|
POST
|
As an example, you can first obtain the orientations of a parcel shape with the Compute Edge Attributes tool. Then, the following rule lets you define a maximum building coverage ratio and setback distances per side. In case the maximum coverage is smaller then the remainder of the setbackPerEdge operation, the front setback is increased by the setbackToArea operation (dark blue area). version "2024.1"
const lotArea = geometry.area
@Description("Maximum ratio of footprint to parcel area") @Percent
attr area_ratio = 0.5
@Description("Minimum street setback") @Distance @Range(min=0, max=15)
attr setback_front = 5
@Description("Excact side setback") @Distance @Range(min=0, max=15)
attr setback_side = 10
@Description("Excact rear setback") @Distance @Range(min=0, max=15)
attr setback_rear = 15
dist(orientation) = case orientation == "front" : setback_front
case orientation == "side" : setback_side
case orientation == "rear" : setback_rear
else : 0
@StartRule
SetbackPerEdge --> setbackPerEdge( dist( edgeAttr.getString("orientations") ) )
{ edgeAttr.getString("orientations") == "front" = Grey
| edgeAttr.getString("orientations") == "side" = Yellow
| edgeAttr.getString("orientations") == "rear" = Green
| remainder = SetbackToArea }
SetbackToArea --> setbackToArea(lotArea * area_ratio)
{ edgeAttr.getString("orientations") == "front" = Blue
| remainder = extrude(10) Cyan }
... View more
03-06-2025
12:49 AM
|
0
|
2
|
401
|
POST
|
Hi @Neri12 , Welcome to the ArcGIS CityEngine Community. 😊 To give you an advice, it would be very helpful, to have a screenshot and some snippets of your CGA code. General information: the setbackToArea operation allows you to define the built up area vs. the free part ratio of a lot. the setbackPerEdge operation allows you to define a setback distance per edge.
... View more
03-05-2025
07:47 AM
|
0
|
0
|
407
|
POST
|
Hi @KennethLindhardt1 Have you tried using CGA to report the spherical latitude/longitude coordinates (WGS84) of the scope's origin with the getGeoCoord function? Tutorial 12: Scripted report export—ArcGIS CityEngine Resources | Documentation then shows you how to write out a file with positioning info for each exported Model.
... View more
02-27-2025
06:01 AM
|
0
|
0
|
529
|
POST
|
Hello @bhusalshishir Here is CGA code that creates a primitiveDisk and then uses the offset operation to hollow it out. Then the extrude operation gets applied on the annulus to form a culvert. Finally, the setNormals operation is used to set the normals of the inner and outer mantle to soft. version "2024.1"
@Description("Inner diameter") @Distance @Range(min=0.1, max=5)
attr diameter = 1
@Description("Culvert length") @Distance @Range(min=0.1, max=20)
attr length = 2
@Description("Wall thickness") @Distance @Range(min=0.1, max=1)
attr thickness = 0.1
@Description("Number of subdivisions of the outer mantle")
attr sides = min(128,max(16,floor(8*diameter)*4))
@StartRule
Culvert --> Annulus
Annulus -->
primitiveDisk(sides, diameter+thickness)
offset(-thickness)
comp(f) { border = Extrude}
Extrude -->
extrude (length)
comp(f) { side = setNormals(soft) Culvert. | all : Culvert. }
... View more
02-27-2025
05:19 AM
|
1
|
1
|
386
|
POST
|
Hello @biaozeng Your observation is correct. When using 'Menu > Shapes > Update Seed' <ctrl+shift+G> in some cases negative numbers are generated. For the CGA seedian shape attribute the values are restricted to the range [0, 714024]. Numbers outside this range are mapped into it.
... View more
02-26-2025
02:42 AM
|
0
|
0
|
256
|
POST
|
Hello @josegudalupemeridajardinez Thanks for the question. Just select a CGA Model (or any static model). Then to create .cgamat files you can use the CityEngine CGA Material Encoder option in the File > Export Models... dialog. Export a model—ArcGIS CityEngine Resources | Documentation The material descriptions of a CGA model are collected and written into individual subdirectories. Each subdirectory contains all the material—including the used textures—which can be copied into a folder of assets, for example. The name of the subdirectory and the .cgamat file is the material.name attribute but is made unique if there are several materials with the same name. The <matName>.cgamat file is in CSV format, as is the result of the CGA function: getMaterial(used, changed). .cgamat files are simple plain text file contain name of material attributes and its value seperated by a comma: metallic,0
roughness,1
colormap,Textures/Grass_Dry_10x10_Brown_Color.jpg
colormap.su,0.1
colormap.sv,0.1
normalmap,Textures/Grass_10x10_Normal.jpg
normalmap.rw, 0
normalmap.su,0.1
normalmap.sv,0.1
... Note: You can also find some material files in the ESRI.lib under /assets/Materials. Only materials stored here are shown in the Material Browser. ESRI.lib—ArcGIS CityEngine Resources | Documentation To apply a .cgamat file on a shape, you need to set the path first. Then use the setMaterial operation—ArcGIS CityEngine Resources | Documentation and project the material on every face: version "2024.1"
@MaterialFile
attr cgaMat = "/ESRI.lib/assets/Materials/Generic/Wood/Wood_Standard_10x10.cgamat"
@StartRule
SetMaterial -->
setMaterial( readMaterial(cgaMat) )
comp(f) { all :
setupProjection(0, scope.xy, 1, 1)
projectUV(0)
Material.
}
... View more
02-26-2025
01:15 AM
|
2
|
0
|
454
|
POST
|
You can rewrite the rule to get a sequence of the largest faces like that: Generate --> comp(f) { front = fa1 }
fa1 --> comp(f) { largestIndex : color(1,0,1) fa1. | all = fa2 }
fa2 --> comp(f) { largestIndex : color(1,1,0) fa2. | all = fa3 }
fa3 --> comp(f) { largestIndex : color(0,1,1) fa3. | all : faRemaining. }
... View more
02-21-2025
01:19 AM
|
0
|
0
|
658
|
POST
|
Hello @biaozeng Thank you for this interesting question! Here are some CGA helper functions that will give you the index of the face with the largest area: version "2024.1"
sizes = comp(f){ all : geometry.area() }
indices = sortIndices(sizes)
largestIndex = indices[size(indices)-1]
@StartRule // Apply on a shape with multiple front faces
Generate -->
comp(f) { front = comp(f) { largestIndex : color(1,0,1) fa. } }
... View more
02-19-2025
07:33 AM
|
2
|
3
|
700
|
POST
|
Thanks @desert for providing more help.
At this point it also needs to be mentioned, that those "unexpected token" errors generally occur when using a wrong syntax in a previous code statement. It is always a good idea to consult the online help. Usually there are also code snippets provided that show common usage.
Also the code completion feature (hit <ctrl + space> while typing) can help finding the right syntax.
setback operation—ArcGIS CityEngine Resources | Documentation
... View more
11-18-2024
07:29 AM
|
0
|
0
|
1345
|
IDEA
|
11-18-2024
07:06 AM
|
0
|
0
|
216
|
POST
|
Hello @Kayleigh_T
Thanks for your interesting question! As you described, a rule package (*.rpk) has assets bundled into a file. Those assets are the ones referenced in the compiled rule (*.cgb). Optionally, the source rule files (*.cga) can also be included.
However, the references in the rule are relative to the CityEngine workspace. To resolve those asset file references to the bundled ones, a file named .resolvemap.xml is included in every RPK. So if you are re-using CGA code from an RPK, make sure that all assets are correctly referenced relative to your workspace first. Then create a new RPK.
To facilitate the task it makes sense to create a new project in the workspace and copy the content of the RPK into the folder structure of this projects. This should correctly reference rules and assets that were residing in the original project. Files from other projects are collected in the ".ws" folder. Those file references still need to be updated.
I hope this lets you successfully customize the rule package.
... View more
11-18-2024
01:45 AM
|
2
|
1
|
565
|
Title | Kudos | Posted |
---|---|---|
1 | 04-19-2023 12:30 AM | |
1 | 02-27-2025 05:19 AM | |
2 | 02-26-2025 01:15 AM | |
2 | 02-19-2025 07:33 AM | |
2 | 11-18-2024 01:45 AM |
Online Status |
Offline
|
Date Last Visited |
07-10-2025
05:51 AM
|