Repository navigation
Mesh - Fix cone faces left untriangulated when the seam pcurve is tilted - #1605
Open
raistlin7447 wants to merge 2 commits into
Open
raistlin7447 wants to merge 2 commits into
raistlin7447 wants to merge 2 commits into
Conversation
SeamEdgeAmplifier::splitEdge matched the two seam pcurves by evaluating one of them at FirstParameter(). For an infinite Geom2d_Line that is -2e100, so a direction of (2e-16, -1) from rounding error gave an X far outside the U range and the pcurves were always swapped. Evaluate at the edge's first parameter instead.
raistlin7447
force-pushed
the
fix/brepmesh-seam-pcurve-tilted
branch
from
October 8, 2026 16:34
f095c19 to
660d4ed
Compare
raistlin7447
marked this pull request as ready for review
October 8, 2026 19:53
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
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.
Pre-Submission Checks
.github/CONTRIBUTING.md.Group - Summaryformat.Problem / Motivation
Fixes #572.
Since 7.7.0, BRepMesh can leave a conical face with no triangles. The status is
IMeshData_Failure. STEP files that hit this lose the face when they are meshed, so applications show a hole in the model. The face in #572 (Sfacciata.step) is one example. Another isSpray Can 218x153 5.stepfrom prusa3d/PrusaSlicer#12122, where one chamfer is missing. Both files mesh correctly with 7.6.In these files, the seam pcurves are infinite
Geom2d_Lines with a direction of about (2e-16, -1) instead of exactly (0, -1). Before the face is triangulated,SeamEdgeAmplifier::splitEdgeinBRepMesh_ModelPreProcessor.cxxadds points to the seam edge. To match each seam pcurve to its side of the face, it evaluates the first one atFirstParameter(). For an infinite line that parameter is -2e100, so the evaluated X is about -3e84 instead of a value inside the U range. The check then always swaps the pcurves. The new seam points end up on the wrong side, so the discretized wire crosses itself and the face is not meshed.Proposed Solution
Evaluate the pcurve at the edge's first parameter, which
BRep_Tool::CurveOnSurfacealready returns. For a seam line that is exactly vertical, or for a bounded pcurve, both evaluations give the same X. So the result only changes where the old evaluation was wrong.The swap check was added in 0032767 (7.7.0).
Validation
Checks performed:
Relevant tests were added or updated when applicable.
Relevant local tests were run.
New GTest
BRepMesh_IncrementalMeshTest.ConeWithTiltedSeamPCurves_IsTriangulatedbuilds a conical band with seam pcurve directions of (0, -1), (2e-16, -1) and (-2e-16, -1). It checks that each one is meshed without errors and gets the same number of triangles. Without the fix, the tilted ones fail withIMeshData_Failureand no triangles.Ran the
BRepMesh_*GTests locally.With 8.0.1 plus this change, both files above mesh the same as with 7.6. The Spray Can gets 79698 triangles and a closed mesh, and
Sfacciata.stepgets 15856 triangles. On the cone faces, the mesh is within 0.003 mm of the surface, the same as with 7.6.CLA Confirmation
CLA ID / submission reference: Submitted 2026-10-08, pending
Review Notes
OrcaSlicer is adding this change as a patch on top of 8.0.1 (OrcaSlicer/OrcaSlicer#16290) until an OCCT release includes it.