View Issue Details

IDProjectCategoryView StatusLast Update
0031661Open CASCADEOCCT:Modeling Algorithmspublic2022-06-19 15:03
Reporterazv Assigned Toifv  
PrioritynormalSeverityminor 
Status verifiedResolutionfixed 
Product Version7.4.0 
Target Version7.6.3 
Summary0031661: Modeling Data - Algorithm crashes when projecting parabola or hyperbola to plane
DescriptionProjection of parabola or hyperbola to plane, which is not parallel to the curve's plane, leads to the exception in the most cases (ref. Steps to Reproduce). The problem is that ProjLib_ProjectOnPlane cannot provide a canonical curve as a projection of corresponding types of curves and tries to generate infinite B-spline curve. This is not the case for the trimmed curve, but even in this case the projected curve is a B-spline curve.

The main goal of this issue is to provide the canonical curve as a projection of a canonical curve in both cases: trimmed and infinite.
Steps To Reproduce
parabola p 0 0 0  1 1 1  2 0 -2  10
plane pln 0 0 0  0 0 1
projonplane r p pln 0
# OSD_Exception_ACCESS_VIOLATION

hyperbola h 0 0 0  1 1 1  2 0 -2  10 10
plane pln 0 0 0  0 0 1
projonplane r h pln 0
#  Standard_NumericError: Result of Cosh exceeds the maximum value Standard_Real
TagsNo tags attached.
Test case numberbugs/moddata_3/bug31661_1, bugs/moddata_3/bug31661_2

Activities

git

2022-03-10 14:31

administrator   ~0107254

Branch CR31661 has been created by ifv.

SHA-1: cb6ea043d9b984355a14e523ef8338470182de83


Detailed log of new commits:

Author: ifv
Date: Thu Mar 3 15:05:23 2022 +0300

    0031661: Modeling Data - Exception when projecting parabola or hyperbola to plane
    
    ProjLib/ProjLib_ProjectOnPlane.cxx - formatting

Author: ifv
Date: Fri Mar 4 15:42:03 2022 +0300

    Project of Parabola

git

2022-03-16 16:36

administrator   ~0107305

Branch CR31661 has been updated by ifv.

SHA-1: 5a5a9e6a5f727355df81c27cab676d342bdfc4ef


Detailed log of new commits:

Author: ifv
Date: Wed Mar 16 10:37:19 2022 +0300

    Last modification for hyperbola

git

2022-03-18 12:17

administrator   ~0107343

Branch CR31661 has been updated forcibly by ifv.

SHA-1: e65f3bae9f7a7e09b8cd8a4e37ee7d0340607379

git

2022-03-18 12:33

administrator   ~0107344

Branch CR31661 has been updated forcibly by ifv.

SHA-1: ff051f4d5c65530c543f88c1cb94be3a3e3710b0

git

2022-03-21 09:59

administrator   ~0107371

Branch CR31661 has been updated forcibly by ifv.

SHA-1: 70f057d2ca636a168cd625619cf6409aa9b90f81

ifv

2022-03-21 16:02

developer   ~0107377

Branch CR31661 is ready for review

Branches for integration:
OCCT - CR31661
Products - not

Test results:
http://jenkins-test-08.nnov.opencascade.com/view/CR31661-master-IFV/view/COMPARE/

azv

2022-03-22 08:22

administrator   ~0107385

Last edited: 2022-03-22 08:24

Dear Igor,

1. I get an exception on the following scenario:
plane pln 0 0 0  0 0 1
parabola p 0 0 0  0 1 0  2 0 -1  10
trim pp p -100 200
projonplane r pp pln 0


2. I've found the following code
892:      myFirstPar = GeomLinePtr->FirstParameter();
893:      myLastPar = GeomLinePtr->LastParameter();
894:      if (!isFInfinite)
895:      {
896:        gp_Pnt aP = myCurve->Value(myCurve->FirstParameter());
897:        aP = ProjectPnt(myPlane, myDirection, aP);
898:        myFirstPar = ElCLib::LineParameter(aLine.Position(), aP);
899:      }
900:      if (!isLInfinite)
901:      {
902:        gp_Pnt aP = myCurve->Value(myCurve->LastParameter());
903:        aP = ProjectPnt(myPlane, myDirection, aP);
904:        myLastPar = ElCLib::LineParameter(aLine.Position(), aP);
905:      }
906:      myResult = new GeomAdaptor_Curve(GeomLinePtr, myFirstPar, myLastPar);

