]> OCCT Git - occt.git/commitdiff
0033591: Modeling Algorithms - Regression: old surface is not removed after translati... CR33591
authorastromko <astromko@opencascade.com>
Mon, 1 Apr 2024 13:34:16 +0000 (13:34 +0000)
committerastromko <astromko@opencascade.com>
Mon, 12 Aug 2024 16:02:30 +0000 (17:02 +0100)
Removed unnecessary condition that was added by an earlier fix.
Added a test case.

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

index 63ac4565f40b8a00e222da0525d2499e313f9c02..31876b54224837e3d24518939549300b02623830 100644 (file)
@@ -307,10 +307,6 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve
 {
   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 2215b3d03b86a41132a312c9d048580f5ab82733..32669d7df5ad786e6c6015efd460db195ec84b2c 100644 (file)
@@ -82,13 +82,10 @@ public:
   //! - P is a new polygon on triangulation
   Standard_EXPORT Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& E, const TopoDS_Face& F, 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, Standard_Real& Tol) Standard_OVERRIDE;
   
   //! Returns true if the vertex V has been modified.
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"
+}