[013] How to Use Facade Wizard in Esri CityEngine for Procedural Facades
Subdivide facade images into procedural components to generate automated CGA code.
In this tutorial, you will learn how to leverage the Facade Wizard in Esri CityEngine to transform 2D images into 3D procedural building skins. This tool is particularly effective for modeling high-rise buildings and apartments where repetitive patterns are common, providing a foundational workflow for Digital Twin creation.
CGA Efficiency and the Facade Wizard
Define the efficiency of CGA for repetitive building structures.
The types of building forms that can be created efficiently using CGA are those where the same shapes are simply repeated. While you could create single-family houses or even gas stations, it is most efficient when creating simple, repetitive forms with slight variations, such as high-rise buildings and apartments.
When working on such forms, you can also use the Facade Wizard. To be honest, you might wonder, "Do I really need this tool?" However, since it is a basic built-in feature, let's take a look at it and also explore why users often end up not using it much.
Practical Tip: The Facade Wizard is excellent for creating "massing facades" quickly, but for detailed architectural elements, manual CGA coding offers far more control.
Advantages and Disadvantages of the Facade Wizard
Evaluate the pros and cons of the tool to determine its suitability for your project.
Let's first mention the advantages and disadvantages of the Facade Wizard.
The advantage is that you can obtain a rough draft of the CGA code.
The disadvantages are:
- Only vertical and horizontal splits are possible; diagonal splits are not supported.
- While the CGA code can be saved, the work performed within the Facade Wizard itself cannot be saved. (Once you close the Facade window, it’s over.)
- The CGA code is generated in a very "raw" state, so an understanding of CGA is required to modify it.
- The creation process is simple, but looking at the saved code might leave you thinking, "What is this?"
- It is a feature that has existed for a very long time but is not being improved.
This is why many experienced users prefer writing CGA manually.
A Brief History: Node-Based Coding in CityEngine
Recall the legacy node-based CGA editor and its removal in later versions.
As a side note, in CityEngine version 2014, CGA coding could also be done using a node-based system, as shown in the image below.
|
|
| [img 1 : Capture the Visual CGA Editor CityEngine 2014. Thank you Jonas!] |
The Core Concept and Workflow of Facade Wizard
Explain the top-down subdivision logic and session management.
Returning to the Facade Wizard, the work process is the same as the basic concept of CGA. You subdivide large masses into smaller ones. Within each mass, you perform simple splits or repetitive splits. One thing to keep in mind is that while "Undo" works during the session, it cannot be reversed once the window is closed. It is best not to close the Facade window until you are completely finished with your session.
Practical Tip: Always keep a backup of your original facade image, as the Wizard maps logic directly to the texture file path.
Example: A 3-Story Building Facade
Describe the dimensions and patterns of the sample building project.
Next is the facade of the building we will make today. It is 8m wide, 9m high, and 3 stories tall. It is divided into a total of 9 faces:
- Left: Repetition of a vertical pattern.
- 1st Floor: All independent patterns.
- 2nd Floor: Repetition of a horizontal pattern.
- 3rd Floor: Composed of a single pattern.
[img 2 : Conceptual diagram of the sample facade]
You can capture the image to use it. Create a project and put the image into
the images folder.
Navigating the Facade Wizard Interface
Identify the functions of the primary buttons in the Wizard UI.
After running CityEngine, select Window - Facade Wizard from the menu bar at the top.
[img 3 : Opening Facade Wizard]
The Facade panel will likely appear in the Inspector panel's spot. Since we only need the Facade window today, click the panel and press the Space Bar to make it full screen.
Let's look at the menu at the top of the Facade panel:
[img 4 : Toolbar overview]
- Start a new Facade session.
- Load an image for facade work.
- Save the CGA code.
- Initialize/Reset.
- Simple horizontal split.
- Repetitive horizontal split.
- Simple vertical split.
- Repetitive vertical split.
- Extrude the divided face.
- Fit the image to the center of the screen.
- Display mode (Wireframe, Solid, Texture, etc.).
- Show from the viewpoint when the image was first loaded.
Setting the Region Width and Loading Textures
Configure the real-world scale for the facade image in meters.
When you click the No. 2 button, select the image, and click Open, a window appears asking for the Region Width.
[img 5 : Entering the width]
This value refers to the actual width (m) of the building, not pixels. Enter 8 and click OK.
[img 6 : Loaded Texture]
The Splitting Process: Strategy and Execution
Execute the subdivision sequence and utilize snapping features for alignment.
Please refer to the demonstration videos below.
[img 7 : Subdivision Zones]
The larger, major sections were divided using the Single Split tool. When divided this way, the newly split areas are distinguished by a thin, solid blue line.
Now, let's subdivide each specific part. Pay close attention to how the Repeating Split is used.
A Repeating Split is indicated by a solid red line. If you hover your mouse inside a divided face using this tool, it automatically calculates and divides the area into equal intervals based on your mouse's position.
When making a single vertical split on the 1st floor, I snapped it to perfectly align with the vertical split line on the 2nd floor.
If you hold down the 'Shift' key while moving the mouse, the split line will automatically snap to the nearest existing line.
As for the 3rd floor, it simply occupies the remaining space left after dividing the other floors, so there is no need to split it separately.
Building facades are rarely perfectly flat, right? You can also push faces inward or pull them outward to create depth using the extrusion tool.
Exporting and Analyzing the CGA Code
Export the CGA code and examine its structural logic and naming conventions.
Press the save button to export the CGA code to the rules folder.
[img 8 : CGA Export]
Here is the generated CGA logic. Note how the rule names are automatically generated:
Don’t worry if this looks complex—understanding CGA structure will become easier in upcoming tutorials.
attr LOD = 2
# LOD 0: original texture | LOD 1: flat splits | LOD 2: splits with depth
#! SIZE 8.0 9.0
const n = 2
Facade -->
case LOD <= 0:
texture("/Tutorial-13-FacadeWizard/images/Facade3.gif")
alignScopeToGeometry(zUp, 0, world.lowest)
setupProjection(0, scope.xy, '1.0000, '1.0000)
projectUV(0)
else:
texture("/Tutorial-13-FacadeWizard/images/Facade3.gif")
alignScopeToGeometry(zUp, 0, world.lowest)
split(x, noAdjust) { 2.00: Facade__1(0) | ~6.00: Facade__1(1) }
FacadeTrigger(i) -->
case LOD <= 0:
texture("/Tutorial-13-FacadeWizard/images/Facade3.gif")
alignScopeToGeometry(zUp, 0, world.lowest)
Facade__1(i)
else:
Facade__1(i)
Facade__1(i) -->
case i == 0: Facade__1_1
case i == 1: Facade__1_2
else: Facade__1_1
Facade__1_1 -->
split(y, noAdjust) { ~4.50: Facade__1_1_1 }*
Facade__1_1_1 -->
case LOD <= 1:
setupProjection(0, scope.xy, '4.0098, '2.0000) projectUV(0)
else:
setupProjection(0, scope.xy, '4.0098, '2.0000)
t(0, 0, -0.4) s('1, '1, 0.4) primitiveCube() projectUV(0)
Facade__1_2 -->
split(y, noAdjust) { ~3.01: Facade__1_2_1 | 2.98: Facade__1_2_2 | ~3.01: Facade__1_2_3 }
# ... (Additional subdivision rules Facade__1_2_x follow same logic)
The code is unpolished. If you need variables, you'll have to track them using the Model Hierarchy. It highlights why understanding CGA syntax is essential.
Final Application and Precision Issues
Apply the generated rule to a shape and evaluate the final 3D result.
Apply the rule to an 8m x 12m rectangle. If a face intended to be two splits becomes three, it’s a sign that you need to manually modify the code. Mouse-based splitting often results in slight shifts in the CGA code.
In the next tutorial, we will explore how to modify geometry directly and gain more precise control beyond the Facade Wizard.
- To learn how CGA rule structure works in CityEngine, see 008] How to Understand CGA Rule Structure in CityEngine (Beginner Guide)
- If you want to reuse generated models or prepare clean facade textures, see [018] Convert Models to Shapes and Fix Perspective Distortion in CityEngine
- To map image textures to specific procedural windows and walls, see [078] How to Apply Image Textures to Procedural Facades in CGA
- To replace simple 2D textures with high-quality 3D window and door models, see [079] How to Insert 3D Window Models into Procedural Facades
If you have any questions, please leave a comment. Let's solve them together!
[A Quiet Thought]
"The machine does not isolate us from the great problems of nature but plunges us more deeply into them."
Comments
Post a Comment
Feel free to leave a comment if you have any questions about Global Mapper or CityEngine. I will get back to you with a sincere response as soon as possible. (Please note that all comments are moderated and manually approved to maintain a high-quality community. Promotional or spam content will not be published.)