Skip to content

feat(ariadne): FEM demos colour their fields through a tf_editor ramp - #838

Merged
transfix merged 1 commit into
masterfrom
feat/fem-field-colors
Oct 27, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/fem-field-colors

Conversation

@transfix

Copy link
Copy Markdown
Owner

The FEM demos' named colormaps become a transfer function the tf_editor widget (#827) edits, as asked once #827 and #820 landed: "for the FEM demos, there are parts where colormaps apply. we should use our new colortable ariadne widget ... where they apply".

What changes

  • mesh_lab and fe_lab colour what they show through <node>.field_colors, a cvc::tf::model string: mesh_lab's colour field (curvature, geodesic distance, eigenmodes) and fe_lab's field on the boundary and the cut, and its elements' size or quality. Only the colour ramp is used.
  • The colormap keys keep working. color.colormap / fe.view.colormap seed the model and reset it to that colormap's ramp whenever they change. So fem_gallery.ari, which sets a colormap per item, behaves as before, and an edit in the editor stands until the next change.
  • An explicit domain in the model is the colour range (in fe_lab it wins over view.fixed_range). mesh_lab's color.min / color.max report the range used.
  • The editor's axis and histogram: the nodes publish field_colors.range (the colours' span under an auto domain) and a 128-bin field_colors.histogram. fe_lab's is the whole solution, or the shown elements' size or quality in the elements view.
  • mesh_tools and fe_controls each embed a tf_editor ("Colours") under the Colormap combo, with the opacity curve and isocontours hidden.
  • GeometryNode::setColorTable: a baked colour table the scalar field maps through instead of the colormap. It is computed on the CPU like the colormaps, so WebGL draws it the same, and it recolours in place.

Tests

Docs: ARIADNE.md ("Field colours"), TRANSFER_FUNCTIONS.md, mesh_nodes.h, and the two components' headers.

mesh_lab and fe_lab colour the values they show (curvature, geodesic distance, eigenmodes, the FEM
solution, element size or quality) through a transfer function at <node>.field_colors instead of
a fixed named colormap, so the tf_editor widget edits the ramp. mesh_tools and fe_controls each
hold one (colour ramp over the values' histogram; opacity curve and isocontours hidden).

- GeometryNode::setColorTable: a baked colour table the scalar field maps through instead of the
  colormap, on the CPU like the colormaps (so WebGL draws it the same), recoloured in place.
- The nodes seed <node>.field_colors with the colormap key's ramp (color.colormap,
  fe.view.colormap) and reset it to that ramp whenever the key changes, so documents that step
  through colormaps (fem_gallery.ari) behave as before; an edit stands until the next change.
- An explicit domain in the model is the colour range (fe_lab: over view.fixed_range); mesh_lab's
  color.min / color.max report the range used.
- Beside the key the nodes publish field_colors.range and a 128-bin field_colors.histogram (fe_lab:
  the whole solution, or the shown elements' size or quality), the editor's axis and histogram.

Tests: cvcgl_scalar_field (the table, in place, kept across setColorMap / setScalarField, cleared
by an empty table); cvcgl_ariadne_realize (both node types: the ramp, its published range and
histogram, the colormap reset, an explicit domain as the colour range). Docs: ARIADNE.md "Field
colours", TRANSFER_FUNCTIONS.md, mesh_nodes.h, the two components.
@transfix
transfix merged commit d018c3d into master Oct 27, 2026
23 of 24 checks passed
@transfix
transfix deleted the feat/fem-field-colors branch October 29, 2026 20:52
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