MantisBT - Open CASCADE
View Issue Details
0031421Open CASCADE[OCCT] OCCT:Meshpublic2020-03-11 11:272020-07-23 18:50
szy 
szy 
normalminor 
feedbacksuspended 
[OCCT] 7.4.0 
[OCCT] Unscheduled 
0031421: OCCT:Mesh: SelfIntersectingWire Failure.
Attempt to save a valid face using Draw command 'writestl' gives the next error message:
"** Error **: Mesh writing has been failed."

The face contains 2 wires: bounding wire and one internal wire (it gives the face
with a hole).
Minimal distance between wires = 0.40121902464126269
pload ALL
stepread simplified_part.stp s *
## Transferrable Roots : Nb entities selected : 1
## Transfer entity n0 601 OK -> DRAW Shape: s_1

nexplode s_1 F
checkshape s_1_241
writestl s_1_241 f241
** Error **: Mesh writing has been failed.
## additional check with incmesh
incmesh s_1_241 0.1
## Incremental Mesh, multi-threading OFF
## Meshing statuses: SelfIntersectingWire Failure


No tags attached.
child of 0024084assigned oan Additional tool for resolving 2d loops on discretized wires should be implemented in BRepMesh 
zip simplified_part.zip (805,712) 2020-03-11 11:27
https://tracker.dev.opencascade.org/
7z BRepMesh.7z (12,000) 2020-06-19 12:47
https://tracker.dev.opencascade.org/
Issue History
2020-03-11 11:27szyNew Issue
2020-03-11 11:27szyAssigned To => oan
2020-03-11 11:27szyFile Added: simplified_part.zip
2020-03-11 13:05oanNote Added: 0090895
2020-03-11 13:05oanAssigned Tooan => szy
2020-03-11 13:05oanStatusnew => feedback
2020-03-11 13:06oanNote Edited: 0090895bug_revision_view_page.php?bugnote_id=90895#r22660
2020-03-11 13:06oanNote Edited: 0090895bug_revision_view_page.php?bugnote_id=90895#r22661
2020-06-19 12:41szyRelationship addedchild of 0024084
2020-06-19 12:47szyNote Added: 0092578
2020-06-19 12:47szyFile Added: BRepMesh.7z
2020-06-19 12:53szyAssigned Toszy => oan
2020-06-19 12:53szyStatusfeedback => assigned
2020-06-19 12:53szyTarget Version7.5.0 => Unscheduled
2020-06-19 12:53szySummaryDraw command 'writestl' fails to save valid face => OCCT:Mesh: SelfIntersectingWire Failure.
2020-06-22 14:14oanNote Added: 0092651
2020-06-22 14:14oanAssigned Tooan => szy
2020-06-22 14:14oanStatusassigned => feedback
2020-07-23 18:50szyResolutionopen => suspended

Notes
(0090895)
oan   
2020-03-11 13:05   
(edited on: 2020-03-11 13:06)
Hi Sergey,

thank you for the case with self-intersections, it would be useful for 0024084.
However, reported issue is not a case in context of BRepMesh.

writestl is actually not a part of TKMesh component which OCCT:Mesh category is related to, but OCCT:DataExchange as far as it uses TKSTL API directly from that package.

Here, I would like to suggest to split this issue on two (or probably three) issues:

- First, to fix initial problem, report new issue (or move existing one) in OCCT:DataExchange category so TKSTL could produce *.stl files despite of existence of faces with corrupted triangulations (e.g. only for faces where tricheck reports no error, or for all faces that have triangulation even totally corrupted, with gaps, isolated nodes, cross-face errors, etc.);

- Second, report new issue for OCCT:Mesh in order to improve BRepMesh so it would handle issues with self-intersections (while even fixshape would not fix it);

- Third (optionally), report new issue in OCCT:ShapeHealing category to investigate possibility of resolving cases leading to self-intersections on discrete model, e.g. notched edges, possibly real self-intersections (that could be replaced by simplified geometry within defined tolerance) covered by huge tolerance ~ 3 while max size of BB is ~ 387. Note that bopargcheck raises "Faulties, that can not be treated by BOP, are detected." while checkshape says "This shape seems to be valid".

Here is the detail report of bopargcheck:
Faulties for FIRST shape found : 888
---------------------------------
Shapes are not suppotrted by BOP: NO
Self-Intersections : YES Cases(7) Total shapes(14)
Check for SI has been aborted : NO
Too small edges : NO
Bad faces : NO
Too close vertices : DISABLED
Too close edges : DISABLED
Shapes with Continuity C0 : YES Cases(257) Total shapes(257)
Invalid Curve on Surface : YES Cases(624) Total shapes(1248)

(0092578)
szy   
2020-06-19 12:47   
In fact it is mesher problem.
Meshing statuses: SelfIntersectingWire Failure.
See the attached archive BRepMesh.7z with picture.
(0092651)
oan   
2020-06-22 14:14   
In fact, it is not.
Please read my previous message carefully.

The cause of the problem is self-intersecting wire, which is not the matter to be solved by BRepMesh if it could not have been solved by fixshape.