DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0025368

BREPExtrma DistShapeShape gives wrong result for Sphere and Line

CommunityOCCT:Modeling Algorithmsclosed11 public notes

Search issues

Description

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.

Public activity

11 archived notes

Participants are labeled by their role within this record.

01Author
Always was the wrong word. The result for the sphere is correct at it poles.
02Author
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.[revision removed]-15, 0.40000000000000024))
# support geom [('Edge', 0, 3.524202037341219, 'Edge', 1, 6.363270887213245)])

03Author
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

04Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


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.
05Commenter 5
Dear ifv,
Please check current state of branch CR25368.

Fixed analytical extrema sphere / line algorithm.
06Commenter 6
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.
07Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
08Commenter 8
Dear ifv,

Please check current state of branch CR25368.
09Commenter 9
Ok
10Commenter 10
Dear Commenter 1,

Branch CR25368 (and products from GIT master) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

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
11Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]