For all issues regarding the Forums use, please, refer to the Forum Rules.

### Our Solutions

Need professional assistance?
Consider our:

Need to speed up your development?
Have a look at our:

Need some functionality extending standard OCCT capabilities?
Check out our:

# Projection Point

Forums:

Is it possible to get the projection of a given point with a given direction on a TopoDS_Shape ?
The projection isn't necessary normal as the direction is given. I don't want to work on surface but on a hole topods_shape.
Thanks in advance.

you can perhaps try the BRepIntCurveSurface_Inter class (I never used it)
Stephane

There is also the class IntCurvesFace_ShapeIntersector. We use it for tool path generation over a set of surfaces(passed as a TopoDS_Shape). We are happy with it. It is pretty fast and reliable. Moreover it gives you sorted results(i.e. points sorted along the direction of projection).
I strongly recommend you to use it with an infinite segment(actually a line). Some people get bad results with bounded computations (between finite begin and end line parameters).

thank you so much !
I'll try and tell you

ok... just another question.
There no entry for IntCurvesFace_ShapeIntersector in the documentation... :(

When I read the include file II found :
Standard_EXPORT void Perform(const gp_Lin& L,const Standard_Real PInf,const Standard_Real PSup) ;

What is PInf and Psup for ?

PInf and PSup are used to tell the algorithm to compute intersections only between those parameters along the line you specified, not the whole line.
As I told you, you should set them to RealFirst() and RealLast(), i.e. infinite values.
For more info about that subject see thread :
http://www.opencascade.org/org/forum/thread_8220/

Hi,
RealFirst() is not infinite, it is rather the first positive real value.
You should use -RealLast() for negative infinity.
BTW, why do not you use Precision::Infinite() for this purpose? I think it is more safer.

My apologizes for this mistake,
Actually I don't use these OpenCascade functions(but rather a wrapper around macro DBL_MAX). I tried to give OpenCascade equivalents for this forum and misundertood RealFirst().
-RealLast() and RealLast() should be ok.
Don't konw if it's safer but your suggestion seems far better for the sake of terminology, although the doc in the OpenCascade CDL file of ShapeIntersector_IntCurvesFace talks about using +/- RealLast() :

Perform(me: in out; L : Lin from gp;
PInf : Real from Standard;
PSup : Real from Standard)
---Purpose: Perform the intersection between the
-- segment L and the loaded shape.
--
-- PInf is the smallest parameter on the line
-- PSup is the highest parammter on the line
--
-- For an infinite line PInf and PSup can be
-- +/- RealLast.

More infos :
Precision::Infinite() returns 2 * 1.e+100
RealLast () returns DBL_MAX (1.7976931348623158e+308 in MSVC6 )

Weird : Infinite()

> Weird : Infinite() for me it is not weird. I see RealLast to be a "C++ frontier" and Infinite to be a "RealWorld frontier".
Just think about a user interface. It is better to expose the user a big value like 1e100 instead of something as cryptic as 1.79e308

just my 0.02 \$

Stephane

Dear Bearloga,

this seems not true, at least now.
With my 6.5.1 I see:
RealFirst() returned -1.7976931348623157e+308

, that is a negative value.

Mauro

Oh, yes, my mistake. I mix RealFirst with RealSmall. Indeed, RealFirst is the same as -RealLast.

### FOLLOW OPEN CASCADE

Youtube

A Capgemini Group Company