Archived issue #0033187
Modeling Algorithms - Crash in postprocessing of imported shape
Description
File Office.x_t from issue 0030459 can't be imported with enabled shape healing, exception arrises.
Problem is in GeomAdaptor_Curve::NbIntervals and GeomAdaptor_Curve::Intervals functions.
First of them calculates number of intervals, then array is created and second of them fills the array.
The number of intervals (array size) is less than need for filling.
Desynchronization of function behavior.
Small part of initial file were localized to "brep" for test purposes.
Problem is in GeomAdaptor_Curve::NbIntervals and GeomAdaptor_Curve::Intervals functions.
First of them calculates number of intervals, then array is created and second of them fills the array.
The number of intervals (array size) is less than need for filling.
Desynchronization of function behavior.
Small part of initial file were localized to "brep" for test purposes.
Steps to reproduce
pload MODELING
restore [locate_data Attachment 2 (BREP)] s
fixshape r s
restore [locate_data Attachment 2 (BREP)] s
fixshape r s
Public activity
14 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Oct 26 16:59:54 2022 +0300
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. Test for problem shape was created: bugs modalg_8 bug33187.
Result: The new approach eliminates the problem of writing outside the array bounds.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Oct 26 16:59:54 2022 +0300
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. Test for problem shape was created: bugs modalg_8 bug33187.
Result: The new approach eliminates the problem of writing outside the array bounds.
Attachment 2 (BREP) (702,632 bytes)
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Results for offset curve, based on attached bspline curve bc seem to be wrong:
OCC29745 bc 2 -1 9
NbIntervals: 5; -1 1 3.0943951023932001 5.1887902047863896 7.2831853071795898 9
offset obc bc 1 0 0 1
OCC29745 obc 1 -1 9
NbIntervals: 4; -1 1 3.0943951023932001 5.1887902047863896 9
Intervals C1 for offset curve and C2 for base curve must be the same.
This problem exists for current master too.
OCC29745 bc 2 -1 9
NbIntervals: 5; -1 1 3.0943951023932001 5.1887902047863896 7.2831853071795898 9
offset obc bc 1 0 0 1
OCC29745 obc 1 -1 9
NbIntervals: 4; -1 1 3.0943951023932001 5.1887902047863896 9
Intervals C1 for offset curve and C2 for base curve must be the same.
This problem exists for current master too.
bc (238 bytes)
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Nov 1 16:05:36 2022 +0300
# fix offset curve adaptor boundaries
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Nov 1 16:05:36 2022 +0300
# fix offset curve adaptor boundaries
Issue with offset curve has been fixed.
All tests are passed.
http://jenkins-test-occt.nnov.opencascade.com/view/CR33187-master-Author/view/COMPARE/
Draw[72]> pload QAcommands MODELING Draw[73]> restore [locate_data bc] bc bc Draw[74]> OCC29745 bc 2 -1 9 NbIntervals: 5; -1 1 3.0943951023932001 5.1887902047863896 7.2831853071795898 9 Draw[75]> offset obc bc 1 0 0 1 Draw[76]> OCC29745 obc 1 -1 9 NbIntervals: 5; -1 1 3.0943951023932001 5.1887902047863896 7.2831853071795898 9
All tests are passed.
http://jenkins-test-occt.nnov.opencascade.com/view/CR33187-master-Author/view/COMPARE/
Dear Commenter 2, join all commits in one commit with correct header and description of shanges.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Commits were squashed. Changes about offset curve were added to commit description.
Branch CR33187 seems to be valid
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Commenter 5.
[revision removed]
[revision removed]