Anonymous | Login 2020-10-22 18:47 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-10-19 17:57
Assigned Toakaftasev
PrioritynormalSeverityminor
StatusassignedResolutionopen
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_1
test pipe bugs bug30003_2
test pipe bugs bug30003_3
TagsNo tags attached.
Test case number
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).