[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:

alignScopeToAxes Documentation
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:

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.)

World axis observation
figure 3 : Closely observe the world axes at the bottom left.

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.

Scope X axis alignment
figure 4 : Scope X axis alignment.

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.

Rotated scope view
figure 5 : Rotated scope view.

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.

“If our brains were simple enough for us to easily understand them, we would not be smart enough to understand them.”
Incognito: The Secret Lives of the Brain, by David Eagleman
Continue Learning
Explore complete tutorial collections for CityEngine and Global Mapper.

Comments

Popular posts from this blog

029] How to Split Polygon Areas with Intersecting Lines in Global Mapper

[008] How to Understand CGA Rule Structure in CityEngine (Beginner Guide)

046] How to Create Parallel Offset Lines in Global Mapper