View Issue Details

IDProjectCategoryView StatusLast Update
0024813CommunityOCCT:Foundation Classespublic2014-10-29 15:26
Reporterspamkiller Assigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionwon't fix 
PlatformWindowsOSVC++ 2010 
Product Version6.7.0 
Target Version6.8.0 
Summary0024813: gp_Quaternion::SetEulerAngles and quiet NaNs
DescriptionIf you call gp_Quaternion::SetQuaternion() with quiet NaN doubles (NaN: "not a number"), gp_Quaternion::GetQuaternion() returns "0" for "a" instead of "NaN".

Steps To ReproduceCode example:
    double a = std::numeric_limits<double>::quiet_NaN();
    double b = std::numeric_limits<double>::quiet_NaN();
    double c = std::numeric_limits<double>::quiet_NaN();
    gp_Quaternion q;
    q.SetEulerAngles(gp_Intrinsic_XYZ, a, b, c);
        
    double a2 = 0;
    double b2 = 0;
    double c2 = 0;
    q.GetEulerAngles(gp_Intrinsic_XYZ, a2, b2, c2);
        
    printout(QString("a, b, c : %0 | %1 | %2").arg(a).arg(b).arg(c));
    printout(QString("a2, b2, c2 : %0 | %1 | %2").arg(a2).arg(b2).arg(c2));

Output:
  a, b, c : nan | nan | nan
  a2, b2, c2 : 0 | nan | nan

But it should be:
  a, b, c : nan | nan | nan
  a2, b2, c2 : nan | nan | nan
TagsNo tags attached.
Test case number

Activities

abv

2014-10-29 13:53

manager   ~0033820

Alexander, could you please check the issue?

aml

2014-10-29 15:03

developer   ~0033831

Dear abv,

General approach of OCCT algorithms is to work correctly under correct input data, but this data is invalid. There is no reason to handle such situations in low-level algorithms like this, because it will lead to bad performance.

abv

2014-10-29 15:26

manager   ~0033835

I agree: Euler angles are not stored in quaternion directly, but used to construct it by some algorithm. Hence, when Euler angles are requested back from quaternion, they are recomputed from quaternion definition. In general case this calculation can produce different valid answers, and there should be no expectation to get the same values as used on input. Neither quaternion is designed to work with NANs, and there is no requirement to return all NANs in the described case. Thus I close the issue as not relevant.

Issue History

Date Modified Username Field Change
2014-04-09 13:27 spamkiller New Issue
2014-04-09 13:27 spamkiller Assigned To => abv
2014-09-12 14:25 abv Target Version => 6.8.0
2014-10-29 13:53 abv Note Added: 0033820
2014-10-29 13:53 abv Assigned To abv => aml
2014-10-29 13:53 abv Status new => assigned
2014-10-29 15:03 aml Note Added: 0033831
2014-10-29 15:04 aml Assigned To aml => abv
2014-10-29 15:26 abv Note Added: 0033835
2014-10-29 15:26 abv Status assigned => closed
2014-10-29 15:26 abv Resolution open => won't fix