Technical note
CAD Viewer Architecture Review
A working outline for reviewing the architecture of a CAD display engine.
A CAD viewer often starts as a small rendering tool and gradually becomes an application platform. Once model size, selection, annotation, measurement, and interaction requirements grow, the architecture needs clear boundaries.
Background
The viewer needs to handle imported geometry, scene organization, user interaction, and rendering performance. These concerns should not collapse into one large view class.
Problems
Common pressure points include:
- Import logic leaking into rendering code.
- Selection state being duplicated in multiple modules.
- Scene updates becoming hard to reason about.
- UI operations depending on low-level rendering details.
Design Goals
The first goal is to separate model data, scene representation, interaction state, and rendering resources. The second goal is to keep the update path explicit enough that performance work can be targeted.
Layered Structure
A practical structure can start with these layers:
- Import and data normalization.
- Domain model and metadata.
- Scene graph or render scene construction.
- Interaction tools, selection, and highlighting.
- Rendering backend and GPU resource management.
- UI shell and command routing.
add_library(cad_viewer_core)
target_sources(cad_viewer_core PRIVATE
model/Document.cpp
scene/SceneBuilder.cpp
interaction/SelectionService.cpp
)
Follow-up Plan
Future notes can expand on large model loading, incremental scene updates, picking accuracy, render cache invalidation, and how to keep the viewer testable without requiring a full UI runtime.