How to recognize a circle(cylinder) hole or rectangle hole on a TopoDS_Shape by C++ code?

Hi:
While I import STEP file and show 3D graphics by OCC,I want to recoginize some different geometry of Process ,such as cylinder hole,rectangle hole,Wedge hole,or more complex configuration.then,How can I recognize it by C++ code?
Thanks
Jason

Mikhail Sazonov's picture

There is no such solution in open source. But there is OCC product CAD Processor. See https://www.opencascade.com/products/cad-processor/.

jason jiang's picture

Hi,Mikhail:
Thanks for your reply.usually,there is one outerWire on a Face and there are some innerWire on the same Face.I had tried to parse innerwire on a Face in
a imported STEP file,I think the innerwires are the holes on the face.but the result show that is not accurate,and even often can not find some holes by this way though they are existed there obviously in some imported STEP file.
so,could you give me a c++ sample code to do it?
Thanks
Jason.

Mikhail Sazonov's picture

This task has no simple solution.

jason jiang's picture

Hi:
Maybe serveral ways to us together,it can improve the accurate.first,find out all of innerWire of determined Face,then,parse the text content of this FACE in step file,get the param of these innerWire,compare them to determine whether they are right.
how do you think my war?do you have any other suggestion?
Thanks
Jason

Dmitrii Pasukhin's picture

Hello.

It is very difficult. In this case we can work with step only. We can't develop the same solution for other more then 30 formats, that we support, cases when user create shape internally w/o CAD files. In your case you need a not closed Step session. That is why this realisation is not general solution. And can't be developed within OCCT.

But you case is possible to develop. You need to iterate for a shape and find what you want and then find Step entity by TransferProcess builder.

If you need some examples, how to work with TransferProcess, let me know.

Best regards, Dmitrii.

Sergey Slyadnev's picture

Check out http://analysissitus.org/, it's all about it and it's open source.