mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0025469: BRepMesh corrupts triangulation of another not connected shape
Do not clean polygons that are created for different faces not connected with current shape. Remove old code producing additional points for BSpline curves due to fix #24959. Test cases fir issue CR25469 Revert changes producing additional points for BSpline curves with C1 continuity Test cases fir issue CR25469 Correction of test cases for issue CR25469
This commit is contained in:
parent
d0a994c7f1
commit
80d659a5a6
@ -97,7 +97,7 @@ BRepMesh_EdgeTessellator::BRepMesh_EdgeTessellator(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// PTv, chl/922/G9, Take into account internal vertices
|
||||
// it is necessary for internal edges, which do not split other edges, by their vertex
|
||||
TopExp_Explorer aVertexIt(theEdge, TopAbs_VERTEX);
|
||||
|
@ -374,6 +374,30 @@ void BRepMesh_IncrementalMesh::update(const TopoDS_Edge& theEdge)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check that triangulation relies to face of the given shape.
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& aMapOfSharedFaces =
|
||||
myMesh->SharedFaces();
|
||||
|
||||
const TopTools_ListOfShape& aSharedFaces =
|
||||
aMapOfSharedFaces.FindFromKey(theEdge);
|
||||
|
||||
Standard_Boolean isCurrentShape = Standard_False;
|
||||
TopTools_ListIteratorOfListOfShape aSharedFaceIt(aSharedFaces);
|
||||
for (; aSharedFaceIt.More() && !isCurrentShape; aSharedFaceIt.Next())
|
||||
{
|
||||
TopLoc_Location aLoc;
|
||||
const TopoDS_Face& aFace = TopoDS::Face(aSharedFaceIt.Value());
|
||||
Handle(Poly_Triangulation) aFaceTriangulation =
|
||||
BRep_Tool::Triangulation(aFace, aLoc);
|
||||
|
||||
isCurrentShape = (aFaceTriangulation == aTriangulation);
|
||||
}
|
||||
|
||||
if (!isCurrentShape)
|
||||
continue;
|
||||
}
|
||||
|
||||
myModified = Standard_True;
|
||||
BRepMesh_ShapeTool::NullifyEdge(theEdge, aTriangulation, aLoc);
|
||||
@ -397,7 +421,7 @@ Standard_Boolean BRepMesh_IncrementalMesh::toBeMeshed(
|
||||
const Standard_Boolean isWithCheck)
|
||||
{
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Poly_Triangulation) aTriangulation =
|
||||
const Handle(Poly_Triangulation)& aTriangulation =
|
||||
BRep_Tool::Triangulation(theFace, aLoc);
|
||||
|
||||
if (aTriangulation.IsNull())
|
||||
@ -514,7 +538,7 @@ void BRepMesh_IncrementalMesh::commitEdges(const TopoDS_Face& theFace)
|
||||
return;
|
||||
}
|
||||
|
||||
TopLoc_Location aLoc = aFace.Location();
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation(aFace, aLoc);
|
||||
|
||||
if (aTriangulation.IsNull())
|
||||
|
@ -16,8 +16,8 @@ triangles result
|
||||
set tri 0
|
||||
set nod 0
|
||||
|
||||
set good_tri 31
|
||||
set good_nod 33
|
||||
set good_tri 38
|
||||
set good_nod 40
|
||||
|
||||
set tri_info [trinfo result]
|
||||
regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
|
||||
|
30
tests/bugs/mesh/bug25469_1
Normal file
30
tests/bugs/mesh/bug25469_1
Normal file
@ -0,0 +1,30 @@
|
||||
puts "========="
|
||||
puts "CR25469"
|
||||
puts "========="
|
||||
puts ""
|
||||
###############################################
|
||||
# BRepMesh corrupts triangulation of another not connected shape
|
||||
###############################################
|
||||
|
||||
restore [locate_data_file bug25469_common_edge.brep] a
|
||||
|
||||
explode a
|
||||
|
||||
incmesh a_1 0.04
|
||||
set report [tricheck a_1]
|
||||
if {$report != ""} {
|
||||
puts "Error: incorrect meshing of shape 1"
|
||||
}
|
||||
|
||||
incmesh a_2 0.04
|
||||
set report [tricheck a_1]
|
||||
if {$report != ""} {
|
||||
puts "Error: meshing of shape 2 corrupts mesh of shape 1"
|
||||
}
|
||||
|
||||
vinit
|
||||
vsetdispmode 1
|
||||
vdisplay a_1 a_2
|
||||
vfit
|
||||
|
||||
set only_screen 1
|
34
tests/bugs/mesh/bug25469_2
Normal file
34
tests/bugs/mesh/bug25469_2
Normal file
@ -0,0 +1,34 @@
|
||||
puts "========="
|
||||
puts "CR25469"
|
||||
puts "========="
|
||||
puts ""
|
||||
###############################################
|
||||
# BRepMesh corrupts triangulation of another not connected shape
|
||||
###############################################
|
||||
|
||||
restore [locate_data_file bug25469_common_edge.brep] a
|
||||
|
||||
explode a
|
||||
explode a_1
|
||||
explode a_2
|
||||
|
||||
ttranslate a_2_1 -100 -220 0
|
||||
|
||||
incmesh a_1_1 0.04
|
||||
set report [tricheck a_1_1]
|
||||
if {$report != ""} {
|
||||
puts "Error: incorrect meshing of shape 1"
|
||||
}
|
||||
|
||||
incmesh a_2_1 0.04
|
||||
set report [tricheck a_1_1 a_2_1]
|
||||
if {$report != ""} {
|
||||
puts "Error: meshing of shape 2 corrupts mesh of shape 1"
|
||||
}
|
||||
|
||||
vinit
|
||||
vsetdispmode 1
|
||||
vdisplay a_1_1 a_2_1
|
||||
vfit
|
||||
|
||||
set only_screen 1
|
42
tests/bugs/mesh/bug25469_3
Executable file
42
tests/bugs/mesh/bug25469_3
Executable file
@ -0,0 +1,42 @@
|
||||
puts "TODO CR25469 ALL: Error : Colors are not equal in default coordinate and in the near coordinates too"
|
||||
|
||||
puts "========="
|
||||
puts "CR25469"
|
||||
puts "========="
|
||||
puts ""
|
||||
###############################################
|
||||
# BRepMesh corrupts triangulation of another not connected shape
|
||||
###############################################
|
||||
|
||||
pload QAcommands
|
||||
|
||||
restore [locate_data_file bug25469_bad_tria.brep] a
|
||||
tclean a
|
||||
incmesh a 0.001
|
||||
triangles a
|
||||
isos a 0
|
||||
|
||||
donly a
|
||||
top
|
||||
fit
|
||||
|
||||
vinit
|
||||
vsetdispmode 1
|
||||
vdisplay a
|
||||
vtop
|
||||
vfit
|
||||
vmoveto 200 150
|
||||
|
||||
dlog reset
|
||||
dlog off
|
||||
checkcolor 64 200 1 0.72549021244049072 0.12941177189350128
|
||||
dlog on
|
||||
|
||||
if { ${stat} == 1} {
|
||||
puts "Error : Bad triangulation"
|
||||
} else {
|
||||
puts "OK : Good triangulation"
|
||||
}
|
||||
|
||||
xwd ${imagedir}/${test_image}_1.png
|
||||
vdump ${imagedir}/${test_image}_2.png
|
33
tests/bugs/mesh/bug25479
Normal file
33
tests/bugs/mesh/bug25479
Normal file
@ -0,0 +1,33 @@
|
||||
puts "========="
|
||||
puts "CR25479"
|
||||
puts "========="
|
||||
puts ""
|
||||
###############################################
|
||||
# BRepTools::Clean() cleans all edge polygons, even related to different shapes
|
||||
###############################################
|
||||
|
||||
restore [locate_data_file bug25469_common_edge.brep] a
|
||||
|
||||
tclean a
|
||||
incmesh a 0.004
|
||||
|
||||
explode a
|
||||
|
||||
incmesh a_1 0.04
|
||||
set report [tricheck a_1]
|
||||
if {$report != ""} {
|
||||
puts "Error: incorrect meshing of shape"
|
||||
}
|
||||
|
||||
tclean a_2
|
||||
set report [tricheck a_1]
|
||||
if {$report != ""} {
|
||||
puts "Error: cleaning mesh of shape 2 corrupts mesh of shape 1"
|
||||
}
|
||||
|
||||
vinit
|
||||
vsetdispmode 1
|
||||
vdisplay a_1 a_2
|
||||
vfit
|
||||
|
||||
set only_screen 1
|
@ -29,7 +29,7 @@ puts $nbpoints
|
||||
## must be less than number on clear occ651
|
||||
|
||||
set status 0
|
||||
if {$nbpoints < $good_trip} {
|
||||
if {$nbpoints <= $good_trip} {
|
||||
set status 1
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user