Best way to find all intersections between iso and face

Hello :)

I am trying to figure out what is the best way to find all the 2D intersections between an iso line on a face, and all the wires of that face.

So basically, I want to pick a U or V value in a face's uv domain, and then find out all the V or U parameters where that line crosses any of the face's wires. And to be honest, I am not quite sure which of all the intersection methods available in OCC would work and be the best/fastest at this.

Thank you :)

Mikhail Sazonov's picture

Hi Nathaniel,

There are two classes in OCCT dedicated for the purpose you are aimed at. They are:

Hatch_Hatcher
Geom2dHatch_Hatcher

The first one is more low level, and you must tessellate the face bounds yourself into segments and use these segments to trim the lines that you want to trim.

The second one is of more high level in the sense that you create 2D adaptor curves from the edges and put them as elements of domain to trim the needed hatching lines.

Unfortunately these classes have no documentation, so you need to see directly the header files to understand how to use them, or find other OCCT code for examples of usage.

Regards,
Mikhail

Nathaniel Essenberg's picture

Thank you very much, Mikhail!

This sounds very promising, and I am going to give it a try soon.

My main difficulty with OCC is when I know exactly what I want to do, and I expect this functionality is available, but I have no idea where to find it... For example, I would not have thought about hatching myself. I was thinking of intersections.

The API documentation can be helpful, and the main documentation has a lot of good info about a lot of topics. But I think my problem goes in the reverse direction, in a way. I am wondering if there is a valuable way to document the API in this order ("I want to do X => which classes can I use?"), although it might be very hard because problems can be very specific. The forum might be the closest thing (I know the documentation also describes the different modules and their purposes, which can be a helpful start), because you can search the forum for your question, and hopefully it came up before. One issue with that is that solutions from years ago might be out of date. Another is that different people will describe the same problem in different words.

Anyway, I always appreciate your clear and helpful answers, thanks again :)

jason jiang's picture

Hi,Mikhail:
I want to get the intersetion point between a Lin/Edge with a Face,I try to use IntCurvesFace_ShapeIntersector or GeomAPI_IntCS,but the result of test is not correct,could you give me a suggestion?
or could you give me an exsample?
Thanks
Jason