Repository navigation
feat(ariadne): FEM demos colour their fields through a tf_editor ramp - #838
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_labandfe_labcolour what they show through<node>.field_colors, acvc::tf::modelstring: 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.color.colormap/fe.view.colormapseed the model and reset it to that colormap's ramp whenever they change. Sofem_gallery.ari, which sets a colormap per item, behaves as before, and an edit in the editor stands until the next change.view.fixed_range). mesh_lab'scolor.min/color.maxreport the range used.field_colors.range(the colours' span under anautodomain) and a 128-binfield_colors.histogram. fe_lab's is the whole solution, or the shown elements' size or quality in the elements view.mesh_toolsandfe_controlseach embed atf_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
cvcgl_scalar_field: the table's colours, recoloured in place, kept acrosssetColorMap/setScalarField, and cleared by an empty or too-short table.cvcgl_ariadne_realize: 8 new checks over both node types: the ramp, its published range and histogram, the colormap reset, and an explicit domain as the colour range.arigl checkoffem_gallery.ariandmesh_lab.ariclean. The cvcgl_* tests are not part of CI's recipe jobs.Docs: ARIADNE.md ("Field colours"), TRANSFER_FUNCTIONS.md,
mesh_nodes.h, and the two components' headers.