0032264: Data Exchange - STEP exporter generates bad geometry [REGRESSION since 7... IR-2021-04-02 WEEK-13
authorgka <gka@opencascade.com>
Wed, 31 Mar 2021 08:43:16 +0000 (11:43 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 2 Apr 2021 17:02:03 +0000 (20:02 +0300)
Location of edge is applied to geom curve before analysis of vertices projections

src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx
tests/bugs/step/bug32264 [new file with mode: 0644]

index 922c953..e6d4c0c 100644 (file)
@@ -186,9 +186,11 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
   
   Handle(StepGeom_Curve) Gpms;
   Handle(Geom_Curve) C = CA.Curve().Curve();
   if (!C.IsNull()) {
     C = Handle(Geom_Curve)::DownCast(C->Copy());
-
+    gp_Trsf Tr1 = CA.Trsf();
+    C->Transform(Tr1);
     // Special treatment is needed for very short edges based on periodic curves.
     // Since edge in STEP does not store its parametric range, parameters are computed
     // on import by projecting vertices on a curve, and for periodic curve this may 
@@ -246,8 +248,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
       }
     }
 
-    gp_Trsf Tr1 = CA.Trsf();
-    C->Transform(Tr1);
     GeomToStep_MakeCurve MkCurve(C);
     Gpms = MkCurve.Value();
   }
diff --git a/tests/bugs/step/bug32264 b/tests/bugs/step/bug32264
new file mode 100644 (file)
index 0000000..94c122e
--- /dev/null
@@ -0,0 +1,8 @@
+restore [locate_data_file bug32264.brep] s
+set aTmpFile "$imagedir/${casename}.brep"
+testwritestep "$aTmpFile" s
+testreadstep  "$aTmpFile" s1
+file delete   "$aTmpFile"
+checkshape s1 f
+checkmaxtol s1 -ref 1.e-7
+checkprops s1 -v 16.1759 -deps 0.01