How to Judge a Hole in an Entity of TopoDS_Shape?

Hi:
I want to recoginize the holes in the Entity,do you hava any good idea?
I had used below way to identify if it is a hole:
1,first,get a inner Wire on the surface of entity.
2,then,find a same size/type of other wire on the other Face.
3,and choose the center points of these two Wire,make an Edge link these two point.
4,Judge the edge if there are intersetion points with the other face.but very sadly,the test result show every face have intersetion point with this maked new edge.
what is wrong?
or are you have any other good way to solve this problem?
Thanks
Jaosn.Jiang

Yongjin Guo's picture

Check “Analysis Situs” by Sergey Slyadnev. The authur's website taught how to find drilled holes. The open source "Analysis Situs" has the detailed codes -- but it is relatively tough as the software itself has a backbone of AAG. Anyway, you can get the basic idea from the authur. He is from Russia. You can find his teaching videos from Bilibili or YouTube which will lead you to his website.

I just used a simple method: find cylindrical faces (might be cylindrical, or extruded, or revoluted, or BSpline surface, you can check the surface type of candidates of your problem with Analysis Situs), then judge wether they are pairs, for example, they are 180 degree (if two forming a cylinder), coaxial, having same radius and height and have the same location (please note that you may need to adjust the location to the center in the axial direction).

Hope this can help.