Skip to content

[MeshRefinement](AI) ADD the new InfinyToolkit.MeshRefinement plugin with the TetrahedronSubdivisionController that use the public API of MeshRefinement plugin - #61

Merged
epernod merged 6 commits into
mainfrom
dev_meshrefinement_facade
Sep 13, 2026
Merged

epernod merged 6 commits into
mainfrom
dev_meshrefinement_facade

Conversation

@epernod

@epernod epernod commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Need to be merged as the same time as:
https://github.com/InfinyTech3D/MeshRefinement/pull/39

@epernod epernod added pr: new feature pr: status to review To notify reviewers to review this pull-request labels Sep 9, 2026
…public controller

The public face of the MeshRefinement plugin, as its own dll. A scene requires
InfinyToolkit.MeshRefinement and names TetrahedronSubdivisionController; the
subdivision engine stays private to MeshRefinement, reached only through its
TetrahedronSubdivisionManager facade. Laid out as a sub-plugin the way
MeshRefinement.CUDA is, with its own config.h.in, init and factory registration.

The controller moved here verbatim apart from what ownership requires: the export
macro is SOFA_INFINYTOOLKIT_MESHREFINEMENT_API and the namespace is
sofa::infinytoolkit, since a consumer writing C++ against it is writing against
InfinyToolkit now. The engine handle is qualified as
sofa::meshrefinement::TetrahedronSubdivisionManager, which is the only name it
takes from the other plugin.

Its 8 tests moved with it, into the plugin's own test target - InfinyToolkit had no
test infrastructure before this. They still load their scenes from
MeshRefinement/examples, since that is where the meshes are; the tests pass against
the new dll, cut and refinement both.

CudaSubdivisionController.cpp carries the Cuda instantiations that MeshRefinement.CUDA
used to hold, for the reason it cannot hold them now: the controller is here, and
MeshRefinement must not depend on InfinyToolkit. It compiles only when both SofaCUDA
and MeshRefinement.CUDA are found, and links the facade instantiations the latter
exports.

NOT BUILT HERE: SofaCUDA is not enabled in this build tree, so the Cuda path is
written from the interface and never compiled. It wants checking on a machine with
CUDA before anyone relies on the two Cuda scenes.
MeshRefinement renamed its public boundary: the facade is MeshRefinementAPI and
TetrahedronSubdivisionManager is now the private engine that the two managers were
merged into. Everything on this side is an outside consumer, so all of it moves to
the boundary - the sub-plugin's controller, and the two carving performers.

The controller's header comment described the old arrangement, where cutting derived
from subdividers and the point was that one manager answered both halves. That is now
a single engine, so the comment says what actually matters to a reader here instead:
the engine is private to MeshRefinement and this controller reaches it only through
the one published header, which is why nothing in the header names an implementation
type.

InfinyToolkit.MeshRefinement's 8 controller tests pass, and
Cube_AdvCarvingWithRefinement still reaches bwdInit and initialises the refine
performer through the boundary with no warning.
@epernod
epernod force-pushed the dev_meshrefinement_facade branch from 96c87cf to 2f0ce91 Compare September 11, 2026 13:37
epernod and others added 3 commits September 11, 2026 23:56
… the code

The comments carried a running account of how the component came to be - what it
replaced, which key moved and why, why a type is aliased in the class rather than
pulled in by a using, why the manager is owned rather than shared. None of that
tells a reader what the class does today.

What stays is the documentation: what each operation does and what it returns, what
each Data means, the two-phase shape of cutting, and the key bindings the example
scenes rely on. What goes is the history.

Two facts worth keeping were rewritten rather than deleted, because they are about
the current code and not about its past: the cut thickness is the tolerance for
snapping points onto the plane, and refineTetrahedra range-checks its ids because
the engine does not and an id past the end is read out of the tetrahedron array.

Some wording carried over from the original controllers is corrected while these
lines are being touched - "plan" for plane throughout the cut Data, "terahedra",
"Booleen".

Comments only. Verified by diffing with the trailing ///< text stripped: the six
declarations whose doc comment changed are character-identical on both sides.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@epernod epernod added the pr: run ci to launch the ci label Sep 11, 2026

@epernod epernod left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean Claude comments

Comment thread extensions/MeshRefinement/CMakeLists.txt Outdated
Comment thread extensions/MeshRefinement/CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Co-authored-by: erik pernod <erik.pernod@gmail.com>
@epernod epernod added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request pr: run ci to launch the ci labels Sep 13, 2026
@epernod
epernod merged commit 7fa5351 into main Sep 13, 2026
13 checks passed
@epernod
epernod deleted the dev_meshrefinement_facade branch September 13, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new feature pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant