Phlatscript with metric Gcode output

At some point metric output was in fact included in the Phlatscript release, but as far as I can find no mention was made in the release notes. Thus, it will output metric G-code if metric units are selected in Sketchup.

However, last I saw (about 05/12/2011) the dialog box will still stuff up the selection area due to a mix of unit types. It will try to interpret the existing size as inches and transform the material box to a far too small size.

Intro

The CNC cutter I will build will use metric leadscrews. Therefore my CNC setup will be natively metric and using metric gcode will be more accurate that using imperial. I also saw some folks on the phlatforum asking about metric gcode and have altered phlatscript v0.918 to produce it. I found ruby script to be very easy to modify (my 9th or 10th computer language now).

What to do

  1. Install Sketchup 7
  2. Download and install Phlatscript V0.918 from Phlatforum and make sure it is working
  3. Download phlat-metric.zip and unzip the 4 files it contains over the existing Phlatscript files in "C:\Program Files\Google\Google SketchUp 7\Tools\Phlatboyz"
  4. Start Sketchup and make sure you see the Phlatscript dialog as below

    These changes mean that if your drawing is set to metric units (meters or millimeters) then Gcode will automatically be output in millimeter units. Note that feed rates will then be in millimeters per minute and if you leave the inch/min units in place the cuts will take a loooong time.
    The 'Force Metric' checkbox will cause all gcode output to be metric, no matter what your drawing units are set to.
    If this is checked and you press 'Restore Defaults' you will get the correct bit diameter and tab width sizes.

    The 'TurboCNC' checkbox will cause the header codes to change to be more TurboCNC friendly.
    TurboCNC does not understand G92 and implements G53 differently to EMC and I havn't read the standard on it so cannot now say who is actually right. Those lead in codes are easy enough to change to suite your machine in the file PhlatMill.rb
  5. Please note that the TurboCNC friendly output is tested (syntactically correct) but without an actual machine attached. Also, I found that EMC2 works co-ordinate offsets differently to TurboCNC so the G53 causes unhappiness. I think that Phlatscript might be modified to allow the user to specify some header Gcodes that would be included so each user can produce Gcode that is machine ready for their own particular machine.

What files

The following files are included in this patch
08/01/2009  18:09             9,124 PhlatMill.rb
08/01/2009  18:02            12,611 Dialogs.rb
08/01/2009  16:42             3,831 setParamsWebDialog.html
08/01/2009  16:43             4,854 Constants.rb
Hopefully this code will be merged into the next Phlatscript release. I'd hate to have to keep maintaining a set of patches for every version released.

Well that hasn't happened for V919 and V920 so you can get a rough and ready metric output by installing V920 and then extracting THIS over the relevant file in C:\Program Files\Google\Google SketchUp 7\Tools\Phlatboyz

This is a very simple conversion to metric, autoselecting itself according to the drawing units. No user choices at all


V920 bug.....

What I did
Draw the V shape starting top left, bottom middle, top right, top middle, top left.
do inside cut
do outside cut

'swarfer'


687th 1