Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030003Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2018-07-31 16:222018-07-31 16:36
Assigned Tomsv 
PlatformWindowsOSVC++ 2013OS Version64 bit
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030003: Construction of pipe by two circular sections and spine curve leads to crash
DescriptionThe following simple code leads to an exception (Standard_ConstructionError) in GeomFill_NSections:

  TColgp_Array1OfPnt pathPoles(1, 3);
  pathPoles(1) = gp_Pnt(0.0, 0.0, 0.0);
  pathPoles(2) = gp_Pnt(100.0, 0.0, 0.0);
  pathPoles(3) = gp_Pnt(100.0, 100.0, 0.0);

  Handle(Geom_BezierCurve) path = new Geom_BezierCurve(pathPoles);

    c1 = GeomConvert::CurveToBSplineCurve( new Geom_Circle(gp_Ax2(gp::Origin(), gp::DX()), 10.0), Convert_Polynomial );
    c2 = GeomConvert::CurveToBSplineCurve( new Geom_Circle(gp_Ax2(gp::Origin(), gp::DX()), 20.0), Convert_Polynomial );

  GeomFill_Pipe Pipe(path, c1, c2); // Error!

There is a workaround for the issue which looks quite ugly but works (combug_02.png). The user can wrap each Geom_Circle with Geom_TrimmedCurve:

    c1 = GeomConvert::CurveToBSplineCurve( new Geom_TrimmedCurve(new Geom_Circle(gp_Ax2(gp::Origin(), gp::DX()), 10.0), 0, 2*M_PI), Convert_Polynomial );
    c2 = GeomConvert::CurveToBSplineCurve( new Geom_TrimmedCurve(new Geom_Circle(gp_Ax2(gp::Origin(), gp::DX()), 20.0), 0, 2*M_PI), Convert_Polynomial );

This huck makes the curves c1 and c2 non-periodic and prevents Pipe operator from failure. However, it looks very reasonable to be able to work with periodic profiles in Pipes without this sort of workarounds. Please, also see an important note just below.

Note: ideally, GeomConvert::CurveToBSplineCurve() should not be called as GeomFill_Pipe converts section curves to splines internally. However, such internal conversion leads to another weird result: poor approximation of sections represented with rational curves (combug_03.png). Therefore, in the code above I used a polynomial approximation to avoid rationality. This is, again, weird, but that's likely a matter for another bug report.
TagsNo tags attached.
Test case number
Attached Filespng file icon combug_01.png (6,784 bytes) 2018-07-31 16:22
png file icon combug_02.png (19,931 bytes) 2018-07-31 16:22
png file icon combug_03.png (30,750 bytes) 2018-07-31 16:22

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2018-07-31 16:22 ssv New Issue
2018-07-31 16:22 ssv Assigned To => msv
2018-07-31 16:22 ssv File Added: combug_01.png
2018-07-31 16:22 ssv File Added: combug_02.png
2018-07-31 16:22 ssv File Added: combug_03.png

Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker