View Issue Details

IDProjectCategoryView StatusLast Update
0029645CommunityOCCT:Modeling Algorithmspublic2021-06-11 10:55
Reportervengelgardt Assigned Tobugmaster  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2015 
Product Version7.5.0 
Target Version7.6.0Fixed in Version7.6.0 
Summary0029645: Hang on making pipe shell using BRepOffsetAPI_MakePipeShell
DescriptionAlgorithm hangs in GeomFill_CorrectedFrenet::GetAngleAT
Steps To ReproducePaste 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);
TagsNo tags attached.
Test case numberpipe/bugs/bug29645

Attached Files

  • profile_32.brep (2,268 bytes)
  • spine_32.brep (31,138 bytes)
  • spine_32_7.5.0.brep (31,142 bytes)
  • profile_32_7.5.0.brep (2,272 bytes)

Relationships

related to 0032376 newmsv BRepOffsetAPI_MakePipeShell SIGSEGV 
related to 0032377 newmsv BRepOffsetAPI_MakePipeShell SIGSEGV 
related to 0032434 newmsv Modeling Algorithms - BRepOffsetAPI_MakePipeShell fail when using discrete trihedron mode 

Activities

Jerome Caucat

2021-03-03 11:48

reporter  

profile_32.brep (2,268 bytes)

Jerome Caucat

2021-03-03 11:48

reporter  

spine_32.brep (31,138 bytes)

Jerome Caucat

2021-03-03 11:49

reporter   ~0099330

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

hwliu11

2021-03-05 05:09

reporter   ~0099408

The attached files cant open by drawtest,show error: File was not written with this version of the topology

hwliu11

2021-03-05 05:34

reporter   ~0099409

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

Jerome Caucat

2021-03-15 17:32

reporter   ~0099529

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

Jerome Caucat

2021-03-15 17:33

reporter  

spine_32_7.5.0.brep (31,142 bytes)

Jerome Caucat

2021-03-15 17:33

reporter  

profile_32_7.5.0.brep (2,272 bytes)

git

2021-04-29 11:03

administrator   ~0100654

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.

git

2021-05-04 13:28

administrator   ~0100754

Branch CR29645 has been updated forcibly by andrey.kaftasev_159541.

SHA-1: 92deb525aa57bb61109dca9b99b60fb4df934381

akaftasev

2021-05-04 15:53

developer   ~0100762

Branch for review:
OCCT - CR29645

akaftasev

2021-05-04 15:53

developer   ~0100763

Results of testing:
http://jenkins-test-occt/view/CR29645-master-akaftasev/view/COMPARE/

jgv

2021-05-10 07:55

developer   ~0100838

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.

git

2021-05-12 18:09

administrator   ~0100919

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

akaftasev

2021-05-13 10:44

developer   ~0100931

Branch for review:
CR29645_1

kgv

2021-05-13 10:55

developer   ~0100932

Last edited: 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?

git

2021-05-13 11:26

administrator   ~0100936

Branch CR29645_1 has been updated forcibly by andrey.kaftasev_159541.

SHA-1: ac93ff84a2b9eb0f87d29003afe8704998826746

jgv

2021-05-13 11:29

developer   ~0100937

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"?

git

2021-05-13 12:19

administrator   ~0100941

Branch CR29645_1 has been updated forcibly by andrey.kaftasev_159541.

SHA-1: 0d9515e3a6d77fef8fcb02dc626c4278e95777a5

jgv

2021-05-14 09:53

developer   ~0100970

Reviewed.

Branches for integration:
OCCT – CR29645_1
Products – NOT

bugmaster

2021-05-15 14:01

administrator   ~0101016

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

git

2021-05-15 15:34

administrator   ~0101028

Branch CR29645_1 has been deleted by inv.

SHA-1: 0d9515e3a6d77fef8fcb02dc626c4278e95777a5

git

2021-05-15 15:34

administrator   ~0101037

Branch CR29645 has been deleted by inv.

