Architecture
forge3d has two main public execution paths and one shared data model behind them.
The Two Rendering Paths
1. Viewer-first scene control
This is the default user-facing path:
resolve terrain or other scene assets
launch
interactive_viewerwithforge3d.open_viewer_async()drive the scene through
ViewerHandlecapture snapshots, frame sequences, or downstream products
This path covers most of the repo’s examples, tutorials, and gallery entries. It is the right default for terrain scenes, overlays, point clouds, labels, camera automation, and notebook-driven inspection.
2. Native/offscreen rendering
This is the lower-level path for controlled rendering without the desktop viewer:
Scenefor compact offscreen scene renderingSession+TerrainRenderer+TerrainRenderParamsfor terrain PBR/POMrender_offline()for accumulation-based offline outputoidn_denoise()for CPU denoise after accumulation
Use this path when you need explicit renderer ownership, deterministic batch rendering, AOVs, or advanced terrain-quality settings that belong in a pipeline rather than an interactive session.
IPC Model
ViewerHandle exposes the high-frequency operations directly:
load_overlay()load_point_cloud()set_point_cloud_params()set_orbit_camera()set_camera_lookat()set_sun()snapshot()
Everything else flows through explicit NDJSON commands over TCP. You can send
those with ViewerHandle.send_ipc() or by using helper functions from
forge3d.viewer_ipc.
That split keeps the common workflow ergonomic while leaving the full scene command surface available.
Data Flow
Terrain
small bundled samples come from
forge3d.datasetslarger samples resolve from local assets first, then download as needed
numpyDEMs can still feed the viewer path through wrapper-side conversion
Scene layers
raster overlays load directly through
ViewerHandle.load_overlay()vector overlays and labels use raw IPC or
forge3d.viewer_ipcpoint clouds and scene assets use viewer or module-specific helpers
Packaged outputs
viewer snapshots feed map-plate and pure-Python composition examples
scene state can be saved and loaded through bundle workflows
vector scenes can be exported separately through
forge3d.export
Open-Source And Pro Boundaries
The open-source core covers the viewer, terrain rendering, datasets, point clouds, raster overlays, labels, animations, widgets, geometry helpers, and the native rendering path.
Pro-gated workflows are layered on top of that core rather than replacing it: map plates, vector export, style import, bundles, and building-focused product pipelines.
Reading The Repo
If you are navigating the codebase:
start with
python/forge3d/__init__.pyfor the public package surfaceuse
examples/for concrete workflowsuse
docs/examples/index.mdto map example scripts to modules and featuresuse
docs/api/api_reference.rstwhen you need the module-by-module reference