]> OCCT Git - occt.git/commitdiff
0033049: Command 'tclean -geom' does not remove all geometric objects from the shape
authorazv <azv@opencascade.com>
Fri, 1 Jul 2022 12:59:40 +0000 (15:59 +0300)
committersmoskvin <smoskvin@opencascade.com>
Fri, 8 Jul 2022 16:30:12 +0000 (19:30 +0300)
Remove unused P-curves when cleaning the geometry

src/BRepTools/BRepTools.cxx
tests/bugs/moddata_3/bug33049 [new file with mode: 0644]

index de3716bd973aa7fbf406b73afcbd3723225f6f38..7f2c71c14bd689233214b05aa0578731127ef42a 100644 (file)
@@ -893,6 +893,8 @@ void BRepTools::CleanGeometry(const TopoDS_Shape& theShape)
     aBuilder.UpdateEdge(anEdge, Handle(Geom_Curve)(),
       TopLoc_Location(), BRep_Tool::Tolerance(anEdge));
   }
+
+  RemoveUnusedPCurves(theShape);
 }
 
 
diff --git a/tests/bugs/moddata_3/bug33049 b/tests/bugs/moddata_3/bug33049
new file mode 100644 (file)
index 0000000..c5923a9
--- /dev/null
@@ -0,0 +1,25 @@
+puts "================================================================="
+puts "0033049: Command 'tclean -geom' does not remove all geometric objects from the shape"
+puts "================================================================="
+puts ""
+
+psphere s1 10
+pcylinder s2 8 20
+pcone s3 10 8 5
+ttranslate s1 0 0 25
+ttranslate s3 0 0 -5
+
+baddobjects s1
+baddtools s2 s3
+bfillds
+bbop s fuse
+
+incmesh s 0.1
+tclean -geom s
+
+regexp {Dump of ([0-9+-]*) Curve2ds.*Dump of ([0-9+-]*) Curves.*Dump of ([0-9+-]*) surfaces} [dump s] full nbC2d nbC3d nbSurf
+if {$nbC2d != 0 || $nbC3d != 0 || $nbSurf != 0} {
+  puts "Error: geometry is not fully removed"
+} else {
+  puts "OK: shape has no geometry"
+}