Summary
Add a per-shape rendering mode in the Shape List, alongside the existing solid/wire toggle. Include a new mesh / triangulation preview mode that shows the tessellation (the dense line-grid look sometimes seen on OCCT 8 wasm) as an intentional display option.
Must work on all platforms (desktop OpenGL and Emscripten/WebGL), not wasm-only.
Motivation
Shape List today has a binary solid/wire checkbox (AIS_Shaded vs AIS_WireFrame). That is useful but coarse:
- Solid — Phong-shaded surfaces
- Wire — B-rep edges only
- Mesh (new) — triangulation / mesh edges visible (x-ray / analysis aesthetic)
The mesh look appeared accidentally during OCCT 8 wasm shaded-mode work and is visually distinct from wireframe. It should be a first-class, user-selectable mode.
UI proposal
Replace (or extend) the current solid/wire checkbox with a compact control per shape row, e.g.:
- Dropdown / combo with labels such as:
Solid, Wire, Mesh
- Tooltip on
(?) help explaining each mode
- Same row layout as today: name | visibility | render mode | material
Prefer a dropdown over a third checkbox — scales better if more modes are added later.
Behavior
| Mode |
Expected presentation |
| Solid |
Current shaded (AIS_Shaded), no mesh edges |
| Wire |
Current wireframe (AIS_WireFrame) |
| Mesh |
Shaded or edge-only triangulation overlay; mesh/triangle edges visible, optional reduced/no fill (TBD — match the accidental wasm look where possible) |
- Changing mode should Redisplay the shape immediately (same pattern as material change).
- Default for new shapes: Solid (unchanged).
- Hide all and visibility checkbox behavior unchanged.
Persistence
- Save/load render mode per shape in
.ezy JSON (e.g. "render_mode": "solid" | "wire" | "mesh").
- Today only
material is persisted; disp_mode is not — add as part of this work.
- Backward compatible: missing key → Solid.
Implementation notes
Existing code:
Shp::m_disp_mode + set_disp_mode() — src/shp.cpp, src/shp.h
- Shape List UI —
src/gui.cpp (~solid/wire checkbox)
- JSON save/load —
src/occt_view.cpp (material only today)
Mesh mode (OCCT):
- Likely stays on
AIS_Shaded with drawer/aspect tweaks, e.g. Graphic3d_AspectFillArea3d::SetDrawEdges(true) and/or iso-line settings on Prs3d_Drawer
- May require
BRepMesh_IncrementalMesh before display so triangulation exists
- Verify identical behavior on desktop and wasm; do not rely on wasm bug side effects
Refactor suggestion:
- Introduce an app-level enum (e.g.
Shp_render_mode) mapped to OCCT display + aspect setup, rather than overloading AIS_DisplayMode alone.
Acceptance criteria
Out of scope (separate issues)
- Fixing OCCT 8 wasm first-display shaded bug (if it remains after Solid mode work)
- Global default render mode in Settings (could follow later)
Related
- Shape List solid/wire checkbox:
src/gui.cpp
Shp::set_disp_mode(): src/shp.cpp
Summary
Add a per-shape rendering mode in the Shape List, alongside the existing solid/wire toggle. Include a new mesh / triangulation preview mode that shows the tessellation (the dense line-grid look sometimes seen on OCCT 8 wasm) as an intentional display option.
Must work on all platforms (desktop OpenGL and Emscripten/WebGL), not wasm-only.
Motivation
Shape List today has a binary solid/wire checkbox (
AIS_ShadedvsAIS_WireFrame). That is useful but coarse:The mesh look appeared accidentally during OCCT 8 wasm shaded-mode work and is visually distinct from wireframe. It should be a first-class, user-selectable mode.
UI proposal
Replace (or extend) the current solid/wire checkbox with a compact control per shape row, e.g.:
Solid,Wire,Mesh(?)help explaining each modePrefer a dropdown over a third checkbox — scales better if more modes are added later.
Behavior
AIS_Shaded), no mesh edgesAIS_WireFrame)Persistence
.ezyJSON (e.g."render_mode": "solid" | "wire" | "mesh").materialis persisted;disp_modeis not — add as part of this work.Implementation notes
Existing code:
Shp::m_disp_mode+set_disp_mode()—src/shp.cpp,src/shp.hsrc/gui.cpp(~solid/wire checkbox)src/occt_view.cpp(materialonly today)Mesh mode (OCCT):
AIS_Shadedwith drawer/aspect tweaks, e.g.Graphic3d_AspectFillArea3d::SetDrawEdges(true)and/or iso-line settings onPrs3d_DrawerBRepMesh_IncrementalMeshbefore display so triangulation existsRefactor suggestion:
Shp_render_mode) mapped to OCCT display + aspect setup, rather than overloadingAIS_DisplayModealone.Acceptance criteria
.ezyand restores on File → Open / undo-redoOut of scope (separate issues)
Related
src/gui.cppShp::set_disp_mode():src/shp.cpp