which repeats several times. I propose to implement a separate method providing this code.

3. Magic number in the following code. Couldn't we use Precision::Infinite() instead?
1012:        Standard_Real aHugePar = 20000;

And here, why did you use 10?
1140:        Standard_Real aHugePar = 10;


4. Could you also split the test case for parabola and hyperbola individually?

git

2022-03-30 18:41

administrator   ~0107486

Branch CR31661 has been updated forcibly by ifv.

SHA-1: 18497cb64e765e7092130a0049f30335b7fb17b1

git

2022-03-30 18:44

administrator   ~0107487

Branch CR31661 has been updated forcibly by ifv.

SHA-1: 96585f58c8fdc4f2547b00afe9ade3ecd5e88fca

git

2022-03-31 09:06

administrator   ~0107497

Branch CR31661 has been updated forcibly by ifv.

SHA-1: 7e3fa97922cf70cccdbf790fd6e7efd7a4604aa7

ifv

2022-04-01 10:10

developer   ~0107534

Branch CR31661 is ready for review

Test results
http://jenkins-test-08.nnov.opencascade.com/view/CR31661-master-IFV/view/COMPARE/

Branches for integration:
OCCT - CR31661
Products - not

Using "magic" numbers for restricting parabola and hyperbola parameters are necessary to prevent floating overflow and exceptions during approximation.

smoskvin

2022-04-05 10:06

administrator   ~0107624

Warning on VC12 Windows
 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Project : CR0-WEEK-14_CR0-WEEK-14-OCCT-Windows-64-VC12-opt-compile
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

New warnings appears: 1
 
Type : MSBuild
Category : C4512
File Name : E:/builds/CR0-WEEK-14_CR0-WEEK-14/OCCT_SRC/src/ProjLib/ProjLib_ProjectOnPlane.cxx
Line : 333
Message : ProjLib_MaxCurvature : assignment operator could not be generated

git

2022-04-05 11:25

administrator   ~0107632

Branch CR31661 has been updated forcibly by ifv.

SHA-1: ffae619c325d42c54db7613946aa50ed7c4fef8a

ifv

2022-04-05 11:29

developer   ~0107633

Branch CR31661 is updated in order to remove warning on VC12,
please check

smoskvin

2022-04-09 09:50

administrator   ~0107788

