Function expansion based on the code in lesson 4

jianbaoxia

CAD master
Hey Bros, I'm working in CAM, when I wtach lesson_4 I was excited, it‘s close to what I want.

I would like to have a simple GUI to show my step file, and select the feature use for CNC machine, the feature maybe a hole, a curved surface and so on.
I hope I can get the location, the orient and the radius of a hole, or parameter of surface.

I thought it maybe not too difficult to accomplish(I'm new in OCCT). First, I try to get location and orient from "TopoDS_Shape", but in AIS the shape is "AIS_Shape" , and I have no idae how to get the shape I select in AIS. Then I try to get help from OCAF and XDE, but I don't see a direction. I get lost in OCCT.

I try to learn how the "recognize-holes",it's the function I would like to learn after the manual select accomplish. but I get lost again in Analysis Situs again. I have to say it's a great work. I try to learn how it works. But I should learn step by step. I try to accomplish my function base in lesson_4 first, i.e. get the information I need through manual select.

However, it seems not as easy as I thought, so I try to get help with you, guide me in some direction, I try to make less mistakes and save time to do more work.

The file can be the "ANC101.stp" offer by Quaoar, or the simple model I draw.

Thank you very sincerely!!!
 

Attachments

  • ANC101.stp
    135.5 KB · Views: 1
  • surface model.STEP
    436.9 KB · Views: 0

jianbaoxia

CAD master
It's not easy for a new gay to do this, I try to complete it base the code of Lesson_04, and then I write the code with the help of OCCT Introduction, I just don't know how to get the TopoDS_Shape that mouse select. If the TopoDS_Shape get, the location and orient can get with the help of BRepAdaptor_Surface, I read the code in core_geometry_face_recognition_from_stepfile.py.
However, it's sad for me fail in get the TopoDS_Shape in the three days.

There is my code.
 

Attachments

  • AIS_pick.zip
    4.6 KB · Views: 1

jianbaoxia

CAD master
I figure it out, it's easy, just no so easy to find the technical route and to find right class.
My technical route is : AIS_InteractiveContext→TopoDS_Shape→TopoDS_Face→BRepAdaptor_Surface→gp_Cylinder
It's just for Cylinder, other entity maybe can try in the same way.

After this I still have another question about Load big file with STEPControl_Reader cost too much time.

As a novice, the problem is always one by one, but every time a new problem, I can always learn more. Hope to be able to progress together with you
 

Quaoar

Administrator
Staff member
Keep doing things :) It's a bit hard to answer reasonably fast because of tons of daily business we have here. If you post quick & small questions that can be answered without digging into the code it would be also more time-efficient. At least I could then use my mobile phone to see the issue.
 
Top