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

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


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

Samples & Tools


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

Adv. Components

Related pages

Help pleeeeeeeeeese

Marei's picture

I used GeomAPI_IntCS to compute intersection on 10000 lines with one face successfully but the performance was so slow. I read on other thread that using IntCurvesFace_ShapeIntersector will be more quicker but I do not know how to use it. Also, I can not find any example about it. Please help me to use IntCurvesFace_ShapeIntersector by any simple example.

Marei's picture

please any example how to use IntCurvesFace_ShapeIntersector?

Bearloga's picture

What is the problem with this class? It have usual methods Load, Perform, IsDone, then use the methods NbPnt, Pnt, UParameter, VParameter, WParameter to get the result.

Marei's picture

Thanks Bearloga for your response.

I have problem loading one surface and lines to this class. Would you please tell me how to load that?

Thanks in advance.

Bearloga's picture

Organize a loop on lines, and call Perform in loop:

TopoDS_Face aFace = ...;
gp_Lin lins[] = ...;
int nblin = ...;
IntCurvesFace_ShapeIntersector shint;
shint.Load(sh, tol);
for (int i=1; i {
shint.Perform(lins[i], -RealLast(), RealLast());
if (!shint.IsDone()) continue;
for (int j=1; j {
const gp_Pnt& aPnt = shint.Pnt(j);
// ... and so on

Marei's picture

Thanks soooooooooo much Mr Bearloga. That is great. It works fine now.
One thing I could not understand in shint.Load(sh, tol); and nothing in documentation about it. Would you please explain what is tol please?

Thank you very much.

Bearloga's picture

See doc on the class IntCurvesFace_Intersector, there the meaning of tolerance is explained.

Marei's picture

In the doc it said:

The Tolerance is used to determine if the
first point of the segment is near the face. In
that case, the parameter of the intersection point
on the line can be a negative value (greater than -Tol).

I suppose the first point of the segment is not only near the surface but also always on the surface itself (if my assumption that the first point of the segment= first intersection) so Tol is not required. What I am missing here please?
By the way does IntCurvesFace_Intersector and IntCurvesFace_ShapeIntersector are similar?

Thanks very much

Bearloga's picture

You cannot be 100% sure that two double values are totally equal (except the case when one of them is a product of assignment operation from another), therefore your intersection point lies on the face with some tolerance. By the way, intersection point itself is computed by approximation (with b-spline surfaces at least).
If you looked at the source code you could see that IntCurvesFace_ShapeIntersector uses IntCurvesFace_Intersector as an external tool. The first one works on the whole shape, while the second one accepts only one face.

Marei's picture

Am I right for the following assumptions:
- is it the distance value between the approximated intersection value and face.
- if I se it to 0 (zero) or less it should lie on the face.
- reasonably 1 is okay.

Thanks very much

Bearloga's picture

I looked in the code of Intersector and found that doc is false, indeed Tol is used when invoking classifier of an intersection point in the boundaries of the face (it is a value that used by classifier to decide whether a 2d point lies on a curve of boundary or not). So I think the best you can use is Precision::Confusion() for that.

Marei's picture

By that, my big troubles fixed.
This so much Mr Bearloga.

Marei's picture

By that, my big troubles fixed.
Thanks so much Mr Bearloga.

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.