Overview
The scene management system provides a way to organize multiple geometry entities, manage their lifecycle, and apply operations to entire collections. TheOGScene class represents a collection of geometry entities, while OGSceneManager provides high-level scene operations.
OGScene
Structure
Creating a Scene
Managing Entities
upsert_entity
remove_entity
true if the entity was found and removed.
Example:
Projection
project_to_2d
SceneEntity
Structure
- id: Unique identifier for the entity
- kind: Type descriptor (e.g., “OGCuboid”, “OGSphere”)
- brep: The boundary representation of the geometry
OGSceneManager
The scene manager provides a high-level API for managing multiple scenes and adding various geometry types.Scene Operations
createScene
removeScene
setCurrentScene
listScenes
Adding Entities
The manager provides methods to add various geometry types to scenes:Complete Example: Multi-Entity Scene
Scene Summary
Best Practices
Entity IDs
- Use descriptive IDs that indicate purpose:
"wall-north","column-A1" - Keep IDs unique within a scene
- Use consistent naming conventions for entity groups
Performance
- Scenes can contain thousands of entities efficiently
- Use
upsert_entityfor batch updates without removing/re-adding - Remove entities when no longer needed to reduce memory
Scene Organization
Related
- Projection - Converting 3D scenes to 2D drawings
- PDF Export - Exporting scenes to PDF format
Live Demo
Scene Management Demo
Try Scene Management in the browser
- Line Primitive - Basic 2D geometry that can be added to scenes

