Posts

[056-057] Understanding alignScopeToGeometryBBox() in CityEngine CGA

Image
Learn how procedural scope re-alignment and external 3D model positioning work in CityEngine using alignScopeToGeometryBBox(). In this comprehensive guide, we dive deep into the mechanics of the alignScopeToGeometryBBox() command. Learn how it computes bounding boxes on specified projection planes using local geometry axes instead of world coordinates, and discover how to properly align imported external 3D models (OBJ) for flawless urban simulations. Part 1: Reorienting the Scope with Basic Geometry Today, we wrap up our multi-part series on scope alignment by focusing on the final and highly versatile command: alignScopeToGeometryBBox() . How alignScopeToGeometryBBox() Works At first glance, since this command automatically calculates and configures the scope as long as you specify a projection plane, it might seem like a simpler or more automated version of alignScopeToAxes() . However, the command actually follows t...

[055] Practice Scope Alignment in Esri CityEngine CGA with a Shape Prediction Exercise

Image
Understand scope alignment and coordinate system shifts in Esri CityEngine through a practical shape-prediction coding exercise. In this tutorial, we will take a deep dive into CityEngine's local coordinate systems and scope axes. By predicting the final 3D geometry from a sample CGA code and comparing it with the Model Hierarchy panel, you will learn how to accurately identify scope origins and coordinate orientations to prevent errors in procedural modeling. Practice Predicting Scope Alignment Results in CGA Shall we do a simple exercise? While inferring the code from the completed shape is a good method, predicting the completed shape by looking at the code is also an excellent exercise. Take a look at the code below and try to guess what the final shape will look like. alignScopeToGeometry_02.cga CGA Rules 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27...

[054] How to Use alignScopeToGeometry() in Esri CityEngine CGA

Image
Understand precise coordinate bounding box alignment using alignScopeToGeometry() in Esri CityEngine to snap scope planes to specific geometry faces and edges without manual calculation errors. Managing coordinate bounds (Scope) is critical for procedural 3D modeling in CityEngine. While basic component splits dynamically generate temporary local coordinate systems, manipulating complete 3D models as single entities requires explicit scope reorientation. This tutorial contrasts manual scope rotation via rotateScope() with precise automatic snapping using alignScopeToGeometry(), illustrating how to retrieve face and edge indices through the Inspector for flawless procedural splits. Why Scope Alignment Matters in CityEngine You might wonder, "If separating with comp(f) automatically creates a scope aligned to the face, why do I need to use other commands to set the scope?" That is correct. If you are worki...

[053] How to Use rotateScope() for Angled Splits in CityEngine CGA

Image
Rotate the procedural bounding box to control the angle of facade divisions. This tutorial explores how the coordinate system (scope) affects splitting operations in Esri CityEngine. By combining alignScopeToAxes and rotateScope, you will learn how to achieve complex diagonal divisions on 3D geometry and understand the relationship between world axes and local procedural space. Recommended Audience: Beginners in CGA coding and GIS professionals looking to master coordinate transformations for urban modeling. How Scope Direction Affects split() Operations As I mentioned previously, the reason for changing the scope is to perform operations like splitting, moving, and scaling in the desired direction. Today, we will use rotateScope() to rotate the scope and see how the results of split() change accordingly. @Group ( "Select_Axes" , 0) @Enum ( "world.xyz" , "x" , "y...

[052] How to Align Scope to Axes in Esri CityEngine

Image
Understand the alignScopeToAxes command to align Scope with world or object coordinates. In this lesson, we explore how the Scope—the invisible bounding box used in procedural modeling—aligns itself to different world and object axes. Understanding this alignment process is essential for accurate splitting, moving, and scaling operations in CityEngine CGA. In the last lesson, we examined how the scope surrounds a model based on a 2D plane. Today, we will look at how the scope is structured based on 3D volumes, starting with the alignScopeToAxes command. Understanding alignScopeToAxes Parameters The reference for alignScopeToAxes is as follows: figure 1 : https://doc.arcgis.com/en/cityengine/latest/cga/cga-align-scope-to-axes.htm At first, the official reference can feel a bit difficult to understand. Rather than worrying too much about the technical reference, you can think of it simply as follows: ...

[051] Understanding the Concept of Scope in CityEngine CGA

Image
This tutorial breaks down the fundamental logic of the 'Scope' in Esri CityEngine CGA. We explore its core characteristics as a virtual bounding box, explain why rotation is necessary for non-orthogonal designs, and introduce the specific alignment commands needed to snap coordinate systems to geometry. There is still more work to be done, but I’ve found some breathing room during the review phase. Starting today, we will cover the "Scope," a concept I have consistently mentioned while discussing CityEngine’s CGA programming. For users coming from traditional 3D modeling, Scope is often the first major obstacle when learning CityEngine CGA. In CityEngine, it is virtually impossible to create various forms without understanding the Scope. It is also quite difficult to find places to learn this, even when searching for CityEngine-related courses, lectures, or tutorials. What Is Scope in CityEngine CGA? Th...

[049-050] Things to Know Before Writing CGA Code in CityEngine

Learn critical habits and troubleshooting workflows to improve your CGA coding efficiency in Esri CityEngine. This tutorial outlines essential best practices for CityEngine beginners, focusing on variable management through annotations, visual debugging techniques using component colors, and understanding the logic of geometric transformations and parameter passing. Every programming language has its own set of rules. As you learn and use these rules, you naturally become more efficient and experienced. Since it will be difficult for me to post long articles for a while, I would like to briefly talk about some CGA coding tips. Think of this as a short break between lessons and feel free to read through it casually. These are simple tips that will be helpful for those starting with CGA coding. 1st.  Make these part of your workflow. Always use annotations when declaring variables. · W...