[052] How to Align Scope to Axes in Esri CityEngine
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:
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:
| Axis Parameter | Projection Plane | Bounding Method | Scope Alignment |
|---|---|---|---|
| x or world.x | World YZ plane | Projects the geometry onto the selected plane and creates a minimum-area bounding rectangle | Aligns the scope's x-axis with the world's x-axis |
| y or world.y | World XZ plane | Aligns the scope's y-axis with the world's y-axis | |
| z or world.z | World XY plane | Aligns the scope's z-axis with the world's z-axis | |
| object.x | Object YZ plane | Aligns the scope's x-axis with the object's x-axis | |
| object.y | Object XZ plane | Aligns the scope's y-axis with the object's y-axis | |
| object.z | Object XY plane | Aligns the scope's z-axis with the object's z-axis | |
| world.xyz | Aligns all three axes of the scope with the world's XYZ axes | ||
This table is usually easier to understand than the official reference.
Since aligning based on the object axis is best verified at a more advanced stage of the process, we will only look at x, y, and z in the example below.
alignScopeToAxes CGA Example
@Group("Select_Axes", 0)
@Enum("x", "y", "z", "world.xyz")
attr AlignScopeToAxes = "x"
Lot -->
primitiveCone(4, 5, 20)
alignScopeToAxes( AlignScopeToAxes )
X.
Visualizing Scope Alignment
The video demonstrates how the minimum area rectangle is created on the projection plane while changing the alignAxes values, and confirms whether the axis of alignAxes matches the world axis.
Please observe the world axes at the bottom left of the screen and the scope's axes carefully.
Video demonstration of CityEngine alignScopeToAxes
How alignScopeToAxes(x) Works
To provide further explanation using alignScopeToAxes(x) as an example:
As noted in the table above, if you set it to 'x', the model is projected onto the YZ plane. Then, the smallest possible rectangle containing the model is drawn, and the x-axis of the scope is set perpendicular to the surface formed by that rectangle, while preserving the model's extent along the x-axis
(This simply means the rectangle is drawn on a plane formed by the Y and Z axes; the world's YZ axes and the scope's YZ axes may have different directions.)
If you look at it from a slight angle, you can see that the x-axis is the same as the direction of the world's x-axis.
Let's rotate it a bit more.
You can see that the x-axis of the scope has been formed to fit the size of the model.
By referring to the XYZ axes of the scope created in this way, you can perform splitting, moving, and resizing operations.
Next, we will look at how the model is divided by adding a split command to the code above.
FAQ About alignScopeToAxes in CityEngine
What does alignScopeToAxes do in CityEngine?
The alignScopeToAxes command realigns the scope of an object based on selected world or object axes. This affects how procedural operations such as splitting, scaling, and moving are applied in CGA modeling.
Why is scope alignment important in CGA?
Scope alignment determines the directional reference used by procedural operations. Without proper scope orientation, split, move, and scale commands may produce unexpected results.
Does alignScopeToAxes change the geometry itself?
No. The command only changes the orientation and structure of the scope. The geometry itself remains unchanged unless additional transformation operations are applied afterward.
Can alignScopeToAxes affect split operations?
Yes. Since split directions are based on the scope axes, changing the scope orientation directly affects how geometry is divided during procedural modeling.
- Learn previous workflow in [051] Understanding the Concept of Scope in CityEngine CGA
- Continue learning with [053] How to Use rotateScope() for Angled Splits in CityEngine CGA
- [054] How to Align Scope to Geometry Faces in CityEngine
- [055] Practice Scope Alignment in Esri CityEngine CGA with a Shape Prediction Exercise
- [056] How to Align Scope to Geometry BBox in CityEngine
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.)