Posts

Showing posts with the label Esri

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

[058-059] Applying Colors and Shape Attributes in CityEngine CGA

Image
Learn the color() and set() commands in Esri CityEngine to apply materials and control dynamic shape attributes programmatically. This comprehensive CGA scripting tutorial covers the dual approaches to rendering materials in Esri CityEngine. You will learn how to apply simple colors using hexadecimal values and RGB arrays, modify shape properties dynamically with the set() command, and implement the @Hidden annotation to keep programmatically overridden attributes from causing interface conflicts in the Inspector UI. So far, we have covered the most basic commands that define shape geometries: comp, split, extrude, and scope. Applying Colors in CityEngine CGA Starting today, we will look at commands for applying materials to shapes. First, we will examine the color command, which applies a simple color to a shape. Below is the reference for the color command. figure 1 : CGA color Command Reference ( https...

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

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

[048] Understanding the rotate() Command in Esri CityEngine CGA

Image
Learn how to manipulate 3D geometry coordinates using the rotate() command and understand how rule execution order impacts procedural outcomes. This tutorial explores the rotate() command in CityEngine CGA, highlighting its similarities to translate() while warning of the complexities involved in 3D rotation. We discuss the importance of coordinate systems and provide a practical exercise to observe how swapping command orders changes model orientation. rotate() works in much the same way as translate(). There is not much to explain separately. img 1 : https://doc.arcgis.com/en/cityengine/latest/cga/cga-rotate.htm As you can see from the reference above, it functions just like translate(). However!! Why Rotation Can Be Difficult in CGA Unlike translation, rotation is quite difficult to grasp intuitively. This happens because when rotation, scale, and translation commands are combined, the transfor...

[043] How to Build a 5-Story Procedural Building in Esri CityEngine

Image
Integrating extrude, split, comp, and index commands to build complex architectural forms. This tutorial focuses on a practical exercise to implement varying floor heights, facade protrusions based on even/odd indices, and side-wall component divisions within a single CGA rule workflow. By following these steps, you will learn how to handle multi-level logic and conditional modeling in CityEngine. So far, we have covered extrude, split, comp, and index. There are many valid ways to implement this logic, so treat this workflow as just one example. Building Requirements and Modeling Goals Let's assume there is a building with the following specifications: The building footprint is a rectangle with a width (front) of 40m and a depth (side) of 20m. The height is 20m. It is a 5-story building in total. The 1st floor height is 5m, and there is a 4m wide entrance in the center of the...