occt: master f9990707

Author Committer Branch Timestamp Parent
atereshi vglukhik master 2022-10-26 16:59:54 master aba5c241
Affected Issues  0033187: Modeling Algorithms - Crash in postprocessing of imported shape
Changeset 0033187: Modeling Algorithms - Crash in postprocessing of imported shape

Problem: Desynchronization of behaviors of GeomAdaptor_Curve::NbIntervals and
 GeomAdaptor_Curve::Intervals functions. First calculates number of intervals, then
 array is created and second fills the array. In some cases the size of array
 is less than need for filling.

Change:
1. Added function BSplCLib::Intervals that calculates number of interval and fills
 the array with its (if needed).
2. Simplified the algorithm of intervals calculation.
3. GeomAdaptor_Curve::NbIntervals/Intervals and Geom2dAdaptor_Curve::NbIntervals/Intervals
 use BSplCLib::Intervals.
4. When creating an adapter for the base curve, the boundaries of the adapter for the offset curve are applied.
5. Test for problem shape was created: bugs modalg_8 bug33187.

Result: The new approach eliminates the problem of writing outside the array bounds.
mod - src/BSplCLib/BSplCLib.cxx Diff File
mod - src/BSplCLib/BSplCLib.hxx Diff File
mod - src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx Diff File
mod - src/GeomAdaptor/GeomAdaptor_Curve.cxx Diff File
add - tests/bugs/modalg_8/bug33187 Diff File
mod - tests/hlr/poly_hlr/A1 Diff File
mod - tests/hlr/poly_hlr/A2 Diff File
mod - tests/hlr/poly_hlr/A3 Diff File
mod - tests/hlr/poly_hlr/A4 Diff File
mod - tests/hlr/poly_hlr/A5 Diff File
mod - tests/hlr/poly_hlr/A6 Diff File
mod - tests/hlr/poly_hlr/A7 Diff File