Saturday, November 30, 2013

Parsing Solid Models for Holes

I've been playing with a macro to get hole information (coordinates, diameter, etc) out of solid models in FreeCAD. It is a challenge and I don't think I will ever be totally done, because there are so many corner cases. I am concentrating on the types of parts that I would be milling in my shop- ie blocks of metal that I can drill with a simple 3 axis Bridgeport CNC mill. I will leave the 5 axis stuff to others :) Here is a screenshot of what I have so far:
The lines coming up and out of the holes indicate that I am successful. Here is my macro:

FreeCADholefinder.py

3 comments:

  1. You have done a fantastic job! This helps a whole lot particularly to beginners. I wish all of the good luck on your program! Many thanks for expressing these ideas!

    3D CAD Program

    ReplyDelete
  2. Thanks, it works great. Based on your work I prepared a quick one-liner, which more or less displays all circles in the drawing:

    for e in Gui.Selection.getSelection()[0].Shape.Edges: print type(e.Curve) == Part.Circle and e.Curve

    ReplyDelete
  3. Dan, this is very impressive stuff. I once saw a Youtube video of a professional CNC program detecting drill holes as the mouse moved over them. It would be great if this sort of selection code could end up for use in the CNC drilling selection. Great work.

    ReplyDelete