diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx index 745a56597d..6ad98046b6 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx @@ -88,6 +88,7 @@ #include #include #include +#include // ============================================================================ // Method : RemoveSinglePCurve @@ -163,6 +164,17 @@ static void CheckPCurves (TopoDS_Wire& aWire, const TopoDS_Face& aFace, B.Range(myEdge, aFace, w1, cl); w2 = cf; } + + if (w1 > w2 && mySurf->IsUPeriodic()) + { + Standard_Real u1,u2,v1,v2; + mySurf->Bounds(u1,u2,v1,v2); + ElCLib::AdjustPeriodic(u1, u2, + Min(Abs(w2-w1)/2,Precision::PConfusion()), + w1, w2); + B.Range(myEdge, aFace, w1, w2); + } + // advanced check XSAlgo::AlgoContainer()->CheckPCurve (myEdge, aFace, preci, sbwd->IsSeam(i) ); diff --git a/tests/bugs/step/bug25523 b/tests/bugs/step/bug25523 new file mode 100755 index 0000000000..d425f28314 --- /dev/null +++ b/tests/bugs/step/bug25523 @@ -0,0 +1,46 @@ +puts "============" +puts "OCC25523" +puts "============" +puts "" +####################################################################### +# Fail to read back solid written to STEP +####################################################################### + +restore [locate_data_file bug25523_bad_loopback_step.brep] a +nbshapes a + +set nbshapes_expected " +Number of shapes in a + VERTEX : 30 + EDGE : 54 + WIRE : 32 + FACE : 27 + SHELL : 1 + SOLID : 1 + COMPSOLID : 0 + COMPOUND : 0 + SHAPE : 145 +" +checknbshapes a ${nbshapes_expected} 0 "Stator model" + +newmodel +set aFile ${imagedir}/bug25523.stp +catch { file delete ${aFile} } + +stepwrite a a ${aFile} + +stepread ${aFile} b * +nbshapes b_1 ;# empty compound +checknbshapes b_1 ${nbshapes_expected} 0 "Stator model" + +tpstat c ;# reports exception + +vinit View1 +vdisplay a +vfit +vdump ${imagedir}/${casename}_1.png + +vinit View2 +vdisplay b_1 +vfit +vdump ${imagedir}/${casename}_2.png