Anonymous | Login 2020-11-30 17:17 MSK Project: All Projects Community Open CASCADE
 My View | View Issues | Change Log | Roadmap

View Issue Details  Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030003Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2018-07-31 16:222020-11-05 15:59
Assigned Tobugmaster
PrioritynormalSeverityminor
StatusverifiedResolutionfixed
PlatformWindowsOSVC++ 2013OS Version64 bit
Product Version[OCCT] 7.3.0
Target Version[OCCT] 7.5.0Fixed in Version
Summary0030003: Modeling Algorithms, GeomFill_Pipe - 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);

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

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

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:
```  Handle(Geom_Curve)
c1 = GeomConvert::CurveToBSplineCurve( new Geom_TrimmedCurve(new Geom_Circle(gp_Ax2(gp::Origin(),
gp::DX()), 10.0), 0, 2*M_PI), Convert_Polynomial );
//
Handle(Geom_Curve)
c2 = GeomConvert::CurveToBSplineCurve( new Geom_TrimmedCurve(new Geom_Circle(gp_Ax2(gp::Origin(),
gp::DX()), 20.0), 0, 2*M_PI), Convert_Polynomial );
```

This hack 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.
Steps To Reproducetest pipe bugs bug30003
TagsNo tags attached.
Test case numberpipe/bugs/bug30003
Attached Files combug_01.png (6,784 bytes) 2018-07-31 16:22
combug_02.png (19,931 bytes) 2018-07-31 16:22
combug_03.png (30,750 bytes) 2018-07-31 16:22

 Relationships

 Notes szy (manager) 2020-06-26 16:25 For processing. git (administrator) 2020-09-23 14:50 Branch CR30003 has been created by akaftasev. SHA-1: 4152b0f524582b810bc516cbdd7ee54ab8c66985 Detailed log of new commits: Author: akaftasev Date: Wed Sep 16 16:01:38 2020 +0300     0030003: Construction of pipe by two circular sections and spine curve leads to crash          Added new check for periodic path and sections git (administrator) 2020-09-24 12:49 Branch CR30003 has been updated forcibly by akaftasev. SHA-1: 545ce7185e313f6d105b88285ea2de120cc1ac78 git (administrator) 2020-09-24 15:09 Branch CR30003 has been updated forcibly by akaftasev. SHA-1: beef2f3cc54bd00c809fefb05225b9943ba52272 jgv (developer) 2020-10-05 15:17 Remarks: 1. GeomFill_NSections.hxx rename field of class "isPathPeriodic" to "myIsPathPeriodic". 2. GeomFill_Pipe.cxx line 729: comparisons may be incorrect, it is better Abs(deb - first) < aTol 3. New Draw command is redundant. Please use existing command "tuyau" for pipe and command "beziercurve" for building bezier curves. 4. Please create more test cases: for periodic path and V-periodic surface, for periodic path and non-V-periodic surface, ... git (administrator) 2020-10-16 17:48 Branch CR30003 has been updated forcibly by akaftasev. SHA-1: f35a55903ea999be4b85f60c7cec52c3b1ccbf83 git (administrator) 2020-10-16 17:49 Branch CR30003 has been updated forcibly by akaftasev. SHA-1: df71724a0955a5c3eadc1276216a864d6514f93f kgv (developer) 2020-10-19 17:51 ```+ isPathPeriodic = thePathPeriodic; ``` Please use initialization list instead of constructor body for initialization of class fields. ```- mySec = new (GeomFill_NSections) (SeqC,SeqP,deb,fin,first,last); + mySec = new (GeomFill_NSections) (SeqC, SeqP, deb, fin, first, last, isPathPeriodic); ``` Please use common syntax "new GeomFill_NSections()" while changing these lines. ```+# Modeling Algorithms - Construction of pipe by two circular sections and spine curve leads to crash ``` Please move bug description in test case to puts, to make it appear in HTML log, e.g.: -puts "OCC30003" +puts "0030003: Modeling Algorithms - Construction of pipe by two circular sections and spine curve leads to crash" ``` Added new check for periodic path and sections ``` Please put into commit description the location of the fix (e.g. which algorithms/classes have been affected). git (administrator) 2020-10-26 12:40 Branch CR30003 has been updated forcibly by ifv. SHA-1: 3bc06f08aaa41d62e7c45bde9685c429cc183685 git (administrator) 2020-10-26 17:00 Branch CR30003 has been updated by ifv. SHA-1: 46cd1367bded1aa61b8f194beed84e8f4313c03e Detailed log of new commits: Author: ifv Date: Mon Oct 26 17:03:31 2020 +0300     New version Author: ifv Date: Mon Oct 26 16:48:36 2020 +0300     Revert changes git (administrator) 2020-10-26 17:12 Branch CR30003 has been updated forcibly by ifv. SHA-1: 808b35214de5c7d99c502f42114b35060d02ac6c ifv (developer) 2020-10-26 20:48 Branch CR30003 is ready for review, test result - CR30003-master-IFV Branches for integration: OCCT - CR30003 Products - not jgv (developer) 2020-10-27 11:36 Reviewed. Branches for integration: OCCT - CR30003 Products - not bugmaster (administrator) 2020-10-28 16:59 Combination - OCCT branch : OCCT-750 master SHA - 5445eaeed56eb279c0ab00af552e614f1bbef9b6 a206de37fbfa0bf71bd534ae47192bbec23b8522 Products branch : OCCT-750 SHA - ebaa925ad092ce36a9743c12e5403ea978cb3417 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: 17992.300000000254 / 17994.53000000008 [-0.01%] Products Total CPU difference: 12161.930000000115 / 12171.670000000115 [-0.08%] Windows-64-VC14: OCCT Total CPU difference: 19710.375 / 19728.265625 [-0.09%] Products Total CPU difference: 13569.53125 / 13538.390625 [+0.23%] Image differences : No differences that require special attention Memory differences : No differences that require special attention git (administrator) 2020-11-05 15:59 Branch CR30003 has been deleted by inv. SHA-1: 808b35214de5c7d99c502f42114b35060d02ac6c