feat: Add mesh tetrahedra analysis filter and plugin#218
feat: Add mesh tetrahedra analysis filter and plugin#218paloma-martinez wants to merge 12 commits intomainfrom
Conversation
RomainBaville
left a comment
There was a problem hiding this comment.
It seems good to me, just few suggestions on the docstring
|
|
||
| Returns: | ||
| npt.NDArray[np.float64]: Coordinates | ||
|
|
|
|
||
| """ | ||
| points = mesh.GetPoints() | ||
| npoints = points.GetNumberOfPoints() |
There was a problem hiding this comment.
You may use camelCase for the variable names
| return np.array( tetrahedraIds ), np.array( tetrahedraConnectivity ) | ||
|
|
||
|
|
||
| def analyzeAllTets( n: int, coords: npt.NDArray[ np.float64 ], |
There was a problem hiding this comment.
why do use have the variable n here ? it is not used in the function
There was a problem hiding this comment.
Just missed it during PR refactoring, I'll remove it.
|
|
||
| Returns: | ||
| npt.NDArray[ np.float64 ]: Dihedral angle | ||
|
|
| 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). |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Can you add the metrics coumputed by the filter in the documentation to be even more informative
|
|
||
| try: | ||
| tetQualityAnalysisFilter.applyFilter() | ||
| except Exception as e: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
I corrected the doc !
| # Change output filename [optional] | ||
| tetQualityAnalysisFilter.SetFilename( filename ) | ||
|
|
||
|
|
| # 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 ): |
There was a problem hiding this comment.
Why this loop is commented ?
| ax23.grid( True, alpha=0.3 ) | ||
|
|
||
| # Save figure | ||
|
|
This PR features a new filter
TetQualityAnalysisthat 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.