We are making a self-made program for controlling a CNC machine and we would like to include a general 3d tool offset algorithm (we have the 2D case sorted out as described in Thread: Offset Algorithm). The particular case we are after is a simple cylindrical shaft tool, but need to offset the shape to cut in the general 3D case. Does anyone have any ideas or if there is some useful code around? Your help is greatly appreciated!

Regards
Mark