View Issue Details

IDProjectCategoryView StatusLast Update
0023948Open CASCADEOCCT:Modeling Algorithmspublic2014-11-11 12:58
ReporterifvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformAOSL 
Product Version6.6.0 
Target Version6.8.0Fixed in Version6.8.0 
Summary0023948: Wrong intersection between a surface of revolution and a plane.
DescriptionThe issue is aftermath of 0022766: Wrong results done by several algorithms for the case of intersection between a surface of revolution and a plane.
Source shapes are a couple of faces f1, f2.
Source shapes are attached to 0022766,

Case 2.
The intersection between two faces produces 4 curves c_1, c_2, c_3, c_4.
c_1 - seems to be Ok;
c_2 - seems to have wrong derivative on the end with maximal value of the parameter;
c_3 - is BSplineCurve[Degree 1, 2 Poles, 2 Knots]. The two poles are equal 3D-points;
c_4 - the same as c_3;
-------------
Case 3.
 c_1 is the intesection curve between s1, s2;
 The 3D-points Pi [i=1,2...NbP] are taken from c_1 at different values of the parameter.
 The distances between points Pi [i=1,2...NbP] and s2 obtained by projection algorithm are wrong.
Steps To Reproduce#-------------------
#Case 2
restore f1
restore f2
bopcurves f1 f2

#-------------------
#Case 3
restore f1
restore f2
bopcurves f1 f2
mksurf s1 f1
mksurf s2 f2
xdistcs c_1 s2 0 1 10

TagsNo tags attached.
Test case numberbugs modalg_5(010) bug23948_1,bug23948_2

Attached Files

  • cci.bmp (556,254 bytes)
  • joint.bmp (1,607,906 bytes)
  • Doc1.pdf (108,645 bytes)

Relationships

child of 0022766 closedifv Wrong results done by several algorithms for the case of intersection between a surface of revolution and a plane 

Activities

nbv

2013-07-15 15:08

developer  

cci.bmp (556,254 bytes)

nbv

2013-07-15 15:12

developer   ~0025066

Last edited: 2013-07-15 15:12

This bug is not confirmed.

On MASTER in Case # 2, existing intersection algorithm produces only two curves (c_1 and c_2). They seem to be valid. See attached “cci.bmp” file.

                Draw[]> bopcurves f1 f2
                 Tolerance Reached=8.2086287267263525e-005
                 c_1 c_2

In Case # 3, we have following output:
                Draw[]> xdistcs c_1 s1 0 1 10
                 T=0 D=0
                 T=0.111111 D=0
                 T=0.222222 D=0
                 T=0.333333 D=0
                 T=0.444444 D=0
                 T=0.555556 D=0
                 T=0.666667 D=0
                 T=0.777778 D=0
                 T=0.888889 D=0
                 T=1 D=0

                Draw[]> xdistcs c_1 s2 0 1 10
                 T=0 D=7.94411e-015
                 T=0.111111 D=1.06581e-014
                 T=0.222222 D=8.14029e-015
                 T=0.333333 D=3.97205e-015
                 T=0.444444 D=5.1022e-015
                 T=0.555556 D=1.83103e-015
                 T=0.666667 D=5.32907e-015
                 T=0.777778 D=8.88178e-016
                 T=0.888889 D=1.33227e-015
                 T=1 D=2.06009e-015

                Draw[]> xdistcs c_2 s1 0 1 10
                 T=0 D=0
                 T=0.111111 D=0
                 T=0.222222 D=0
                 T=0.333333 D=0
                 T=0.444444 D=0
                 T=0.555556 D=0
                 T=0.666667 D=0
                 T=0.777778 D=0
                 T=0.888889 D=0
                 T=1 D=0

                Draw[16]> xdistcs c_2 s2 0 1 10
                 T=0 D=7.10543e-015
                 T=0.111111 D=7.10543e-015
                 T=0.222222 D=3.55271e-015
                 T=0.333333 D=1.08052e-014
                 T=0.444444 D=1.98603e-015
                 T=0.555556 D=2.51215e-015
                 T=0.666667 D=0
                 T=0.777778 D=3.55271e-015
                 T=0.888889 D=1.33227e-015
                 T=1 D=6.49437e-017

All distances are OK.

nbv

2013-08-12 10:34

