MantisBT
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:222020-10-19 17:57
Reporterssv 
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 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
(0092771)
szy (manager)
2020-06-26 16:25

For processing.
(0095240)
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
(0095263)
git (administrator)
2020-09-24 12:49

Branch CR30003 has been updated forcibly by akaftasev.

SHA-1: 545ce7185e313f6d105b88285ea2de120cc1ac78
(0095268)
git (administrator)
2020-09-24 15:09

Branch CR30003 has been updated forcibly by akaftasev.

SHA-1: beef2f3cc54bd00c809fefb05225b9943ba52272
(0095729)
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, ...
(0096014)
git (administrator)
2020-10-16 17:48

Branch CR30003 has been updated forcibly by akaftasev.

SHA-1: f35a55903ea999be4b85f60c7cec52c3b1ccbf83
(0096015)
git (administrator)
2020-10-16 17:49

Branch CR30003 has been updated forcibly by akaftasev.

SHA-1: df71724a0955a5c3eadc1276216a864d6514f93f
(0096061)
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).

- 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
2019-08-12 17:45 msv Target Version 7.4.0 => 7.5.0
2020-06-26 16:25 szy Note Added: 0092771
2020-06-26 16:25 szy Assigned To msv => akaftasev
2020-06-26 16:25 szy Status new => assigned
2020-09-15 17:19 msv Target Version 7.5.0 => 7.6.0*
2020-09-23 14:50 git Note Added: 0095240
2020-09-23 15:53 kgv Summary Construction of pipe by two circular sections and spine curve leads to crash => Modeling Algorithms - Construction of pipe by two circular sections and spine curve leads to crash
2020-09-23 15:53 kgv Product Version => 7.3.0
2020-09-23 15:54 kgv Description Updated View Revisions
2020-09-24 12:49 git Note Added: 0095263
2020-09-24 15:09 git Note Added: 0095268
2020-09-24 15:14 akaftasev Assigned To akaftasev => jgv
2020-09-24 15:14 akaftasev Status assigned => resolved
2020-09-24 15:14 akaftasev Steps to Reproduce Updated View Revisions
2020-10-05 15:17 jgv Note Added: 0095729
2020-10-05 15:17 jgv Assigned To jgv => akaftasev
2020-10-05 15:17 jgv Status resolved => assigned
2020-10-16 17:48 git Note Added: 0096014
2020-10-16 17:49 git Note Added: 0096015
2020-10-16 17:50 akaftasev Assigned To akaftasev => jgv
2020-10-16 17:50 akaftasev Status assigned => resolved
2020-10-16 17:50 akaftasev Steps to Reproduce Updated View Revisions
2020-10-19 17:51 kgv Note Added: 0096061
2020-10-19 17:52 kgv Assigned To jgv => akaftasev
2020-10-19 17:52 kgv Status resolved => assigned
2020-10-19 17:52 kgv Target Version 7.6.0* => 7.5.0
2020-10-19 17:57 kgv Summary Modeling Algorithms - Construction of pipe by two circular sections and spine curve leads to crash => Modeling Algorithms, GeomFill_Pipe - construction of pipe by two circular sections and spine curve leads to crash


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker