]> OCCT Git - occt.git/commitdiff
0033591: Modeling Algorithms - Regression: old surface is not removed after translati...
authorastromko <astromko@opencascade.com>
Mon, 1 Apr 2024 13:34:16 +0000 (13:34 +0000)
committerjfa <jfa@opencascade.com>
Thu, 18 Apr 2024 17:23:21 +0000 (18:23 +0100)
In order to avoid the problem we should always perform the commands in the "if (IsNewCur)" block after NewCurve() function even if NewCurve() returns a null-curve.
Added additional condition for this purpose..

src/BRepTools/BRepTools_Modifier.cxx
tests/bugs/modalg_8/bug33591 [new file with mode: 0644]

index df686dd4cc79a147a9098c93dfdc00c63f29fc56..9439a33d4df1af632b7f2a057234ae3b5776870c 100644 (file)
@@ -630,7 +630,7 @@ void BRepTools_Modifier::FillNewCurveInfo(const TopTools_IndexedDataMapOfShapeLi
   {
     const TopoDS_Edge& anE = TopoDS::Edge(theMEF.FindKey(i));
     Standard_Boolean IsNewCur = M->NewCurve(anE, aCurve, aLocation, aToler);
-    if (IsNewCur)
+    if (IsNewCur || M->IsKind("BRepTools_TrsfModification"))
     {
       aNCinfo.myCurve = aCurve;
       aNCinfo.myLoc = aLocation;
diff --git a/tests/bugs/modalg_8/bug33591 b/tests/bugs/modalg_8/bug33591
new file mode 100644 (file)
index 0000000..269af6a
--- /dev/null
@@ -0,0 +1,29 @@
+puts "========================"
+puts "0033591: Modeling Algorithms - Regression: old surface is not removed after translation or rotation with geometry copying"
+puts "========================"
+puts ""
+
+pload MODELING
+pcylinder Cylinder_1 80 200
+pcylinder Cylinder_2 60 200
+psphere Sphere_1 80
+psphere Sphere_2 60
+trotate Sphere_1  0 0 0  0 1 0  90 -copy
+trotate Sphere_2  0 0 0  0 1 0  90 -copy
+ttranslate Sphere_1 0 0 200 -copy
+ttranslate Sphere_2 0 0 200 -copy
+bfuse Fuse_1 Sphere_1 Cylinder_1
+bfuse Fuse_2 Cylinder_2 Sphere_2
+bclear
+baddobjects Fuse_1 Fuse_2
+bfillds
+bbuild Partition_1
+explode Partition_1
+plane pln_1 0 0 200
+mkface Plane_1 pln_1 -100 100 -100 100
+bclear
+baddobjects Partition_1_2
+baddtools Plane_1
+bfillds
+bbuild res
+checkshape res