-
Notifications
You must be signed in to change notification settings - Fork 31
Improve clipping code performance #1654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
gunney1
wants to merge
186
commits into
develop
Choose a base branch
from
feature/gunney/shaping-refactor-and-perf
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
Clipper tests pass on whippet, ansel and adams, except for Conduit mesh on ansel.
…ull. I don't know the rationale for returning null, but accepting existing groups is a needed functionality. The alternative is to implement something like walkPath where ever we need to check the links in a path for existence.
…' into feature/gunney/shaping-refactor-and-perf
…' into feature/gunney/shaping-refactor-and-perf
Still needs TetMeshClipper::labelInOut implementation. Compiles. Not tested.
All geometry clipping tests are passing.
This lets new Geometry be added without changing the code.
Base automatically changed from
feature/gunney/initial-mesh-clipper
to
develop
November 6, 2025 00:32
ac60395 to
843d175
Compare
User has option to have MeshClipper log the stats or get the stats to use. There are now more data collected. They are available as clipping progresses and after clipping.
The new implementation fixes missing intersections and screens out more hexes and tets.
This was temporarily removed for the initial refactor PR.
Previously, we compared a bounding box's bounding sphere. Now, we use a bounding box itself.
Both 18-tet vs 24-tet decompositions are supported in the code, but one is selected by the value of ShapeMesh::NUM_TETS_PER_HEX.
Not done yet for TetMeshClipper.
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.
Summary
This PR is a feature. It does the following:
MeshClippertest with the new geometries.The following new classes implement the
MeshClipperStrategyinterface:PlaneClipperfor a plane geometryTetClipperfor a tetrahedronHexClipperfor a hexahedronSphereClipperfor a sphereFSorClipperfor a surface of revolution where the discrete curve r(z) is a function. Although the curve may have vertical segments, it may not double back in z. It can support stepped geometries but not hollow geometries. Cones and cylinders are supported by this implementation.SorClipperfor surface of revolution where the r(z) curve can double back on itself, for example to make a bowl.TetMeshClipperfor a general geometry described by a tetrahedral mesh.New code are in
namespace experimental, because this is still a work in progress.Dependencies
The mesh clipping refactor includes multiple PRs. Please review these before this one.
Image of geometries supported (excluding the plane clipper)
Performance comparison
This is a comparison of clipping times for the
IntersectionShaperand theMeshClipper, showing the wall time it took to clip a sample of geometries. It uses thequest_shape_in_memoryexample for theIntersectionShaperand thequest_mesh_clippertest for theMeshClipper. The tests are run on the CPU on rzwhippet and on the GPU on rzadams. The mesh is 30^3 for the CPU and 100^3 for the GPU. Most of the geometries occupy about 1/16 of the mesh. Note that performance is highly configuration dependent, so this data does not tell the whole story. Furthermore, the amortization of shared costs in the new code was not used.rzwhippet + seq, 303 mesh
rzadams + hip, 1003 mesh