# Intersect an axis with shapes

Hi all,

I have to compute the intersection points between an axis and a set of shapes(the whole CAD model actually). From that I have to find the intersection point whose z coordinate is maximum.
How would you do this with OCC?
I have found the GeomAPI_IntCS class, i.e. a class for computing intersections between a curve and a shape, but i think it will be very time consuming.
Does anybody have an effective solution?
Any help is greatly appreciated.

Try GeomAPI_ExtremaCurveSurface it is pretty fast and quite precise ! All cut points are the result of a minimum distance between the surfaces and the curves.

Best Regards

MCV

I've read documentation about GeomAPI_ExtremaCurveSurface, and I'm not sure to understand what it consists of. It says : "it computes start and end points of perpendiculars common to the curve and the surface (an intersection point is not an extremum except where the curve and the surface are tangential at this point)."
So it does not compute intersection points, apart particular cases? I don't see how to use it in my case.

Back to my problem, I have to compute intersection points between an axis(directed along Z) and a set of shapes. From these shapes, only surfaces are interesting(TopoDS_Face objects).
Input is a TopTools_HSequenceOfShape object.
So I use a TopExp_Explorer object configured with TopAbs_FACE, in order to iterate only on surfaces.

After that selection, I can still have a lot of surfaces. My idea was to make a bounding box around the axis, and apply this bounding box to the set of surfaces. All surfaces cutting the bounding box are interesting, and then intersection points between these surfaces and the axis are computed(using GeomAPI_IntCS).

Is it a right way? The problem is that I can't find bounding box tools in Open Cascade. Does anyone can give some help?

Using bounds to minimize the number of intersection checks is always a valid thing to do. You can perform the boundary check using the BRepBndLib functions with Bnd_Box.

You may also wish to look at BRepIntCurveSurface_Inter to intersect your faces with the axis. I have had very good experiences with this function as it gives me the actual faces that intersect the line. You can put all your shapes (or all the faces of concern) in a compound and pass it into this function.

I want to thank you, OCC experts, you gave me very useful informations.
I'm looking in the deep the classes that all of you suggested.

Thanks again.

I have been using IntCurvesFace_ShapeIntersector with fast and good result too. It depends on how many intersections you need to compute, we also develop a faster way to intersect that we use for ray-tracing purpose based on voxel traversal, but there is an overhead when your create the initial structure that is worth it only if you compute a lot of intersection (like millions).

Good Luck,
Francois.

Hello,

I am interested in working with others persons in the field of ray-tracing computation. Is there somebody interesting by my idea ?