Sunday, July 10, 2011

Translating toolpaths with scriptop

I have committed a change to my git repo that lets me snap new coordinates anywhere on the drawing and then have my toolpaths generated relative to it. This becomes useful if I import a dxf file and the geometry isn't anywhere near where it needs to be for sensible fixture offsets. Here's an example:



Notice how the origin/datum is to the far left of the rectangular sketch. To make things a little easier, create a new coordinate system with 'Set Origin' (I like to use the 'Pick 1 Point' option).



Snap the new coordinate datum to the upper left corner of the sketch:



Create a 'ScriptOp' operation and copy/paste the new coordinate object into it. Then you can position the ScriptOp operation just before a regular machining operation,such as Profiling. When you post process, the gcode will be shifted by the distance that the new coordinate object is away from the original origin:



This is useful if you want to place your fixture offset in a familiar place. In the case of this sketch, the fixture offset (G54-G59) is placed in the upper left corner. I like to place a fixture offset on that corner because I touch off to the fixed back jaw of my vise and the left side of the part. There are always other ways of doing things, but that is a common one.

Note for my fellow git brothers: I changed nc.py, iso.py, and ScriptOp.cpp to make this happen :)

No comments:

Post a Comment