MantisBT - Community
View Issue Details
0029645Community[OCCT] OCCT:Modeling Algorithmspublic2018-03-26 15:142021-05-17 16:17
vengelgardt 
bugmaster 
normalcrash 
verifiedfixed 
WindowsVC++ 201564 bit
[OCCT] 7.5.0 
[OCCT] 7.6.0* 
pipe/bugs/bug29645
0029645: Hang on making pipe shell using BRepOffsetAPI_MakePipeShell
Algorithm hangs in GeomFill_CorrectedFrenet::GetAngleAT
Paste this code to CModelingDoc::OnWire() and include <BRepOffsetAPI_MakePipeShell.hxx>, <TopExp.hxx>
    TopoDS_Wire profile;

    {
        BRep_Builder builder;
        TopoDS_Vertex verts[4];

        builder.MakeVertex(verts[0], gp_Pnt(-26, 12, 0), Precision::Confusion());
        builder.MakeVertex(verts[1], gp_Pnt(-26, 0, 0), Precision::Confusion());
        builder.MakeVertex(verts[2], gp_Pnt(26, 0, 0), Precision::Confusion());
        builder.MakeVertex(verts[3], gp_Pnt(26, 12, 0), Precision::Confusion());

        BRepBuilderAPI_MakeEdge line1(verts[0], verts[1]);
        BRepBuilderAPI_MakeEdge line2(verts[1], verts[2]);
        BRepBuilderAPI_MakeEdge line3(verts[2], verts[3]);
        BRepBuilderAPI_MakeEdge line4(verts[3], verts[0]);
        BRepBuilderAPI_MakeWire wire_maker;

        wire_maker.Add(line1.Edge());
        wire_maker.Add(line2.Edge());
        wire_maker.Add(line3.Edge());
        wire_maker.Add(line4.Edge());

        profile = wire_maker.Wire();
    }

    TopoDS_Wire path;
    TopoDS_Vertex path_vertex;

    {
        TColStd_Array1OfReal knots(1, 5);
        knots(1) = 0;
        knots(2) = 45.880278987817846;
        knots(3) = 99.638999210680296;
        knots(4) = 162.40841851658115;
        knots(5) = 188.71431139251297;
        TColgp_Array1OfPnt poles(1, 7);
        poles(1) = gp_Pnt(-1, 0, -179);
        poles(2) = gp_Pnt(0.37902151193486527, 0, -164.30703183772184);
        poles(3) = gp_Pnt(11.195586011484558, 0, -132.50453080937984);
        poles(4) = gp_Pnt(41.585039692913654, 0, -80.520244067871488);
        poles(5) = gp_Pnt(5.5420134018386120, 0, -38.231472197588452);
        poles(6) = gp_Pnt(0.50268655678950513, 0, -8.9676964506451551);
        poles(7) = gp_Pnt(1, 0, 0);
        TColStd_Array1OfInteger mults(1, 5);
        mults(1) = 4;
        mults(2) = 1;
        mults(3) = 1;
        mults(4) = 1;
        mults(5) = 4;
        bool is_periodic = 0;
        int degree = 3;

        Handle(Geom_BSplineCurve) spl = new Geom_BSplineCurve(poles, knots, mults, degree, is_periodic);
        
BRepBuilderAPI_MakeEdge edge_maker(spl);
        BRepBuilderAPI_MakeWire wire_maker;
        TopoDS_Edge edge = edge_maker.Edge();

        edge.Reverse();

        wire_maker.Add(edge);

        path_vertex = TopExp::FirstVertex(edge, 1);

        path = wire_maker.Wire();
    }

    BRepOffsetAPI_MakePipeShell sweep(path);

    sweep.Add(profile, path_vertex, Standard_False, Standard_False);
    sweep.Build();

    Handle(AIS_Shape) ais_prism = new AIS_Shape(sweep.Shape());
    myAISContext->SetColor(ais_prism,Quantity_NOC_RED,Standard_False); 
    myAISContext->Display(ais_prism,Standard_False);