developer   ~0025282

This bug is not confirmed.

ifv

2013-08-16 17:36

developer   ~0025340

At list one defect - "c_2 - seems to have wrong derivative on the end with maximal value of the parameter", see case 2, exists and can be seen on cci.bmp;

nbv

2013-08-21 14:23

developer   ~0025365

We have an intersection the cone (shape is got by revolution of line about axis, which is not perpendicular it) and the plane. Intersection result must be hyperbola. But because we have surface of revolution (not cone), hyperbola is interpolated by B-spline. Joint of two found B- spline curves is showed in attached file joint.bmp.
This joint is smooth. There is difference in orientation only.

Do following script to make sure:

cval c_1 1 x1 y1 z1 dx1 dy1 dz1
cval c_2 1 x2 y2 z2 dx2 dy2 dz2
dset l1s dx1*dx1+dy1*dy1+dz1*dz1
dset l2s dx2*dx2+dy2*dy2+dz2*dz2
dset l1 sqrt(l1s)
dset l2 sqrt(l2s)

dset cosa (dx1*dx2+dy1*dy2+dz1*dz2)/(l1*l2)

Result value of cosa is -1.0000000000000002. I.e. 1st derivatives of c_1 and c_2 are collinear in joint.

nbv

2013-08-21 14:23

developer  

joint.bmp (1,607,906 bytes)

nbv

2013-08-21 14:25

developer   ~0025366

I think, this is no wrong.

nbv

2013-08-28 16:10

developer  

Doc1.pdf (108,645 bytes)

nbv

2013-08-28 16:31

developer   ~0025402

Last edited: 2013-08-28 17:29

In an attached Doc1.pdf file, intersection result is studied detail.
Result is the one-sheet hyperboloid (not cone, as it was said above). Cone is found, when source line is in one plane with rotation axis and they are not perpendicular. In our case these lines are skew lines.

In example, two lines (intersection result) are represented by two B-spline curves. c_2 "contains" both one line and part of second line; c_1 contains other part of the second line (see "joint.bmp").

nbv

2013-08-28 16:55

developer   ~0025404

Last edited: 2013-08-28 17:29

For confirmation of previously mentioned, let consider some points in the found curves:
Points on c_1 curve:

Parameter Point
0 (-25, -25, 24.999999999999993)
0.2 (-25, -20.000088459965539, 15.000176919931073)
0.4 (-25, -15.000176919933448, 5.0003538398668921)
0.6 (-25, -10.000265379898702, -4.999469240202596)
0.8 (-25, -5.0003538398623153, -14.999292320275362)
1 (-25, -0.00044229982700724757, -24.999115400345975)
    
Points on c_2 curve:

Parameter Point
0 (-25, 25, 25.000000000000007)
0.2 (-25, 19.997146141002126, 14.994292282004281)
0.4 (-25, 14.994292282003221, 4.9885845640064517)
0.6 (-25, 9.9914384230040998, -5.0171231539917764)
0.8 (-25, 4.9885845640038502, -15.022830871992301)
1 (-25, -0.00044229982700374126, -24.999115400345975)
    
Point (-25, -0.00044229982700374126, -24.999115400345975) is in two curves. But it is in z=-2*y-25 line, whereas point (-25, 4.9885845640038502, -15.022830871992301) (for c_2 curve) is in z=2*y-25 line. All enumerated points of c_1 curve is in z=-2*y-25 line.

nbv

2013-11-14 16:04

developer   ~0026629

Try the following script, please:

Draw[]> maxtol f1
Draw[]> maxtol f2
Draw[]> proj c_2 -25 0 -25
Draw[]> length ext_1

We get: tolerance is 3.00000e-003, extrema's length (distance between theoretical intersection point of two curves (-25, 0, -25) and found intersection curve) is 0.00082535903692036304 < tolerance.

CONCLUSION:
Intersector works properly. Cause of incorrect result is big tolerance. "Incorrect" intersection point of c_1 and c_2 curves is result of work of IntPatch_TheIWalking algorithm.

pkv

2014-08-22 07:25

developer   ~0031021

I've checked the test cases of the issue on dev version.
The problems do not exist.


The issue should be closed.

bugmaster

2014-08-26 09:54

administrator   ~0031077

Dear MKV,

Please create testing case if it is necessary

git

2014-08-26 15:20

administrator   ~0031097

Branch CR23948 has been created by mkv.

SHA-1: 6074fa18fbf3210f6430a6ec59a6d992aea2becf


Detailed log of new commits:

Author: mkv
Date: Tue Aug 26 15:18:46 2014 +0400

    Adding testing cases

Author: mkv
Date: Tue Aug 26 15:16:21 2014 +0400

    0023948: Wrong intersection between a surface of revolution and a plane.

mkv

2014-08-26 15:23

tester   ~0031098

Dear BugMaster,
test cases bugs modalg_5(010) bug23948_1,bug23948_2 are created and pushed to new git branch CR23948

git

2014-09-08 15:50

administrator   ~0031450

Branch CR23948 has been deleted by inv.

SHA-1: 6074fa18fbf3210f6430a6ec59a6d992aea2becf

Related Changesets

occt: master 6da50d26

2014-08-28 10:50:35

mkv


Committer: bugmaster Details Diff
0023948: Wrong intersection between a surface of revolution and a plane.

Adding testing cases
Affected Issues
0023948
add - tests/bugs/modalg_5/bug23948_1 Diff File
add - tests/bugs/modalg_5/bug23948_2 Diff File

Issue History

Date Modified Username Field Change
2013-05-08 12:05 ifv New Issue
2013-05-08 12:05 ifv Assigned To => ifv
2013-05-08 12:07 ifv Relationship added child of 0022766
2013-07-08 10:53 ifv Assigned To ifv => nbv
2013-07-15 15:08 nbv File Added: cci.bmp
2013-07-15 15:12 nbv Note Added: 0025066
2013-07-15 15:12 nbv Note Edited: 0025066
2013-08-12 10:34 nbv Note Added: 0025282
2013-08-12 10:34 nbv Assigned To nbv => ifv
2013-08-12 10:34 nbv Status new => resolved
2013-08-16 17:36 ifv Note Added: 0025340
2013-08-16 17:36 ifv Status resolved => feedback
2013-08-21 14:23 nbv Note Added: 0025365
2013-08-21 14:23 nbv File Added: joint.bmp
2013-08-21 14:25 nbv Note Added: 0025366
2013-08-28 16:10 nbv File Added: Doc1.pdf
2013-08-28 16:31 nbv Note Added: 0025402
2013-08-28 16:55 nbv Note Added: 0025404
2013-08-28 16:57 nbv Note Edited: 0025404
2013-08-28 17:29 nbv Note Edited: 0025402
2013-08-28 17:29 nbv Note Edited: 0025404
2013-11-14 16:04 nbv Note Added: 0026629
2013-11-15 12:11 ifv Assigned To ifv => pkv
2013-11-15 12:11 ifv Status feedback => resolved
2013-12-21 10:13 abv Target Version 6.7.0 => 6.7.1
2014-04-04 17:11 abv Target Version 6.7.1 => 6.8.0
2014-08-22 07:25 pkv Note Added: 0031021
2014-08-22 07:26 pkv Assigned To pkv => inv
2014-08-22 07:26 pkv Status resolved => feedback
2014-08-22 08:38 abv Summary Bug is second part of 0022766:Wrong results done by several algorithms for the case of intersection between a surface of revoluti => Wrong intersection between a surface of revolution and a plane.
2014-08-22 08:38 abv Description Updated
2014-08-26 09:53 bugmaster Assigned To inv => mkv
2014-08-26 09:54 bugmaster Note Added: 0031077
2014-08-26 15:20 git Note Added: 0031097
2014-08-26 15:23 mkv Note Added: 0031098
2014-08-26 15:23 mkv Test case number => bugs modalg_5(010) bug23948_1,bug23948_2
2014-08-26 15:23 mkv Assigned To mkv => bugmaster
2014-08-26 15:23 mkv Status feedback => tested
2014-08-29 15:32 bugmaster Changeset attached => occt master 6da50d26
2014-08-29 15:32 bugmaster Status tested => verified
2014-08-29 15:32 bugmaster Resolution open => fixed
2014-09-08 15:50 git Note Added: 0031450
2014-11-11 12:45 aiv Fixed in Version => 6.8.0
2014-11-11 12:58 aiv Status verified => closed