MantisBT - Community
View Issue Details
0025368Community[OCCT] OCCT:Modeling Algorithmspublic2014-10-14 15:482014-11-12 09:53
shoogen 
bugmaster 
normalminor 
closedfixed 
LinuxDebian 6.064 bit
[OCCT] 6.7.1 
[OCCT] 6.8.0[OCCT] 6.8.0 
bugs modalg_5(010) bug25368_1, bug25368_2
0025368: BREPExtrma DistShapeShape gives wrong result for Sphere and Line
I want to get the the intersection point of a Face (or Shell) and a Line. This works well with cylindrical and conical surfaces. But for a sphere there is always a non-zero distance reported, even thou there is an intersection.
No tags attached.
png sphere-edge-solution.png (30,559) 2014-10-15 00:11
https://tracker.dev.opencascade.org/
Issue History
2014-10-14 15:48shoogenNew Issue
2014-10-14 15:48shoogenAssigned To => ifv
2014-10-14 15:57shoogenNote Added: 0033069
2014-10-14 16:09ifvAssigned Toifv => aml
2014-10-14 16:10ifvStatusnew => assigned
2014-10-14 23:50shoogenNote Added: 0033090
2014-10-14 23:59shoogenNote Edited: 0033090bug_revision_view_page.php?bugnote_id=33090#r8374
2014-10-15 00:11shoogenFile Added: sphere-edge-solution.png
2014-10-15 00:39shoogenNote Added: 0033091
2014-10-15 00:59shoogenNote Edited: 0033091bug_revision_view_page.php?bugnote_id=33091#r8376
2014-10-24 09:46gitNote Added: 0033670
2014-10-24 09:50amlNote Added: 0033671
2014-10-24 09:50amlAssigned Toaml => ifv
2014-10-24 09:50amlStatusassigned => resolved
2014-10-24 10:16ifvNote Added: 0033674
2014-10-24 10:16ifvStatusresolved => feedback
2014-10-27 10:49amlAssigned Toifv => aml
2014-10-27 13:40gitNote Added: 0033719
2014-10-27 13:45amlNote Added: 0033720
2014-10-27 13:45amlAssigned Toaml => ifv
2014-10-27 13:45amlStatusfeedback => resolved
2014-10-27 16:02ifvNote Added: 0033732
2014-10-27 16:02ifvAssigned Toifv => bugmaster
2014-10-27 16:02ifvStatusresolved => reviewed
2014-10-27 18:12apvAssigned Tobugmaster => apv
2014-10-28 16:20apvTest case number => bugs modalg_5(010) bug25368_1, bug25368_2
2014-10-28 16:23apvNote Added: 0033777
2014-10-28 16:23apvAssigned Toapv => bugmaster
2014-10-28 16:23apvStatusreviewed => tested
2014-10-30 10:17bugmasterTarget Version => 6.8.0
2014-10-31 14:03bugmasterChangeset attached => occt master db914841
2014-10-31 14:03bugmasterStatustested => verified
2014-10-31 14:03bugmasterResolutionopen => fixed
2014-11-11 12:43aivFixed in Version => 6.8.0
2014-11-11 13:03aivStatusverified => closed
2014-11-12 09:53gitNote Added: 0034321

Notes
(0033069)
shoogen   
2014-10-14 15:57   
Always was the wrong word. The result for the sphere is correct at it poles.
(0033090)
shoogen   
2014-10-14 23:50   
(edited on: 2014-10-14 23:59)
the sympton is that the result should include Face/Edge solution, which it does not.

psphere Sphere 5 -90 90 360
polyline Line 0 0 0.2 10 10 0.2

#i haven't yet found out how to reproduce in DRAWEXE
>>> e=doc.Line.Shape.Edges[0]
>>> s=doc.Sphere.Shape.Shells[0]
>>> e.distToShape(s)
#
# distance 3.5298725189445594
# solution1 (Vector (2.4919871588754225, 2.4919871588754225, 0.2), Vector (4.983974317750845, -1.220721639053237e-15, 0.40000000000000024))
# support geom [('Edge', 0, 3.524202037341219, 'Edge', 1, 6.363270887213245)])

(0033091)
shoogen   
2014-10-15 00:39   
(edited on: 2014-10-15 00:59)
I tried
> psphere Sphere 5 -90 90 360
> polyline Line 0 0 0.2 10 10 0.2
> explode Sphere Sh
> explode Line E
> dist Line_1 Sphere_1
#did not return a result
> distmini d Line_1 Sphere_1
the distance value is : 3.52987
the number of solutions is :1

solution number 1:
the type of the solution on the first shape is 1
the type of the solution on the second shape is 1
the coordinates of the point on the first shape are:
X=2.49199 Y=2.49199 Z=0.2
the coordinates of the point on the second shape are:
X=4.98397 Y=-1.22072e-15 Z=0.4
parameter on the first edge : t= 3.5242
parameter on the second edge : t=6.36327

d_val d

(0033670)
git   
2014-10-24 09:46   
Branch CR25368 has been created by aml.

SHA-1: 95e6c80273613fe712dd7e64f2680a9c7f82e68e


Detailed log of new commits:

Author: aml
Date: Fri Oct 24 07:44:40 2014 +0400

    0025368: BREPExtrma DistShapeShape gives wrong result for Sphere and Line
    
    Changed analytical Sphere/Line extrema algorithm.
    Test cases added.
(0033671)
aml   
2014-10-24 09:50   
Dear ifv,
Please check current state of branch CR25368.

Fixed analytical extrema sphere / line algorithm.
(0033674)
ifv   
2014-10-24 10:16   
1. There is class, which intersects line and sphere, so it i9s not necessary to write new code in Extrema algo.
2. I think, bechaviour of analitycal Extrema must remain unchanged, intersector algo it is better to use on level of BRepExtrema.
(0033719)
git   
2014-10-27 13:40   
Branch CR25368 has been updated forcibly by aml.

SHA-1: 8177fdd552646c6cd19d1088eae51041af85adec
(0033720)
aml   
2014-10-27 13:45   
Dear ifv,

Please check current state of branch CR25368.
(0033732)
ifv   
2014-10-27 16:02   
Ok
(0033777)
apv   
2014-10-28 16:23   
Dear BugMaster,

Branch CR25368 (and products from GIT master) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 8177fdd552646c6cd19d1088eae51041af85adec

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 11 (11 on master)
   Windows: 1 (1 on master)

Regressions/Differences:
Not detected

Testing cases:
bugs modalg_5(010) bug25368_1 - OK
http://occt-tests/CR25368-master-occt/Debian60-64/bugs/modalg_5/bug25368_1.html [^]
http://occt-tests/CR25368-master-occt/Windows-32-VC10/bugs/modalg_5/bug25368_1.html [^]
bugs modalg_5(010) bug25368_2 - OK
http://occt-tests/CR25368-master-occt/Debian60-64/bugs/modalg_5/bug25368_2.html [^]
http://occt-tests/CR25368-master-occt/Windows-32-VC10/bugs/modalg_5/bug25368_2.html [^]

Testing on Linux:
Total MEMORY difference: 371838292 / 371808660
Total CPU difference: 47225.109999999935 / 48296.64000000005

Testing on Windows:
Total MEMORY difference: 276412396 / 273080016
Total CPU difference: 38675.0 / 37050.71875
(0034321)
git   
2014-11-12 09:53   
Branch CR25368 has been deleted by inv.

SHA-1: 8177fdd552646c6cd19d1088eae51041af85adec