Skip to content

feat: Add mesh tetrahedra analysis filter and plugin#218

Open
paloma-martinez wants to merge 12 commits intomainfrom
pmartinez/feature/addTetQualityAnalysis
Open

feat: Add mesh tetrahedra analysis filter and plugin#218
paloma-martinez wants to merge 12 commits intomainfrom
pmartinez/feature/addTetQualityAnalysis

Conversation

@paloma-martinez
Copy link
Collaborator

This PR features a new filter TetQualityAnalysis that allows to make the QC of tetrahedras of several input meshes and compare the values.

Results are displayed in the log and saved as a summary figure.

@paloma-martinez paloma-martinez self-assigned this Feb 2, 2026
@paloma-martinez paloma-martinez changed the title feature: Add mesh tetrahedra analysis filter and plugin feat: Add mesh tetrahedra analysis filter and plugin Feb 2, 2026
@paloma-martinez paloma-martinez added the test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI label Feb 2, 2026
Copy link
Contributor

@RomainBaville RomainBaville left a comment

Choose a reason for hiding this comment

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

It seems good to me, just few suggestions on the docstring


Returns:
npt.NDArray[np.float64]: Coordinates

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change


"""
points = mesh.GetPoints()
npoints = points.GetNumberOfPoints()
Copy link
Contributor

Choose a reason for hiding this comment

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

You may use camelCase for the variable names

return np.array( tetrahedraIds ), np.array( tetrahedraConnectivity )


def analyzeAllTets( n: int, coords: npt.NDArray[ np.float64 ],
Copy link
Contributor

Choose a reason for hiding this comment

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

why do use have the variable n here ? it is not used in the function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just missed it during PR refactoring, I'll remove it.


Returns:
npt.NDArray[ np.float64 ]: Dihedral angle

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

def computeQualityScore( aspectRatio: npt.NDArray[ np.float64 ], shapeQuality: npt.NDArray[ np.float64 ],
edgeRatio: npt.NDArray[ np.float64 ],
minDihedralAngle: npt.NDArray[ np.float64 ] ) -> npt.NDArray[ np.float64 ]:
"""Compute combined quality score (0-100).
Copy link
Contributor

Choose a reason for hiding this comment

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

You may add the signification off the boundaries to be more informative

analyzeAllTets, computeQualityScore )

__doc__ = """
TetQualityAnalysis module is a filter that performs an analysis of tetrahedras quality of one or several meshes and generates a plot as summary.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the metrics coumputed by the filter in the documentation to be even more informative


try:
tetQualityAnalysisFilter.applyFilter()
except Exception as e:
Copy link
Contributor

Choose a reason for hiding this comment

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

As you suggested in the filter documentation, you may split the except in two part, one with the known exception and one with the other

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I corrected the doc !

# Change output filename [optional]
tetQualityAnalysisFilter.SetFilename( filename )


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

# Title
suptitle = 'Mesh Quality Comparison Dashboard (Progressive Detail Layout)\n'
suptitle += ( ' - ' ).join( [ f'Mesh {n}: {self.tets[n]} tets ' for n, _ in enumerate( self.meshes, 1 ) ] )
# for n, _ in enumerate( self.meshes, 1 ):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this loop is commented ?

ax23.grid( True, alpha=0.3 )

# Save figure

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flag: ready for review test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI type: feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants