Repository navigation
examples: fem_gallery renders FEM, surface and LBIE mesh results; docs/FEM_GALLERY.md - #803
Merged
Merged
Conversation
…caled Jacobian is 1 geoframe stores a hexahedron as its six faces, and LBIE winds the second face against the first (Octree::add_hexa); saveHexa and the optimizer in octree.cpp read the top corners from it as v5 v4 v7 v6. The geoframe_adapter read and wrote both faces in plain order, so every hexahedron from cvc::hexahedralize was twisted (corner k + 4 not over corner k), and geometry::quality_improve handed LBIE's optimizer twisted hexahedra. The older convert() path (decode_hexs_from_quads) had it right. The adapter now reads and writes LBIE's layout: on the bunny at 65^3 the mean scaled Jacobian goes from ~0 to 0.85, with 97-99% of the hexahedra right-handed at every corner. hex_scaled_jacobian divided the centre Jacobian by the space diagonal cubed, so a unit cube scored 1/sqrt(27) = 0.024, though its docs say 1 and filter_hexs_by_quality's default threshold of 0.2 rejected every cube. It is now the worst corner's determinant of unit edges (the Verdict definition): 1 for a box, 1/sqrt(5) for a cube sheared by twice its height, -1 for its mirror image.
…s/FEM_GALLERY.md fem_gallery is a synchronous offscreen CLI: load a surface mesh or a volume, tet-mesh the solid (SDF_IGL + LBIE, or a CT isovalue), solve Poisson, heat or Neumann eigenmodes with cvc::fem (or curvature, geodesics and Laplace-Beltrami modes on the surface), colour the boundary and a planar cut, and write a PNG. For a surface mesh the solution is sampled onto the input surface, which hides the tet mesh's grid-aligned boundary. --problem mesh shows LBIE's tetrahedra or hexahedra themselves, cut away and coloured by element size (octree level) or quality (minimum dihedral angle, scaled Jacobian); --iso2 and --improve reach cvc::tetrahedralize2 and LBIE's improvement passes. docs/FEM_GALLERY.md shows 20 renders (bunny, the TexMol head, the VolRover vh4 CT), and examples/cvcgl/fem_gallery_docs.sh regenerates them. The page lists what LBIE does not do well yet, so it isn't shown: staircase tet boundaries, geometric flow on tets, tetrahedralize2's slivers, collapsed adaptive hexahedra on the head and CT.
This was referenced Oct 25, 2026
Owner
Author
|
Retargeted to master after #802 merged; reopening to run master's PR checks. |
transfix
added a commit
that referenced
this pull request
Oct 27, 2026
#827 (tf_editor) and this branch both rework fe_lab. fe_lab keeps #827's mesh.region (solid | interval), its interval props and tetrahedralize_interval; this branch's mesh.interval flag becomes region interval (fe_controls' Mesh region combo, fem_gallery.ari, the realize test, ARIADNE.md). Everything else here stays: hex elements, source loading, placement, quality stats. fe_lab now loads its volume on its lane, so the transfer-function binding follows each load (tf_binding_options::volume_source): until a volume arrives there is no range or overlay and no bound key is written; on a new range the followed bars move to the keys' values, which are never rewritten for it, and nothing re-meshes. mesh.isovalue2's default waits for an SDF's range. cvcgl_tf_binding checks this with an SDF source loaded after realize and then reloaded. docs/FEM_GALLERY.md: #803 landed as a squash of this branch's base, so this branch's version (#803's plus its own edits) is kept.
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.
Stacked on #802. That PR fixes LBIE's hexahedron decoding and the scaled Jacobian, and the hex pictures here need both. This PR's base is
fix/lbie-hex-corner-order; GitHub retargets it tomasteronce #802 merges.What's in it
examples/cvcgl/fem_gallery.cppA synchronous, offscreen CLI: one run renders one picture, and it never races a background job the way an
.ariscene does.SDF_IGL) or a CT isovalue.cvc::fem): Poisson, heat (backward Euler from a hot floor), or Neumann Laplacian eigenmodes.mesh_ops/femon the surface): mean curvature, heat-method geodesics, or Laplace–Beltrami modes.--problem mesh: draws LBIE's tetrahedra or hexahedra themselves as a cutaway. Elements beyond the plane stay whole and are outlined. They are coloured by size (octree level) or quality (minimum dihedral angle, scaled Jacobian).--iso2/--improve: reachcvc::tetrahedralize2and LBIE's improvement passes.docs/FEM_GALLERY.md20 renders, regenerated by
examples/cvcgl/fem_gallery_docs.sh. The images are 800×600 JPEGs indocs/img/fem-gallery, about 550 KB in all. The datasets are the built-in bunny, TexMol'shead.offand VolRover'svh4.rawivCT.Wiring
examples/CMakeLists.txtbuildsfem_gallerynatively (not under Emscripten) and installs it with the other example CLIs.Not shown yet
The page lists these LBIE problems found while making it. They are follow-ups for the mesher, not this PR:
tetrahedralize2leaves sliver fans and holes.Verification
CVC_ENABLE_LIBIGL=ON).clang-formatis clean on the changed lines.