Posts

Showing posts from 2026

[070] How to Split Procedural Windows and Facades in CityEngine

Image
Continuing from the last session, we will keep splitting facade 0. Below is an image to use as a reference for the measurements. figure 1 Among the code we wrote last time, the part corresponding to the ground floor is as follows. Front_f_Ground_f_wall --> split(x){~1 : X. | 13 : Front_f_Ground_f_wall_door | ~1 : X.} # ↑ The section where the door is located Now we will subdivide Front_f_Ground_f_wall_door. It looks like it is arranged as 'two windows - door - two windows'. Then let's split it up. Front_f_Ground_f_wall_door --> split(x){~4.5 : color(0,0,1) FFGWD_window | ~5 : FFGWD_door | ~4.5 : color(0,0,1) FFGWD_window} #In case the window sizes might change, I split everything using approximate values. figure 4 The blue area where the windows are located is where two windows go, so we split it once more. FFGWD_window --> split(x){'0.5 : FFGWD_window_final | '0.5 : FFGW...

[069] How to Split Facades and Floors for Procedural Buildings

Image
Unlike when I build it myself, explaining the work process step by step is going to take up quite a lot of space. Writing up many steps at once takes a long time, so I'll organize and post just a couple of steps at a time. 7. Set up sections for each facade. As I mentioned way back in an earlier lesson, you have to start with the big chunks and split them down into smaller and smaller pieces. In my case I did the horizontal split first and then the vertical split, but it doesn't matter if you do the vertical split first and then the horizontal split. Just code it accordingly. Set up sections for each facade. figure 1 8. Using the section lines as a guide, identify the parts where each dimension needs to be measured. The figure below shows measurements of the front (facades 0 and 4), but there's no need to measure in too much detail. That's because any part that needs adjusting can be declared with attr and chan...

[068] How to Model a 3D Building from a DAE File in CityEngine

Image
Before I knew it, May was over. From today, we'll practice CGA coding by looking at a simple sample. I was going to take photos of a suitable building and use those, but it wasn't easy to photograph the facades from every direction. So I looked for a suitable file on https://3dwarehouse.sketchup.com/ , and found something like the one below. It's at a level you can fully handle with what you've learned so far. The Building Used as a Sample https://3dwarehouse.sketchup.com/model/122d4d27-1953-4c74-b312-8253ceb53831/Build 3D Warehouse | 3D Warehouse is a website of searchable, pre-made 3D models that works seamlessly with SketchUp. | 3dwarehouse.sketchup.com Build.zip The file above is a DAE file, so just extract the compressed file and put the contents in your project's assets folder. A DAE file can also be imported directly into CityEngine, which has the advantage that you can build the model while measuring it y...

[067] How to Control Insert Modes for External 3D Models

Image
Since I have some time, I'll go ahead and write the rest. This is the last usage of i(). It requires three parameters in total. We covered two of the parameters earlier, and the new parameter this time is insertMode. figure 1 https://doc.arcgis.com/en/cityengine/latest/cga/cga-i.htm It is divided into three types in total: alignSizeAndPosition is the default. It is the same as i(filePath). keepSizeAndPositoin keeps the size of the original source, but because it reflects the model's position at the time of export as is, there are cases where it ends up outside the scope. keepSizeAlignPosition keeps the original source size but places it at the bottom center of the scope plane. It's not difficult, right? Just choose the insertMode that suits the situation. Next is an example. figure 2 This imports a truck file. Let's compare the results for each mode. figure 3 figure 4 The diff...

[066] How to Fix Up-Axis Alignment for Imported 3D Assets

Image
I'm taking a short break to post again today. This is the second lesson on i(), covering the form that takes two parameters. Sometimes, when you load a file exported from a 3D program into CityEngine, the direction of the height axis is different, so the object ends up placed all wrong. This is because the direction of the height axis differs from program to program. (Programs can be divided into those that use the right-hand rule and those that use the left-hand rule.) If it's a source you made yourself, you can simply export it with the y-axis pointing up, but with files made by other people, you often need to change the direction. In that case, you can place it correctly by changing the second parameter, upAxesOfGeometry. I created a square pyramid in a program like the one shown below. figure 1 If you look at the axis directions of this program, the x-axis is the same as in CityEngine, but the height axis is the z-axis...

[114] How to Export Bookmarks as Images using Python in CityEngine

Image
Learn how to write a Python script in CityEngine to batch export all saved scene bookmarks as high-resolution images. Manually capturing viewpoints for professional reports can be tedious. This tutorial introduces the fundamentals of CityEngine Python scripting by building a tool that iterates through every bookmark in your 3D views and saves them as 3000x2000 pixel JPG files automatically. This workflow serves as the first step in automating repetitive  CityEngine tasks. As you use CityEngine frequently, you start to notice missing features one by one. For instance, when there are many bookmarks, you have to switch between viewpoints manually, one by one to take snapshots. Or perhaps you want to find and modify only objects with specific attributes but have to select them individually to apply rules. You might even want to pull in external data in real-time to drive changes. and so on—over time, many such limitations nat...

[065] How to Insert External 3D Objects in CityEngine

Image
Understanding importing and scaling external 3D assets in Esri CityEngine using the CGA i() insert command. This tutorial covers the fundamental syntax and behavior of the CGA i() command in CityEngine, explaining how imported 3D models adapt to point, line, face, and volume scope dimensions across procedural modeling workflows. I am posting this briefly as I have a bit of time during my schedule. I planned to work on CGA coding while looking at building photos, but I realized I missed one critical command. The elements that make up a building—walls, windows, doors, window frames, fences, surrounding ornaments, water tanks, air conditioner outdoor units, signboards, landscape trees, and so on—are far too numerous to list. Implementing all of these directly in CGA??? While not impossible, there is certainly no need to do so. We must use an effective method. Among the various elements of a building, if a component is al...

[064] How to Transform UV Coordinates in CityEngine CGA

Image
Understanding UV transformations in Esri CityEngine to rotate, scale, translate, tile, and delete texture mapping coordinates using CGA rules. This tutorial covers essential UV manipulation commands in CityEngine CGA, including rotateUV, scaleUV, translateUV, normalizeUV, tileUV, and deleteUV, enabling precise texture placement and alignment on 3D procedural geometries. This is the final lesson on texture control. Today, we will learn about commands to control texture rotation, scale, position, and more after applying textures using projectUV() . You might wonder why separate commands exist when size or position can be configured in setupProjection() . However, strictly speaking, the commands used here are not applied directly to the texture itself, but rather to the UV coordinates of the texture. They transform the UV coordinates assigned to the texture. When we generally perform modeling in 3D programs, the ...