Exception is raised during reading step file containing p-curve having not-unique last knot.
Modification correcting misprint during computation new numbers of poles for such case was made in the file StepToGeom_MakeBSplineCurve.pxx
Protection against exception was made in the file StepToTopoDS/StepToTopoDS_TranslateEdge.cxx.
Warning message was added in the file StepToTopoDS_TranslateEdgeLoop.cxx.
Test case for issue CR26289
if (aCurrentVal > Deg + 1)
{
if (i == 1) aFMulDiff = aCurrentVal - Deg - 1;
- if (i == NbKnots) aLMulDiff = aCurrentVal - Deg - 1;
+ if (i == NbUniqueKnots) aLMulDiff = aCurrentVal - Deg - 1;
#ifdef OCCT_DEBUG
cout << "\nWrong multiplicity " << aCurrentVal << " on " << i
<< " knot!" << "\nChanged to " << Deg + 1 << endl;
#include <TopoDS_Vertex.hxx>
#include <Transfer_TransientProcess.hxx>
#include <UnitsMethods.hxx>
+#include <Standard_Failure.hxx>
//#include <StepGeom_Polyline.hxx>
//#include <TransferBRep.hxx>
const Handle(StepRepr_DefinitionalRepresentation) DRI = PCU->ReferenceToCurve();
if( DRI.IsNull()) return C2d;
const Handle(StepGeom_Curve) StepCurve = Handle(StepGeom_Curve)::DownCast(DRI->ItemsValue(1));
- C2d = StepToGeom::MakeCurve2d (StepCurve);
- if (! C2d.IsNull()) {
+ try
+ {
+ C2d = StepToGeom::MakeCurve2d (StepCurve);
+ if (! C2d.IsNull()) {
// -- if the surface is a RectangularTrimmedSurface,
// -- send the BasisSurface.
- C2d = UnitsMethods::DegreeToRadian(C2d, ConvSurf);
+ C2d = UnitsMethods::DegreeToRadian(C2d, ConvSurf);
+ }
+
+ }
+ catch(Standard_Failure)
+ {
+ return C2d;
}
return C2d;
}
while (lastpcurve > 0) {
C2d1 = myTranEdge.MakePCurve (StepPCurve,ConvSurf);
if (C2d1.IsNull()) {
+ TP->AddWarning(EC,"Incorrect pcurve is not translated. Pcurve definition is not correct");
hasPcurve = Standard_False;
break;
}
--- /dev/null
+puts "============"
+puts "OCC26289"
+puts "============"
+puts ""
+#######################################################################
+# STEP import/export produces an empty shape
+#######################################################################
+
+restore [locate_data_file bug26289_solid_3.brep] a1
+
+set aFile ${imagedir}/bug26289.stp
+catch { file delete ${aFile} }
+
+stepwrite a a1 ${aFile}
+
+stepread ${aFile} b *
+
+checknbshapes b_1 -vertex 338 -edge 673 -wire 337 -face 337 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 1687 -m "Shape"
+
+vinit View1
+vdisplay a1
+vfit
+vdump ${imagedir}/${casename}_1.png
+
+vinit View2
+vdisplay b_1
+vfit
+vdump ${imagedir}/${casename}_2.png