]> OCCT Git - occt.git/commitdiff
0030921: Data Exchange - STEPCAFControl_Reader incorrectly reads the specified stp...
authorasuraven <asuraven@opencascade.com>
Tue, 15 Sep 2020 18:14:39 +0000 (21:14 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 29 Oct 2020 15:55:36 +0000 (18:55 +0300)
The number of weights is adjusted to the number of poles in StepToGeom::MakeBSplineCurve(2d).

src/StepToGeom/StepToGeom_MakeBSplineCurve.pxx
tests/bugs/step/bug30921 [new file with mode: 0644]

index d7ecabf8fb216d578ca01b600cb71c9f89c1e875..4ea9525c1de566769dc1c5bd4e9ed4acb69fa2e4 100644 (file)
   BSplineCurve_retour CC;
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve))) {
     const Handle(TColStd_HArray1OfReal)& aWeight = BSCWR->WeightsData();
-    TColStd_Array1OfReal W(1,NbPoles);
-    for (i=1; i<=NbPoles; i++)
-      W.SetValue(i,aWeight->Value(i));
+    TColStd_Array1OfReal W(1, NbPoles - aSumMulDiff);
+    for (i= 1 + aFMulDiff; i<= NbPoles - aLMulDiff; i++)
+      W.SetValue(i - aFMulDiff,aWeight->Value(i));
     CC = new BSplineCurve_gen(Poles, W, Kn, Mult, Deg, shouldBePeriodic);
   }
   else
diff --git a/tests/bugs/step/bug30921 b/tests/bugs/step/bug30921
new file mode 100644 (file)
index 0000000..d30313f
--- /dev/null
@@ -0,0 +1,31 @@
+puts "========"
+puts "OCC30921"
+puts "========"
+puts ""
+##########################################################################
+# STEPCAFControl_Reader incorrectly reads the specified stp file
+##########################################################################
+
+stepread [locate_data_file bug30921.stp] a *
+tpcompound result
+
+checkprops result -s 288180 
+puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_39"
+checkshape result
+
+set nbshapes_expected "
+Number of shapes in shape
+ VERTEX    : 2858
+ EDGE      : 4331
+ WIRE      : 1758
+ FACE      : 1514
+ SHELL     : 21
+ SOLID     : 21
+ COMPSOLID : 0
+ COMPOUND  : 1
+ SHAPE     : 10504
+"
+
+
+checknbshapes result -ref ${nbshapes_expected} -t -m "Shape"
+checkview -display result -3d -path ${imagedir}/${test_image}.png