-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add mesh tetrahedra analysis filter and plugin #218
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
Conversation
RomainBaville
left a comment
There was a problem hiding this 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 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| """ | ||
| points = mesh.GetPoints() | ||
| npoints = points.GetNumberOfPoints() |
There was a problem hiding this comment.
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 ], |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
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. |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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.
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 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.