]> OCCT Git - occt.git/commitdiff
Modeling - Removing surface after transformation #374
authorastromko <astromko@opencascade.com>
Mon, 1 Apr 2024 13:34:16 +0000 (13:34 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Mon, 17 Feb 2025 14:12:43 +0000 (14:12 +0000)
Old surface is not removed after translation or rotation with geometry copying
Removed unnecessary condition that was added by an earlier fix.
Added a test case.
Original issue: 0033591

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

index 8a58e87620615782e3bb8d3cee316e7f1539afb6..130caf3f10d166e279167a463f38219521d92b63 100644 (file)
@@ -280,10 +280,6 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve(const TopoDS_Edge&  E,
 {
   Standard_Real f, l;
   C = BRep_Tool::Curve(E, L, f, l);
-  if (C.IsNull())
-  {
-    return Standard_False;
-  }
 
   Tol = BRep_Tool::Tolerance(E);
   Tol *= Abs(myTrsf.ScaleFactor());
index f0eed40db2a22c27aede7995b0114b88714e7374..b442b755a6eb92ef8d49addeafe4abbe624511cc 100644 (file)
@@ -89,13 +89,10 @@ public:
                                                              Handle(Poly_PolygonOnTriangulation)& P)
     Standard_OVERRIDE;
 
-  //! Returns true if the edge E has been modified.
-  //! If the edge has been modified:
+  //! Always returns true indicating that the edge E is always modified.
   //! - C is the new geometric support of the edge,
   //! - L is the new location, and
   //! - Tol is the new tolerance.
-  //! If the edge has not been modified, this function
-  //! returns false, and the values of C, L and Tol are not significant.
   Standard_EXPORT Standard_Boolean NewCurve(const TopoDS_Edge&  E,
                                             Handle(Geom_Curve)& C,
                                             TopLoc_Location&    L,
diff --git a/tests/bugs/modalg_8/bug33591 b/tests/bugs/modalg_8/bug33591
new file mode 100644 (file)
index 0000000..e2a67e0
--- /dev/null
@@ -0,0 +1,18 @@
+puts "========================"
+puts "0033591: Modeling Algorithms - Regression: old surface is not removed after translation or rotation with geometry copying"
+puts "========================"
+puts ""
+
+pload MODELING
+psphere Sphere_1 80
+trotate Sphere_1  0 0 0  0 1 0  90 -copy
+ttranslate Sphere_1 0 0 200 -copy
+
+catch {dump Sphere_1} dumpOutput
+if {[regexp {Dump of ([0-9]+) surfaces} $dumpOutput match num]} {
+  set numSurfaces $num
+}
+
+if {$numSurfaces != 1} {
+  puts "Error: The number of surfaces must be 1"
+}