Combination -
OCCT branch : IR-2022-04-08
master SHA - 7021de2fe7a69d4c788ccf43b8b096dbcc8597c8
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2022-04-08 SHA - e16d959d441765c483049307ba7293173532103a
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: 18452.87000000039 / 18490.94000000032 [-0.21%]
Products
Total CPU difference: 11761.310000000152 / 11719.920000000124 [+0.35%]
Windows-64-VC14:
OCCT
Total CPU difference: 20539.828125 / 20552.71875 [-0.06%]
Products
Total CPU difference: 13248.21875 / 13242.609375 [+0.04%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2022-04-10 10:49

administrator   ~0107814

Branch CR31661 has been deleted by mnt.

SHA-1: ffae619c325d42c54db7613946aa50ed7c4fef8a

Related Changesets

occt: master 1f37f1d5

2022-03-03 15:05:23

ifv


Committer: smoskvin Details Diff
0031661: Modeling Data - Exception when projecting parabola or hyperbola to plane

ProjLib/ProjLib_ProjectOnPlane.cxx - formatting

0031661: Modeling Data - Algorithm crashes when projecting parabola or hyperbola to plane

ProjLib/ProjLib_ProjectOnPlane.cxx - building of analytical parabola and hyperbola is added
bugs/moddata_3/bug31661_* - new test cases are added
Affected Issues
0031661
mod - src/ProjLib/ProjLib_ProjectOnPlane.cxx Diff File
mod - src/ProjLib/ProjLib_ProjectOnPlane.hxx Diff File
add - tests/bugs/moddata_3/bug31661_1 Diff File
add - tests/bugs/moddata_3/bug31661_2 Diff File

Issue History

Date Modified Username Field Change
2020-07-10 08:49 azv New Issue
2020-07-10 08:49 azv Assigned To => msv
2020-09-15 11:40 msv Target Version 7.5.0 => 7.6.0
2021-08-29 18:53 msv Target Version 7.6.0 => 7.7.0
2022-03-03 10:47 ifv Assigned To msv => ifv
2022-03-04 15:22 ifv Time allocated 1.3.2022: 4 h. => set
2022-03-04 15:23 ifv Time allocated 2.3.2022: 4 h. => set
2022-03-04 15:23 ifv Time allocated 3.3.2022: 4 h. => set
2022-03-04 15:24 ifv Time allocated 4.3.2022: 5 h. => set
2022-03-10 14:31 git Note Added: 0107254
2022-03-11 14:37 ifv Time allocated 7.3.2022: 5.5 h. => set
2022-03-11 14:38 ifv Time allocated 9.3.2022: 6.5 h. => set
2022-03-11 14:39 ifv Time allocated 10.3.2022: 4.5 h. => set
2022-03-11 14:40 ifv Time allocated 11.3.2022: 6.5 h. => set
2022-03-16 16:36 git Note Added: 0107305
2022-03-18 10:28 ifv Summary Exception when projecting parabola or hyperbola to plane => Modeling Data - Exception when projecting parabola or hyperbola to plane
2022-03-18 10:57 ifv Summary Modeling Data - Exception when projecting parabola or hyperbola to plane => Modeling Data - Algorithm crahes when projecting parabola or hyperbola to plane
2022-03-18 12:17 git Note Added: 0107343
2022-03-18 12:20 ifv Summary Modeling Data - Algorithm crahes when projecting parabola or hyperbola to plane => Modeling Data - Algorithm crashes when projecting parabola or hyperbola to plane
2022-03-18 12:21 ifv Test case number => bugs/moddata_3/bug31661
2022-03-18 12:33 git Note Added: 0107344
2022-03-18 16:04 ifv Time allocated 18.3.2022: 32 h. => set
2022-03-18 16:34 ifv Status new => assigned
2022-03-21 09:59 git Note Added: 0107371
2022-03-21 16:02 ifv Assigned To ifv => azv
2022-03-21 16:02 ifv Status assigned => resolved
2022-03-21 16:02 ifv Note Added: 0107377
2022-03-22 08:22 azv Assigned To azv => ifv
2022-03-22 08:22 azv Status resolved => assigned
2022-03-22 08:22 azv Note Added: 0107385
2022-03-22 08:23 azv Note Edited: 0107385
2022-03-22 08:24 azv Note Edited: 0107385
2022-03-30 18:41 git Note Added: 0107486
2022-03-30 18:44 git Note Added: 0107487
2022-03-31 09:06 git Note Added: 0107497
2022-04-01 10:04 ifv Test case number bugs/moddata_3/bug31661 => bugs/moddata_3/bug31661_1, bugs/moddata_3/bug31661_2
2022-04-01 10:10 ifv Assigned To ifv => azv
2022-04-01 10:10 ifv Status assigned => resolved
2022-04-01 10:10 ifv Note Added: 0107534
2022-04-01 14:56 ifv Time allocated 1.4.2022: 5 h. => set
2022-04-02 21:49 azv Assigned To azv => bugmaster
2022-04-02 21:49 azv Status resolved => reviewed
2022-04-05 10:06 smoskvin Assigned To bugmaster => ifv
2022-04-05 10:06 smoskvin Status reviewed => assigned
2022-04-05 10:06 smoskvin Note Added: 0107624
2022-04-05 11:25 git Note Added: 0107632
2022-04-05 11:29 ifv Assigned To ifv => smoskvin
2022-04-05 11:29 ifv Status assigned => resolved
2022-04-05 11:29 ifv Note Added: 0107633
2022-04-06 10:29 smoskvin Assigned To smoskvin => bugmaster
2022-04-06 10:29 smoskvin Status resolved => reviewed
2022-04-09 09:50 smoskvin Status reviewed => tested
2022-04-09 09:50 smoskvin Note Added: 0107788
2022-04-10 10:42 smoskvin Changeset attached => occt master 1f37f1d5
2022-04-10 10:42 ifv Assigned To bugmaster => ifv
2022-04-10 10:42 ifv Status tested => verified
2022-04-10 10:42 ifv Resolution open => fixed
2022-04-10 10:49 git Note Added: 0107814
2022-04-11 15:16 ifv Time allocated 5.4.2022: 2 h. => set
2022-06-19 15:03 azv Target Version 7.7.0 => 7.6.3