SHA-1: 92deb525aa57bb61109dca9b99b60fb4df934381

Related Changesets

occt: master da02839e

2021-05-04 10:28:25

akaftasev


Committer: bugmaster Details Diff
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
Affected Issues
0029645
mod - src/GeomFill/GeomFill_CorrectedFrenet.cxx Diff File
mod - src/GeomFill/GeomFill_Frenet.cxx Diff File
mod - src/GeomLib/GeomLib.cxx Diff File
mod - src/GeomLib/GeomLib.hxx Diff File
add - tests/pipe/bugs/bug29645 Diff File

Issue History

Date Modified Username Field Change
2018-03-26 15:14 vengelgardt New Issue
2018-03-26 15:14 vengelgardt Assigned To => msv
2021-03-03 11:48 Jerome Caucat File Added: profile_32.brep
2021-03-03 11:48 Jerome Caucat File Added: spine_32.brep
2021-03-03 11:49 Jerome Caucat Note Added: 0099330
2021-03-05 05:09 hwliu11 Note Added: 0099408
2021-03-05 05:34 hwliu11 Note Added: 0099409
2021-03-15 17:32 Jerome Caucat Note Added: 0099529
2021-03-15 17:33 Jerome Caucat File Added: spine_32_7.5.0.brep
2021-03-15 17:33 Jerome Caucat File Added: profile_32_7.5.0.brep
2021-04-29 11:03 git Note Added: 0100654
2021-05-04 13:28 git Note Added: 0100754
2021-05-04 15:52 akaftasev Assigned To msv => jgv
2021-05-04 15:52 akaftasev Status new => resolved
2021-05-04 15:53 akaftasev Note Added: 0100762
2021-05-04 15:53 akaftasev Note Added: 0100763
2021-05-10 07:44 jgv Assigned To jgv => akaftasev
2021-05-10 07:55 jgv Note Added: 0100838
2021-05-10 07:55 jgv Status resolved => assigned
2021-05-10 11:29 kgv Product Version => 7.5.0
2021-05-10 11:29 kgv Target Version => 7.6.0
2021-05-10 11:29 kgv Steps to Reproduce Updated
2021-05-12 18:09 git Note Added: 0100919
2021-05-13 10:43 akaftasev Assigned To akaftasev => jgv
2021-05-13 10:43 akaftasev Status assigned => resolved
2021-05-13 10:44 akaftasev Note Added: 0100931
2021-05-13 10:55 kgv Note Added: 0100932
2021-05-13 10:55 kgv Note Edited: 0100932
2021-05-13 11:26 git Note Added: 0100936
2021-05-13 11:29 jgv Note Added: 0100937
2021-05-13 11:29 jgv Assigned To jgv => akaftasev
2021-05-13 11:29 jgv Status resolved => assigned
2021-05-13 12:19 git Note Added: 0100941
2021-05-13 15:08 akaftasev Assigned To akaftasev => jgv
2021-05-13 15:08 akaftasev Status assigned => resolved
2021-05-14 09:53 jgv Note Added: 0100970
2021-05-14 09:53 jgv Assigned To jgv => bugmaster
2021-05-14 09:53 jgv Status resolved => reviewed
2021-05-15 14:01 bugmaster Note Added: 0101016
2021-05-15 14:01 bugmaster Status reviewed => tested
2021-05-15 14:08 bugmaster Test case number => pipe/bugs/bug29645
2021-05-15 14:16 bugmaster Changeset attached => occt master da02839e
2021-05-15 14:16 bugmaster Status tested => verified
2021-05-15 14:16 bugmaster Resolution open => fixed
2021-05-15 15:34 git Note Added: 0101028
2021-05-15 15:34 git Note Added: 0101037
2021-05-17 16:17 kgv Relationship added related to 0032376
2021-05-17 16:17 kgv Relationship added related to 0032377
2021-06-11 10:55 kgv Relationship added related to 0032434