From d74b1e9dd3d1aaa1b2e96d930dfc1b53a41456e9 Mon Sep 17 00:00:00 2001 From: azv Date: Fri, 1 Jul 2022 15:59:40 +0300 Subject: [PATCH] 0033049: Command 'tclean -geom' does not remove all geometric objects from the shape Remove unused P-curves when cleaning the geometry --- src/BRepTools/BRepTools.cxx | 2 ++ tests/bugs/moddata_3/bug33049 | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/bugs/moddata_3/bug33049 diff --git a/src/BRepTools/BRepTools.cxx b/src/BRepTools/BRepTools.cxx index de3716bd97..7f2c71c14b 100644 --- a/src/BRepTools/BRepTools.cxx +++ b/src/BRepTools/BRepTools.cxx @@ -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 index 0000000000..c5923a9466 --- /dev/null +++ b/tests/bugs/moddata_3/bug33049 @@ -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" +}