mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0031395: Mesh - BRepMesh produces poor mesh on shape with hidden self-intersections
Take vertex tolerance into account to avoid excessive points leading to self-intersections in discrete model
This commit is contained in:
@@ -226,7 +226,7 @@ Standard_Boolean BRepMesh_CurveTessellator::isInToleranceOfVertex (
|
||||
const TopoDS_Vertex& theVertex) const
|
||||
{
|
||||
const gp_Pnt aPoint = BRep_Tool::Pnt(theVertex);
|
||||
const Standard_Real aTolerance = BRep_Tool::Tolerance(theVertex);
|
||||
const Standard_Real aTolerance = BRep_Tool::Tolerance(theVertex) * 1.1;
|
||||
|
||||
return (thePoint.SquareDistance (aPoint) < aTolerance * aTolerance);
|
||||
}
|
||||
@@ -243,9 +243,9 @@ Standard_Boolean BRepMesh_CurveTessellator::Value (
|
||||
thePoint = myDiscretTool.Value (theIndex);
|
||||
theParameter = myDiscretTool.Parameter (theIndex);
|
||||
|
||||
/*if (!isInToleranceOfVertex(thePoint, myFirstVertex) &&
|
||||
if (!isInToleranceOfVertex(thePoint, myFirstVertex) &&
|
||||
!isInToleranceOfVertex(thePoint, myLastVertex))
|
||||
{*/
|
||||
{
|
||||
if (!myCurve.IsCurveOnSurface())
|
||||
{
|
||||
return Standard_True;
|
||||
@@ -281,9 +281,9 @@ Standard_Boolean BRepMesh_CurveTessellator::Value (
|
||||
aSurface->D0(aUV.X(), aUV.Y(), aPntOnSurf);
|
||||
|
||||
return (thePoint.SquareDistance(aPntOnSurf) < myEdgeSqTol);
|
||||
/*}
|
||||
}
|
||||
|
||||
return Standard_False;*/
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
22
tests/bugs/mesh/bug31395
Normal file
22
tests/bugs/mesh/bug31395
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "0031395: Mesh - BRepMesh produces poor mesh on shape with hidden self-intersections"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file log368.brep] result
|
||||
|
||||
tclean result
|
||||
incmesh result 0.2
|
||||
|
||||
vinit
|
||||
vsetdispmode 1
|
||||
vdefaults -autoTriang 0
|
||||
|
||||
checkview -display result -3d -path ${imagedir}/${test_image}.png
|
||||
|
||||
set log [tricheck result]
|
||||
if { [llength $log] != 0 } {
|
||||
puts "Error : Invalid mesh"
|
||||
} else {
|
||||
puts "Mesh is OK"
|
||||
}
|
Reference in New Issue
Block a user