Skip to content

Fix optimizer hack to detect contour types (#2457)#2598

Merged
akenmorris merged 1 commit into
masterfrom
amorris/2457-contour-detection
Jul 17, 2026
Merged

Fix optimizer hack to detect contour types (#2457)#2598
akenmorris merged 1 commit into
masterfrom
amorris/2457-contour-detection

Conversation

@akenmorris

@akenmorris akenmorris commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #2457

Add MeshUtils::is_contour(), which classifies by cell content rather than the first cell: a contour has only line cells, while a surface mesh has polygon or triangle-strip cells (matching the GetNumberOfPolys() == 0 convention already used in repair_mesh).

Contour-vs-mesh detection inspected the first cell's point count (or type),
which misclassifies a surface mesh whose first cell happens to be a line and
was duplicated as a fragile hack across the codebase.

Add MeshUtils::is_contour, which classifies by cell content — a contour has
only line cells, a mesh has polygon/strip cells — and use it in the optimizer,
the groom remesh guard and integrity check, and the mesh warper. Add a
MeshTests case covering the mixed-cell mesh the old first-cell check missed.
@akenmorris
akenmorris force-pushed the amorris/2457-contour-detection branch from b35b927 to 112ab93 Compare July 17, 2026 06:26
@akenmorris
akenmorris merged commit 9c1b46f into master Jul 17, 2026
5 checks passed
@akenmorris
akenmorris deleted the amorris/2457-contour-detection branch July 17, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix optimizer hack to detect contour types

1 participant