MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026746Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2015-10-02 15:572016-04-20 15:49
Reporternbv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.0.0Fixed in Version[OCCT] 7.0.0 
Summary0026746: Method gp_Torus::Coefficients(...) returns incorrect value.
DescriptionIndeed, if set of points (X, Y, Z) constitute torus then values X, Y and Z rest on equation degree four. Theoretically, these equation must have 35 terms. However, existing method Coefficients(...) returns 31 only.
Steps To ReproduceTest case for this issue has already been created and pushed to the CR26746 branch.
Additional information
and documentation updates
General representation of the equation is:

Coef(1) * X^4 + Coef(2) * Y^4 + Coef(3) * Z^4 + Coef(4) * X^3 * Y + Coef(5) * X^3 * Z + Coef(6) * Y^3 * X + Coef(7) * Y^3 * Z + Coef(8) * Z^3 * X + Coef(9) * Z^3 * Y + Coef(10) * X^2 * Y^2 + Coef(11) * X^2 * Z^2 + Coef(12) * Y^2 * Z^2 + Coef(13) * X^2 * Y * Z + Coef(14) * X * Y^2 * Z + Coef(15) * X * Y * Z^2 + Coef(16) * X^3 + Coef(17) * Y^3 + Coef(18) * Z^3 + Coef(19) * X^2 * Y + Coef(20) * X^2 * Z + Coef(21) * Y^2 * X + Coef(22) * Y^2 * Z + Coef(23) * Z^2 * X + Coef(24) * Z^2 * Y + Coef(25) * X * Y * Z + Coef(26) * X^2 + Coef(27) * Y^2 + Coef(28) * Z^2 + Coef(29) * X * Y + Coef(30) * X * Z + Coef(31) * Y * Z + Coef(32) * X + Coef(33) * Y + Coef(34) * Z + Coef(35) = 0.0
TagsNo tags attached.
Test case numberbugs modalg_6 bug26746
Attached Files? file icon torus.wxm (911 bytes) 2015-10-09 13:16

- Relationships
related to 0025605closedmsv Optimize methods of gp_* classes to avoid sqrt() function calling 

-  Notes
(0046407)
git (administrator)
2015-10-02 16:16

Branch CR26746 has been created by nbv.

SHA-1: 6ef43bc930900b860104f62751846c1b1b619790


Detailed log of new commits:

Author: nbv
Date: Fri Oct 2 16:15:50 2015 +0300

    0026746: Method gp_Torus::Coefficients(...) returns incorrect value.
    
    Bug has been fixed.
(0046410)
git (administrator)
2015-10-02 16:25

Branch CR26746 has been updated forcibly by nbv.

SHA-1: e1136f08d9c39a470f01165560c1583d3b9d7576
(0046412)
nbv (developer)
2015-10-02 16:40

Dear Mikhail,

Please review the current state of CR26746 branch.

Ask to pay attention to the fact that the value of aTcol1sq, aTcol2sq etc. (see gp_Torus::Coefficients(...) method in the branch) are always equal to 1 for true orthogonal transformation matrix. Analogical, value aTcol1Tcol2, aTcol1Tcol3 etc. are always equal to 0.

Nevertheless, every matrix is always orthogonal really with some precision. Additional, if coefficient value is equal to 0 it is not the reason to ignore it (it is better to return 0).
(0046438)
git (administrator)
2015-10-05 09:53

Branch CR26746 has been updated forcibly by nbv.

SHA-1: 65e21235255bd3635698f4230648bf4dc82f77f5
(0046565)
msv (developer)
2015-10-07 15:34

Dear Igor, could you please review this patch?
(0046619)
ifv (developer)
2015-10-09 11:41

The base equation used for coefficients deriving seems to be wrong:
4*R*R*(r*r - Z*Z) = (X*X + Y*Y + Z*Z - R*R - r*r)^2
The correct equation is:
4*R*R*(r*r - Z*Z) = (X*X + Y*Y + Z*Z + R*R - r*r)^2
(0046621)
nbv (developer)
2015-10-09 13:15
edited on: 2015-10-09 14:28

Dear Igor,

Let check equation with constant parameters:
Major radius is equal to 100;
Minor radius is equal to 70.

Then for angles \theta = \frac{\pi }{3}, \varphi = \frac{\pi }{6} we will obtain:

x(\theta , \varphi ) = \frac{5\cdot {{3}^{\frac{7}{2}}}}{2}\\
y(\theta , \varphi ) = \frac{135}{2}\\
z(\theta , \varphi ) = 35\cdot \sqrt{3}.

In this case,
  equation

4*R*R*(r*r - Z*Z) - (X*X + Y*Y + Z*Z - R*R - r*r)^2 == 0.0,

  equation
4*R*R*(r*r - Z*Z) - (X*X + Y*Y + Z*Z + R*R - r*r)^2 == -680000000.

Therefore, my formula is correct.

P.S.

1. Every formula in this message can be decoded with http://www.codecogs.com/latex/eqneditor.php [^]