No tags attached.
related to 0032376new msv BRepOffsetAPI_MakePipeShell SIGSEGV 
related to 0032377new msv BRepOffsetAPI_MakePipeShell SIGSEGV 
? profile_32.brep (2,268) 2021-03-03 11:48
https://tracker.dev.opencascade.org/
? spine_32.brep (31,138) 2021-03-03 11:48
https://tracker.dev.opencascade.org/
? spine_32_7.5.0.brep (31,142) 2021-03-15 17:33
https://tracker.dev.opencascade.org/
? profile_32_7.5.0.brep (2,272) 2021-03-15 17:33
https://tracker.dev.opencascade.org/
Issue History
2018-03-26 15:14vengelgardtNew Issue
2018-03-26 15:14vengelgardtAssigned To => msv
2021-03-03 11:48Jerome CaucatFile Added: profile_32.brep
2021-03-03 11:48Jerome CaucatFile Added: spine_32.brep
2021-03-03 11:49Jerome CaucatNote Added: 0099330
2021-03-05 05:09hwliu11Note Added: 0099408
2021-03-05 05:34hwliu11Note Added: 0099409
2021-03-15 17:32Jerome CaucatNote Added: 0099529
2021-03-15 17:33Jerome CaucatFile Added: spine_32_7.5.0.brep
2021-03-15 17:33Jerome CaucatFile Added: profile_32_7.5.0.brep
2021-04-29 11:03gitNote Added: 0100654
2021-05-04 13:28gitNote Added: 0100754
2021-05-04 15:52akaftasevAssigned Tomsv => jgv
2021-05-04 15:52akaftasevStatusnew => resolved
2021-05-04 15:53akaftasevNote Added: 0100762
2021-05-04 15:53akaftasevNote Added: 0100763
2021-05-10 07:44jgvAssigned Tojgv => akaftasev
2021-05-10 07:55jgvNote Added: 0100838
2021-05-10 07:55jgvStatusresolved => assigned
2021-05-10 11:29kgvProduct Version => 7.5.0
2021-05-10 11:29kgvTarget Version => 7.6.0*
2021-05-10 11:29kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25156#r25156
2021-05-12 18:09gitNote Added: 0100919
2021-05-13 10:43akaftasevAssigned Toakaftasev => jgv
2021-05-13 10:43akaftasevStatusassigned => resolved
2021-05-13 10:44akaftasevNote Added: 0100931
2021-05-13 10:55kgvNote Added: 0100932
2021-05-13 10:55kgvNote Edited: 0100932bug_revision_view_page.php?bugnote_id=100932#r25181
2021-05-13 11:26gitNote Added: 0100936
2021-05-13 11:29jgvNote Added: 0100937
2021-05-13 11:29jgvAssigned Tojgv => akaftasev
2021-05-13 11:29jgvStatusresolved => assigned
2021-05-13 12:19gitNote Added: 0100941
2021-05-13 15:08akaftasevAssigned Toakaftasev => jgv
2021-05-13 15:08akaftasevStatusassigned => resolved
2021-05-14 09:53jgvNote Added: 0100970
2021-05-14 09:53jgvAssigned Tojgv => bugmaster
2021-05-14 09:53jgvStatusresolved => reviewed
2021-05-15 14:01bugmasterNote Added: 0101016
2021-05-15 14:01bugmasterStatusreviewed => tested
2021-05-15 14:08bugmasterTest case number => pipe/bugs/bug29645
2021-05-15 14:16bugmasterChangeset attached => occt master da02839e
2021-05-15 14:16bugmasterStatustested => verified
2021-05-15 14:16bugmasterResolutionopen => fixed
2021-05-15 15:34gitNote Added: 0101028
2021-05-15 15:34gitNote Added: 0101037
2021-05-17 16:17kgvRelationship addedrelated to 0032376
2021-05-17 16:17kgvRelationship addedrelated to 0032377

Notes
(0099330)
Jerome Caucat   
2021-03-03 11:49   
I encounter a similar problem with BRepOffsetAPI_MakePipe and the attached files spine_32 and profile_32. The program hangs in GeomFill_CorrectedFrenet::GetAngleAT(double).

- Linux Ubuntu 20.04 64-bit
- Version 7.5
(0099408)
hwliu11   
2021-03-05 05:09   
The attached files cant open by drawtest,show error: File was not written with this version of the topology
(0099409)
hwliu11   
2021-03-05 05:34   
The attached files is written by newer version.Rewrite CASCADE Topology V3, (c) Open Cascade to CASCADE Topology V1, (c) Matra-Datavision,the files can read by OCCT 7.5.Then use BRepOffsetAPI_MakePipe,the application crash
(0099529)
Jerome Caucat   
2021-03-15 17:32   
Yes... I actually exported those files with the latest version of OCE that I used to test if my problem had been fixed, I had not realized that the exported brep would be different, I'll now upload the files exported with the version 7.5.0.

Note that this bug happens when using the following code:

BRepOffsetAPI_MakePipeShell pipeBuilder(spine);
pipeBuilder.SetTransitionMode(BRepBuilderAPI_RightCorner);
pipeBuilder.Add(profile);
pipeBuilder.Build();
pipeBuilder.MakeSolid();

If I add "pipeBuilder.SetDiscreteMode();" then I get this crash: https://tracker.dev.opencascade.org/view.php?id=31147 [^]
(0100654)
git   
2021-04-29 11:03   
Branch CR29645 has been created by andrey.kaftasev_159541.

SHA-1: 3831bfe51a15bb0b8421d3bdcd8474d44ad4647a


Detailed log of new commits:

Author: akaftasev
Date: Thu Apr 29 11:03:45 2021 +0300

    0029645: Hang on making pipe shell using BRepOffsetAPI_MakePipeShell
    
    Added condition for exit from infinite loop.
(0100754)
git   
2021-05-04 13:28   
Branch CR29645 has been updated forcibly by andrey.kaftasev_159541.

SHA-1: 92deb525aa57bb61109dca9b99b60fb4df934381
(0100762)
akaftasev   
2021-05-04 15:53   
Branch for review:
OCCT - CR29645
(0100763)
akaftasev   
2021-05-04 15:53   
Results of testing:
http://jenkins-test-occt/view/CR29645-master-akaftasev/view/COMPARE/ [^]
(0100838)
jgv   
2021-05-10 07:55   
Your solution is not good.
Please pay attention to GeomFill_Frenet.cxx, lines 695 and 729:

GeomLib::FuseIntervals(TrimInt, mySngl->Array1(), Fusion);

Method GeomLib::FuseIntervals gives wrong result in this case, because it considers two arrays as having equal importance. You should write your own method instead: this method must adjust singularities to knots of the curve (if they are close enough).

And, of course, you should add 1 or 2 test cases.
(0100919)
git   
2021-05-12 18:09   
Branch CR29645_1 has been created by andrey.kaftasev_159541.

SHA-1: d204f8d4c9d711c9b973ff7d81d973eec605e7b7


Detailed log of new commits:

Author: akaftasev
Date: Tue May 4 13:28:25 2021 +0300

    0029645: Hang on making pipe shell using BRepOffsetAPI_MakePipeShell
    
    Added new boolean parameter to GeomLib::FuseIntervals() to select method of defining an element with close values
(0100931)
akaftasev   
2021-05-13 10:44   
Branch for review:
CR29645_1
(0100932)
kgv   
2021-05-13 10:55   
Andrey,
-  Standard_EXPORT static void FuseIntervals (const TColStd_Array1OfReal& Interval1, const TColStd_Array1OfReal& 
Interval2, TColStd_SequenceOfReal& Fusion, const Standard_Real Confusion = 1.0e-9);
+  Standard_EXPORT static void FuseIntervals (const TColStd_Array1OfReal& Interval1, const TColStd_Array1OfReal& 
Interval2, TColStd_SequenceOfReal& Fusion,
+                                             const Standard_Real Confusion = 1.0e-9, const Standard_Boolean 
IsToFirstInterval = Standard_False);

could you please add description to this method and it's parameters?

(0100936)
git   
2021-05-13 11:26   
Branch CR29645_1 has been updated forcibly by andrey.kaftasev_159541.

SHA-1: ac93ff84a2b9eb0f87d29003afe8704998826746
(0100937)
jgv   
2021-05-13 11:29   
Remarks:

1. GeomLib.hxx, cxx:
Add detailed description of the method FuseIntervals including explanation of all parameters. Rename last parameter to "IsAdjustToFirstInterval".
Reformat all GeomLib.hxx in order to adjust it to line's length <= 100 simbols.
2. GeomFill_Frenet.cxx:
line 729: use Precision::PConfusion() instead of 1.e-9.
line 695: correct call of FuseIntervals like in line 729.
3. GeomFill_CorrectedFrenet.cxx:
lines 885, 916: may be it is right to fuse intervals adjusting to "FrenetInt"?
(0100941)
git   
2021-05-13 12:19   
Branch CR29645_1 has been updated forcibly by andrey.kaftasev_159541.

SHA-1: 0d9515e3a6d77fef8fcb02dc626c4278e95777a5
(0100970)
jgv   
2021-05-14 09:53   
Reviewed.

Branches for integration:
OCCT – CR29645_1
Products – NOT
(0101016)
bugmaster   
2021-05-15 14:01   
Combination -
OCCT branch : IR-2021-05-14
master SHA - d1b8120b699dfa46c9899f70430ec45a0c4e4a95
a87b7ddc8cb44606b91e3f37113847c3f5f50fdc
Products branch : IR-2021-05-14 SHA - c56cdc236ba39874bae48cf231ece00c0876d871
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17874.080000000333 / 17899.800000000352 [-0.14%]
Products
Total CPU difference: 11557.880000000083 / 11563.54000000011 [-0.05%]
Windows-64-VC14:
OCCT
Total CPU difference: 19394.921875 / 19369.625 [+0.13%]
Products
Total CPU difference: 12880.234375 / 12896.03125 [-0.12%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0101028)
git   
2021-05-15 15:34   
Branch CR29645_1 has been deleted by inv.

SHA-1: 0d9515e3a6d77fef8fcb02dc626c4278e95777a5
(0101037)
git   
2021-05-15 15:34   
Branch CR29645 has been deleted by inv.

SHA-1: 92deb525aa57bb61109dca9b99b60fb4df934381