MantisBT - Community
View Issue Details
0023436Community[OCCT] OCCT:Modeling Algorithmspublic2012-09-17 19:252013-04-29 15:23
martinsiggel 
jgv 
normalcrash 
closedfixed 
ALL
[OCCT] 6.5.3 
[OCCT] 6.6.0[OCCT] 6.6.0 
bugs modalg(006) bug23436
0023436: BRepOffsetAPI_ThruSections crashes when lofting through identical profiles
BRepOffsetAPI_ThruSections::build crashes, when trying to loft through 3 similar profiles. An exception StandardConstructionError is thrown from Geom_BSplineSurface::InsertUKnots.

The profiles are circles or ellipses, generated with GeomAPI_Interpolate through a set of points. All 3 profiles are the identical, but shifted in z-Direction. Strangely, the crash only occurs for a specific number of points per circle. For this minimal example, these numbers are 7,13,14,19,22 ... Also, the crash only occurs, if ruled = false (No ruled surface).

Please see attached the source code for the example, the generated brep file with the profiles and a core dump + the executable.

Here, the short version of the code:

int numPoints =14;

TopoDS_Wire w1 = makeWire(makeEllipse(1.,1.,0.,numPoints, 0., false, true));
TopoDS_Wire w2 = makeWire(makeEllipse(1.,1.,3.,numPoints, 0., false, true));
TopoDS_Wire w3 = makeWire(makeEllipse(1.,1.,6.,numPoints, 0., false, true));

BRepOffsetAPI_ThruSections generator(Standard_True, Standard_False, Precision::Confusion());
generator.AddWire(w1);
generator.AddWire(w2);
generator.AddWire(w3);

generator.CheckCompatibility(Standard_False);

// this triggers the crash
generator.Build();

Please see the attached code for makeEllipse and makeWire.

Interestingly, the code doesn't crash, if one circle is slightly changed, i.e. if we set one ellipse axis parameter to e.g. 1.1.

This bug is probably similar to 0022981.
Please download the attached example.
To reproduce the issue the attached shapes (myloft.brep) can be used.
restore myloft.brep s
explo s
## s_1 s_2 s_3 - sections;
thrusections r 0 0 s_1 s_2 s_3
==> Exception at Geom_BSplineSurface::InsertUKnots
At the same time if requested ruled surface (thrusections r 0 1 ...) or
use only two any sections like:
thrusections r 0 0 s_1 s_2
thrusections r 0 0 s_1 s_3
thrusections r 0 0 s_2 s_3

the problem is not reproducible (no exception).

No tags attached.
related to 0022981closed apn BRepOffsetAPI_ThruSections fails to build a surface from closed wires 
gz OCC-LoftTest.tar.gz (784,561) 2012-09-17 19:25
https://tracker.dev.opencascade.org/
? myloft.brep (3,851) 2012-10-31 15:39
https://tracker.dev.opencascade.org/
Issue History
2012-09-17 19:25martinsiggelNew Issue
2012-09-17 19:25martinsiggelAssigned To => jgv
2012-09-17 19:25martinsiggelFile Added: OCC-LoftTest.tar.gz
2012-10-31 15:39szyFile Added: myloft.brep
2012-10-31 15:44szyNote Added: 0022033
2012-10-31 15:50szySteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4465#r4465
2012-10-31 16:03szyStatusnew => assigned
2013-01-31 11:02jgvNote Added: 0023216
2013-01-31 11:02jgvStatusassigned => resolved
2013-01-31 11:02jgvAssigned Tojgv => pkv
2013-01-31 12:27pkvStatusresolved => reviewed
2013-01-31 12:27pkvNote Added: 0023217
2013-01-31 12:28pkvAssigned Topkv => mkv
2013-02-01 15:37mkvNote Added: 0023236
2013-02-01 15:37mkvTest case number => bugs modalg(006) bug23436
2013-02-01 15:37mkvAssigned Tomkv => bugmaster
2013-02-01 15:37mkvStatusreviewed => tested
2013-02-04 14:47jgvChangeset attached => occt master aadab519
2013-02-04 14:47jgvAssigned Tobugmaster => jgv
2013-02-04 14:47jgvStatustested => verified
2013-02-04 14:47jgvResolutionopen => fixed
2013-02-20 10:19bugmasterTarget Version => 6.6.0
2013-02-28 15:16abvRelationship addedrelated to 0022981
2013-04-23 13:35aivStatusverified => closed
2013-04-29 15:23aivFixed in Version => 6.6.0

Notes
(0022033)
szy   
2012-10-31 15:44   
Attached sections (myloft.brep)to be used to reproduce the issue.
The algorithm raises exception:
An exception was caught 00977860 : Standard_ConstructionError: Geom_BSplineSurface::InsertUKnots
** Exception ** 00977860 : Standard_ConstructionError: Geom_BSplineSurface::InsertUKnots

That is similar to the case 22981.
(0023216)
jgv   
2013-01-31 11:02   
The branch CR23436 is ready for reviewing.
(0023217)
pkv   
2013-01-31 12:27   
reviewed
(0023236)
mkv   
2013-02-01 15:37   
Dear BugMaster,

Branch CR23436 (and products from GIT master) was compiled on Linux and Windows platforms and tested.

Number of compiler warnings:

occt component :
Linux: 3 (3 on master)
Windows: 57 (57 on master)

products component :
Linux: 9 (9 on master)
Windows: 50 (50 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
bugs modalg(006) bug23436 - OK

Testing on Linux:
Total MEMORY difference: 234605272 / 234072044
Total CPU difference: 10526.44000000021 / 9836.770000000413


Testing on Windows:
Total MEMORY difference: 331568696 / 330854964
Total CPU difference: 12352.046875 / 12467.984375

There are not serious differences in images found by testdiff.