2. I have attached the file (torus.wxm) with computations in MAXIMA environment (http://andrejv.github.io/wxmaxima/ [^]).

(0046624)
ifv (developer)
2015-10-09 14:23

Sorry for mistake, Wiki is correct, its formulae is:
4*R*R*(X*X + Y*Y) = (X*X + Y*Y + Z*Z + R*R - r*r)^2
Your formulae
4*R*R*(r*r - Z*Z) = (X*X + Y*Y + Z*Z - R*R - r*r)^2
seems to be equivalent to Wiki one.
(0046636)
apv (tester)
2015-10-09 16:44

Dear nbv,

Please rebase branch CR26746 to the current master. Thank you in advance.
(0046638)
git (administrator)
2015-10-09 17:49

Branch CR26746 has been updated forcibly by nbv.

SHA-1: 6205ce8e12d1dba01dd284196eb65109c70877c4
(0046639)
isn (developer)
2015-10-09 17:50

Branch CR26746 has been rebased on the current MASTER.
(0046680)
apv (tester)
2015-10-12 16:30

Dear BugMaster,

Branch CR26746 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 6205ce8e12d1dba01dd284196eb65109c70877c4

Number of compiler warnings:
occt component:
   Linux: 13 (13 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 39 (39 on master)
   Windows: 0 (0 on master)

Regressions/Differences:
Not detected

Testing cases:
bugs modalg_6 bug26746 - OK
http://occt-tests/CR26746-master-occt-64/Debian70-64/bugs/modalg_6/bug26746.html [^]
http://occt-tests/CR26746-master-occt-64/Windows-64-VC10/bugs/modalg_6/bug26746.html [^]

Testing on Linux:
Total MEMORY difference: 91931881 / 92516896 [-0.63%]
Total CPU difference: 19471.659999999825 / 19402.610000000048 [+0.36%]

Testing on Windows:
Total MEMORY difference: 58089457 / 58098989 [-0.02%]
Total CPU difference: 18219.247589298928 / 18016.040686698903 [+1.13%]
(0047122)
git (administrator)
2015-10-16 17:02

Branch CR26746 has been deleted by kgv.

SHA-1: 6205ce8e12d1dba01dd284196eb65109c70877c4

- Related Changesets
occt: master 0b4abfb9
Timestamp: 2015-10-09 14:48:36
Author: nbv
Committer: bugmaster
Details ] Diff ]
0026746: Method gp_Torus::Coefficients(...) returns incorrect value.

Bug has been fixed.
Test case for this issue has been created (with corresponding DRAW-command).
mod - src/gp/gp_Torus.cxx Diff ] File ]
mod - src/gp/gp_Torus.hxx Diff ] File ]
mod - src/QABugs/QABugs_19.cxx Diff ] File ]
add - tests/bugs/modalg_6/bug26746 Diff ] File ]

- Issue History
Date Modified Username Field Change
2015-10-02 15:57 nbv New Issue
2015-10-02 15:57 nbv Assigned To => msv
2015-10-02 16:13 nbv Status new => assigned
2015-10-02 16:16 git Note Added: 0046407
2015-10-02 16:25 git Note Added: 0046410
2015-10-02 16:40 nbv Note Added: 0046412
2015-10-02 16:40 nbv Status assigned => resolved
2015-10-02 16:40 nbv Steps to Reproduce Updated View Revisions
2015-10-02 17:43 nbv Relationship added related to 0025605
2015-10-05 09:53 git Note Added: 0046438
2015-10-07 15:34 msv Note Added: 0046565
2015-10-07 15:34 msv Assigned To msv => ifv
2015-10-09 11:41 ifv Note Added: 0046619
2015-10-09 11:41 ifv Assigned To ifv => nbv
2015-10-09 11:41 ifv Status resolved => feedback
2015-10-09 13:15 nbv Note Added: 0046621
2015-10-09 13:16 nbv File Added: torus.wxm
2015-10-09 13:18 nbv Note Edited: 0046621 View Revisions
2015-10-09 13:23 nbv Assigned To nbv => ifv
2015-10-09 14:23 ifv Note Added: 0046624
2015-10-09 14:23 ifv Assigned To ifv => bugmaster
2015-10-09 14:23 ifv Status feedback => reviewed
2015-10-09 14:28 nbv Note Edited: 0046621 View Revisions
2015-10-09 15:53 apv Assigned To bugmaster => apv
2015-10-09 16:44 apv Note Added: 0046636
2015-10-09 16:44 apv Assigned To apv => nbv
2015-10-09 16:44 apv Status reviewed => feedback
2015-10-09 17:49 git Note Added: 0046638
2015-10-09 17:49 isn Assigned To nbv => apv
2015-10-09 17:50 isn Note Added: 0046639
2015-10-09 17:50 isn Assigned To apv => msv
2015-10-09 17:50 isn Status feedback => resolved
2015-10-09 17:50 isn Assigned To msv => bugmaster
2015-10-09 17:50 isn Status resolved => reviewed
2015-10-09 17:54 apv Assigned To bugmaster => apv
2015-10-12 15:48 apv Test case number => bugs modalg_6 bug26746
2015-10-12 16:30 apv Note Added: 0046680
2015-10-12 16:30 apv Assigned To apv => bugmaster
2015-10-12 16:30 apv Status reviewed => tested
2015-10-16 13:18 bugmaster Changeset attached => occt master 0b4abfb9
2015-10-16 13:18 bugmaster Status tested => verified
2015-10-16 13:18 bugmaster Resolution open => fixed
2015-10-16 17:02 git Note Added: 0047122
2016-04-20 15:44 aiv Fixed in Version => 7.0.0
2016-04-20 15:49 aiv Status verified => closed


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker