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
}
}
}
-
+
// 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);
{
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);
const Standard_Boolean isWithCheck)
{
TopLoc_Location aLoc;
- Handle(Poly_Triangulation) aTriangulation =
+ const Handle(Poly_Triangulation)& aTriangulation =
BRep_Tool::Triangulation(theFace, aLoc);
if (aTriangulation.IsNull())
return;
}
- TopLoc_Location aLoc = aFace.Location();
+ TopLoc_Location aLoc;
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation(aFace, aLoc);
if (aTriangulation.IsNull())
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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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
## must be less than number on clear occ651
set status 0
-if {$nbpoints < $good_trip} {
+if {$nbpoints <= $good_trip} {
set status 1
}