Skip to content

feat(hybrid_viewer): detailed light viewables, styles and app highlight colours - #627

Draft
JulienChampagnol wants to merge 17 commits into
nextfrom
feat/component_light_viewables
Draft

JulienChampagnol wants to merge 17 commits into
nextfrom
feat/component_light_viewables

Conversation

@JulienChampagnol

Copy link
Copy Markdown
Member

What

Light view (vtk.js)

  • Import shows the bounding box at once, then asks the back's light_viewable route for the simplified light viewable (one per mesh component for a model, blocks excluded) and rebuilds the light actor. Also after a CRS change.
  • One merged actor per data (one draw call): the visible parts are merged into one polydata; component visibility re-merges them, explode stretches the whole data over one z range.
  • Styles follow the viewer: each model component in its constant colour (per-cell colours, alpha ignored); a mesh takes the colour, opacity, point size and edge width of its main element; corners at the model points size, lines one pixel wide. Colour, opacity, size and width changes reach the light view.
  • Lines and corners lying on surfaces are drawn in front of them (polygon offset, as the viewer).
  • Races handled: a stale or cancelled detail, a data removed or re-added while loading, a z-scaling set while loading.

App highlight colours

  • ogwFront.highlightColors in the app config, sent to the viewer (viewer.set_highlight_colors) after each reset.

Depends on

Tests

Unit tests for the merged entries, cell colours, detail requests and races, light styles, style hooks and the viewer reset.

🤖 Generated with Claude Code

JulienChampagnol and others added 17 commits December 2, 2026 11:52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A model drew one vtk.js actor per mesh component, so a camera move cost one
draw per component. Each entry now draws its visible parts merged in one
polydata: hiding a component re-merges the visible ones, and an exploded
entry is re-stretched over the z range of all its parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Camera focus and the clipping widget use the bounds as drawn: every part,
  stretched by the scene z-scaling.
- The detail replacing the bounding box keeps the current explode.
- An add whose geometry loads after a later add or removal of the same data
  is dropped; the z-scaling is read once the geometry is loaded.
- Removing or clearing a data cancels its pending detail, and a detail
  cancelled while it is stored no longer rebuilds the actor.
- Fire-and-forget detail requests no longer leave unhandled rejections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Model components take their constant color, without alpha; a mesh takes
the color, opacity, point size and line width of its main element. Model
points and lines are one pixel wide again, as the viewer draws them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Model colours (constant and random) and the mesh colour, opacity, point
size and edge width the viewer applies now restyle the light view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The viewer draws a model's corners with the model's points size, 10 by
default: the light actor takes it when built and follows its changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… once

VTK numbers polygons before strips: the cell colours now follow that
order. A model recoloured (constant or random) updates every component's
light colour, then renders once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vtk.js uploads the cell colours again only when the polydata itself is
modified, not its colour array.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ColorRGB, Opacity, PointSize and EdgeWidth replace the colour tuple and
plain numbers; the mesh style change derives from MeshLightStyle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vtk.js leaves coincident topology resolution off: lines and corners lying
on surfaces fought with them for depth. The light mappers now use polygon
offset, as the viewer does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app sets ogwFront.highlightColors in its app config: it is sent to the
viewer after each reset, next to the scene colours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The browser tests failed to load: DataArray, PolyData and
CoincidentTopologyHelper were served unbundled, and the CommonJS
fast-deep-equal they import broke in the browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant