Software Manual:

 

Opti-Mill is a METRIC GUI to generate G-Code for bolt circles, rectangular pockets, frames, circular pockets, helix and more. No need to hunt for a free CAM package or slow yourself down with learning one that came with your 3D package (unless your doing complex contours). Please note this was build on the shoulder of awesomeness. The pygdk code that runs in the background does most of the math. This GUI helps me utilize the pygdk package without writing scripts. It has required some adjustments to the original pygdk code so the G-Code could be utilized with the FluidNC controller and CNCjs.

Tooling and Feeds & Speeds JSON:

Speeds and feeds are based on the tool_data.json file. Original values were based on Sherline.com manual for there CNC ready mills (I haven’t tested these yet but I’m assuming Sherline knows their machines – which are GREAT). Diameters that fall outside of the tool_data speed and rpm interpolation curves will throw an error. You will need to expand this table based on your testing. I attempted to expand to the common 3/8′ but this was only utilizing an online software tool. Actual testing will occur in the future when I have a good source of materials.

tap_drill_chart.json can be expanded to include various threads you would like to utilize. – I’ve misplaced my card stock tap-chart cheat sheet one to many times. So ultimately I would like this json document to contain any thread types that the Sherline CNC mill can handle.

tool_inventory.json is a list of all your tools.

The GUI:

The information below is a portion of the original pygdk readme file. The sections I’ve left are to allow for expansion of this program and also explain each of the motions.

Again, this would have taken a lot longer without people that believe in the GNU V3 and the Python G-code Development Kit – pygdk (https://github.com/cilynx/pygdk) modified by (https://github.com/grp876) 07/2025 under GNU V3.

Length of App:

You can change the height of the Output text box to fit your screen height and also show more G-Code once created. “self.output_box = ScrolledText(output_frame, wrap=tk.WORD, height=8)”. You could change it to: self.output_box = ScrolledText(output_frame, wrap=tk.WORD, height=50) for example.

Shows Python code location to increase the size of the G-Code output box for optimized user interface

Featured Motions:

Example of the software creating g-code for bolt pattern after looking up the tap drill size.

Bolt Circle:

machine.bolt_circle(c_x, c_y, n, r, depth)

  • c_x is the x coordinate of the center of the bolt circle
  • c_y is the y coordinate of the center of the bolt circle
  • n is the number of bolt holes to put around the perimeter
  • r is the radius of the bolt circle
  • depth is how deep to drill each hole
Example of the software creating g-code for a circular pocket.

Circular Pocket:

machine.circular_pocket(c_x, c_y, diameter, depth, step=None, finish=0.1, retract=True)

  • c_x is the x coordinate of the center of the pocket
  • c_y is the y coordinate of the center of the pocket
  • diameter is the diameter of the pocket
  • depth is how deep to make the pocket
  • step is how much material to take off with each pass, but will be automatically calculated if not provided
  • finish is how much material to leave for the finishing pass
  • retract is whether or not to retract the cutter to a safe position outside of the pocket after completing the operation
Example of the software creating g-code for a frame or box.

Frame:

 

machine.frame(c_x, c_y, x, y, z_top=0, z_bottom=0, z_step=None, inside=False, r=None, r_steps=10)

  • c_x is the x coordinate of the center of the frame
  • c_y is the y coordinate of the center of the frame
  • x is the x-dimension of the frame
  • y is the y-dimension of the frame
  • z_top is the top of the frame — usually 0
  • z_bottom is the bottom depth of the frame — usually something negative
  • z_step is how far down z to move with each pass
  • inside is whether the cutter is inside or outside the requested dimensions
  • r is the corner radius
Example of the software creating g-code for a helix or thread.

Helix:

 

machine.helix(c_x, c_y, diameter, depth, z_step=0.1, outside=False, retract=True):

Follows a circular path in [x,y] while steadily spiraling down in z.

  • c_x is the x coordinate of the center of the helix
  • c_y is the y coordinate of the center of the helix
  • diameter is the diameter of the helix
  • depth is how deep to cut in total
  • z_step is how far to move down for each rotation of the helix
  • If outside is False (the default), the cutter will run inside the requested diameter. If outside is True, the cutter will run outside the requested diameter.
  • retract cutter
Example of the software creating g-code for a hole that is up to 2x the cutter.

Mill Drill:

machine.mill_drill(c_x, c_y, diameter, depth, z_step=0.1, retract=True)

Uses a helix under the hood to drill a hole that is up to 2x the diameter of the endmill being used.

  • c_x is the x coordinate of the center of the hole
  • c_y is the y coordinate of the center of the hole
  • diameter is the diameter of the hole
  • depth is how deep to drill
  • z step is how far to move down for each rotation of the helix
  • retract cutter to a safe position 
Software creating g-code for bolt pattern for milled holes like countersinks

Pocket Circle:

machine.pocket_circle(c_x, c_y, n, r, depth, diameter)

Like a Bolt Circle, but all the holes are Circular Pockets

  • c_x is the x coordinate of the center of the pocket circle
  • c_y is the y coordinate of the center of the pocket circle
  • n is the number of pocket holes to put around the perimeter
  • r is the radius of the pocket circle
  • depth is how deep to mill each pocket
  • diameter is the diameter of each pocket
Example of the software creating g-code for a rectangular shape

Rectangular Pocket:

machine.rectangular_pocket(c_x, c_y, x, y, z_top=0, z_bottom=0, z_step=None undercut=False, retract=True):

  • c_x is the x coordinate of the center of the pocket
  • c_y is the y coordinate of the center of the pocket
  • x is the x-dimension of the pocket
  • y is the y-dimension of the pocket
  • z_top is the top of the pocket — usually 0
  • z_bottom is the bottom depth of the pocket — usually something negative
  • z_step is how far down z to move with each pass when initially spiraling in
  • undercut is whether or not to put “mouse ears” in the corners to provide clearance for sharp corners to mate into the pocket