PHLATBOYZ
Phlatboyz SketchUcam(PhlatScripT)
SketchUcam Version 1.2a
Dec 2014

Check for Latest Version of SketchUcam
Introduction
SketchUcam is a set of tools in the form of a plugin for Google SketchUp. It allows for assigning of CNC cut/fold/drill/mill, etc. functions to SketchUp designs as a full featured CAM solution. It was designed for use with the Phlatboyz easy to assemble and learn CNC machine kits. For more information about these affordable Kits, please visit Phlatboyz Machines

The vision and direction of SketchUcam is Mark and Trish Carew's of Phlatboyz, LLC and is released under GLN licensing terms. Since this code and the ideas behind it is a collaborative effort among many people, it can not be sold in any form. For more information, please contact Mark and Trish Carew through www.phlatboyz.com or kram2422@comcast.net. It has come to fruition through the help of many volunteer programmers, testers, and users. We want to thank everyone for your efforts put forth to make this a reality. SketchUcam is an ever changing and evolving program.

This is a great project and if you would like to contribute your time and talents to help SketchUcam grow, please contact us
Since SketchUcam is released as open source, anyone and everyone is welcome to download it and experiment with it. The ultimate goal is to create a complete and powerful CAM solution directly within SketchUp capable of outputting 3D tool paths and possibly in the future will be the ability to not only output the g-code but control the Phlatprinter as well :) Have fun and please let us know how you are using SketchUcam at www.Phlatforum.com
SketchUcam or any form of this code can not be used for commercial gain or sold in any form. This code is a volunteer collaboration project that consist of the efforts of many people. We are keeping this truly open source.
Please send questions or comments to Phlatboyz,LLC
Phlatboyz or Phlatforum

New in V1.2a

  • Gcode Joiner - on the Phlatboyz menu, this tool allows you to join 2 or more Gcode files together to make a single file that does all of the cuts in the order specified. This is handy for combining files generated from a drawing that needs seperate operations carried out on the same part.
  • Use_End_Position - on the Options|Features menu, setting this true allows you to select an ending position other than X0 Y0 for the gantry. TIP: use in combination with the Use_Home_Height option.
  • Bug fixes in the 3D Gcode generator.
  • 3D code that uses multipass will now stop early once all features have been cut, ie it will not continue to full material depth if all features have been cut.
  • Plunge holes are automatically grouped. This prevents underlying geometry from interfering with Gcode generation. Only an underlying horizontal line will interfere but in this case it is very easy to delete the part that overlaps the colored 'hole' line. Ordinary holes have no name while enlarged holes are named with the diameter and depth. For example a plain 8mm hole will be named "_diam_8.0mm" and a depth restricted 9mm hole will be "_diam_9.0mm_depth_76.0".
    This implies that holes will be cut in group order so don't forget to set the order with the Group Reorder tool.

New in V1.2

  • The 'Table top is Z-Zero' checkbox. If this is ticked the table top will be used as the Z zero reference instead of the material top surface. This is most useful on overhead gantry machines, and not at all useful on Phlatprinters.
  • The Options Menu allows you to set default options that will be applied to new drawings. These options affect such things as your machine type (overhead gantry?) and size (default safe area), common tool settings (feed speeds), and Gcode generation options. This menu system replaces the MyConstants.rb file in a transparent way. Your existing settings will be used until you use the Options menu to change them.
  • profile file format was changed to ini format, extension .pri
  • fix for parameters tool on mac
  • phlatBones preferences file moved to profiles folder, solves write permissions issue on Win7/8
  • Pocketcut: improved undo so entire pocket cut will undo in one operation
  • arcs, extra digit of precision
  • 3D - removed full depth plunge at start of last multipass pass that may remove extra material.
  • added Z-Zero option to parameters dialog
Phlatboyz Command Toolbar
toolbar image
params menu

Enter Phlatboyz Parameters to set: [spindle speed, feed rate, plunge rate, safe travel, material thickness, bit diameter, tab width, tab depth factor, the safe cutting area size and comment text] which will appear in the generated g-code. All g-code output uses the safe cutting area's local origin(the bottom left corner) and only edges within the safe cutting area will generate g-code. This will allow designs requiring multiple sheets to be contained within one SketchUp file and the cut codes processed as one sheet at a time for separate g-code files for each sheet. The safe area is assumed to be at sketchup's origin, unless placed elsewhere using the Safe Area Tool.

Also, there are 2 check boxes for additional options:
1) "Generate Multipass" - for cutting hard materials, where you want to limit the depth of cut by cutting multiple thin layers.
2) "Overhead Gantry". The original 2 Phlatprinters cut from the bottom with a reversed Y axis. Use this option if you have a Phlatprinter3 or your cnc machine has an overhead gantry. This will reverse the direction of the Inside and Outside cuts.
See the Options Menu help for setting this as a default

Note: When you press "OK", these settings will be saved as attributes to your sketchup model. So each sketchup file will retain their individual settings.


Profiles

New in 1.1c is the ability to save and restore tool profiles. This allows you to quickly restore a tool setup that relates to a type of material or operation. For example one might store the settings for a drilling operation with multipass on, low feed speeds etc. For a foam milling tool one can store high feed speeds, not multipass and so on.
Clicking the 'Save' button will produce a prompt for a profile name. Profile names must not have spaces or punctuation in them. The following settings will be saved

  • spindlespeed
  • feedrate
  • plungerate
  • cutfactor
  • bitdiameter
  • tabwidth
  • tabdepth
  • safetravel
  • usemultipass
  • multipassdepth
  • gen3d
  • stepover

Note the material thickness is deliberately NOT saved. The concept of the profile is to save a tool setup for a specific type of material rather than a size of material.

Clicking the 'Load' button will bring up a prompt box showing the currently available profiles. Select one and click 'Ok'.
After a load, the comment parameter will read "Loaded profile NAME" where NAME is the name of the profile.

The 'Delete' button will allow you to select a profile and delete it.

For those using the compatibility menu (on Mac or Linux) the profile functions are available on the Tools|Phlatboyz menu.

Also on that menu us the Options Summary entry. This will display your current settings for a number of global options settable in the Options menu. Yes, we know it is misnamed 'Validity Check', that is a Sketchup default we cannot change :-) Please see the Options help.


Some points to note:
Inside/Outside overcut%
This value is used as a multiplier on the material thickness. The Phlatprinter is designed to cut through sheet material so normal cuts must go deeper than the material thickness. This is normally about 140%, ie through the material and 40% out the other side to account for wavy dollar tree blue foam. If you are using an overhead gantry and do not want to cut into your spoil board then set this value to 100% and zero your toolbit end accurately.
Plunge rate:
used for vertical down moves of the Z axis. Set this lower than the feed rate for hard materials
Step Over %
This percentage is used by the 3D code generator and by the Pocket Tool to determine how much of the bit diameter to overlap each cut pass. Tool manufacturers recommend using 1-30% or 70 to 100%, but not 30-70% as this range increases tool wear.
Only select 'Generate 3D Code' for an actual 3D model. IF selected for a plain flat drawing, Sketchup Will Stop Responding
Tab width
Half the bit diameter will be removed from each end of the tab. Thus a tab width equal or less than the bit diameter will not leave a useful tab at all.
Tab Depth %
The percentage of the material thickness to cut away when doing tabs. Thus 75% will cut away 75% of the material leaving 25% behind.

Show Gcode after output
Ticking this will cause Gplot to display the Gcode directly after generating it. The Gplot program will open after you click 'Ok' to confirm the file save.
Tooltips will displayed for each edit box with simplified help.
Outside Cut Tool - This tool is used to cut the outside contour of your part. It is assigned to a closed loop of edges and requires a corresponding face. The cut path is offset to the outside, to compensate for the material removed by the cutter. The thin face between the original line and the Outside Cut line will get a transparent texture. It differs from the inside cut tool in that the path cut direction, will be clockwise.

Use the["Shift" key] if the preview shows the outside cut on the wrong side. Just press and hold "Shift" prior to clicking.

Use the ["End" key] if the tool locks onto the wrong adjacent face. You won't need this feature, if you hover over faces instead of edges.  

Note: reversing the face (Edit/Face/Reverse Faces) prior to using the Outside Cut Tool will cause the cut direction to be reversed. This works the same as the Inside Cut Tool.
Inside Cut Tool - This tool is used to cut out openings. It is assigned to a closed loop of edges and requires a corresponding face. The cut path is offset to the inside, to compensate for the material removed by the cutter. The face will change to a transparent texture to resemble a hole. It differs from the outside cut tool in that the path cut direction, will be counter-clockwise.

Use the["Shift" key] if the preview shows the inside cut on the wrong side. Just press and hold "Shift" prior to clicking.

Use the ["End" key] if the tool locks onto the wrong adjacent face. You won't need this feature, if you hover over faces instead of edges.  

Note: reversing the face (Edit/Face/Reverse Faces) prior to using the Inside Cut Tool will cause the cut direction to be reversed. In milling, the rotation of the bit, counter clockwise or clockwise, determines which edge of the design will be left rough. Normally, in SketchUp, you would leave the default grey side facing up for all faces, before you assign cut lines. Otherwise, if the face is reversed (white), and a cut line is assigned whether inside or outside, the rough edge will be on the part and not the waste. So, in short, make sure that the grey side is facing up and the PhlatScripT will cut your part file in the right direction leaving a nice clean edge on the part.
Tab Tool - This tool is used to place tabs along any inside or outside cut Phlatboyz edge. The tabs hold the parts in place while the media (foam sheet, balsa, cardboard, etc.) moves back and forth in the machine.

This tool uses the tab width and tab depth factors which are defined in the Parameters dialog. Use that dialog to define the tab tool parameters prior to using the tool; changing the values in the Parameters dialog will not affect tabs that have already been placed.

Use the ["End" key], to toggle from standard Tabs to V-Tabs. V describes the angled tabs vs the standard rectangular tabs. The cursor will change from a T to V to show the current mode.

Use the ["Home" key], to toggle Bold Tab viewing mode off/on. When the tab tool is active, this feature makes the tabs easy to see. Turn it off, if sketchup slows down when using the tab tool.

Note: A feature of the Tab Tool is the ability to 'draw' tabs to any width you desire always starting with the default width. For example, if the tabs placed along a curve are too small, you can hold the left mouse button down and draw then in wider. The tab depth will remain the same as defined in the parameters dialogue.

Note: The tab tool has click/drag functionality, for multiple tabs or extending tab width.  
Fold Tool - This tool is used to define a fold line. The use of a fold line is to create a crease, so a sheet of foam can be folded or bent to form 3d shapes. Or by using a series of stepped depth fold lines, create a hinge line for a model airplane control surface.

It automatically selects a single edge. Press the ["Shift" key], if you want all connected edges.

Use the ["End" key] to toggle between short and wide mode. When hovering over an edge, the short mode shows a pink color preview. Wide mode shows a darker red/purple preview color. Short and Wide mode status is also shown on the bottom status text. The default short mode will shorten both ends of the edge by a small amount. The main reason is to break contact and stop the possible creation of an extra face and loop, which could confuse the phlatscript. Wide mode will act normally and not offer this protection. But you can use wide mode, if say you want a connected chain of edges.

Use the ["Left Arrow"]["Right Arrow"] keys to scroll through the preset depths: [25%, 50%, 75% & 100%]. This will result in the cut depth, as a percentage of the material thickness. You can see the current depth factor in the VCB (lower right hand corner in SketchUp).
Use the ["Down" key] to set the depth back to the default of 50%.

Note: You can type custom depth values into the VCB, using your keyboard. The value is not accepted, until the "Enter" key is pressed. Then the % suffix will appear with the VCB value, which indicates the value is now set. Max value allowed is 140%.  
Plunge Tool - This tool is used to create a plunge point at any given cursor position. The use of the plunge tool is to drill holes.

The plunge tool creates a circle with a brown radius line extending from the center to the outside diameter. The diameter of the circle is determined by the Phlatboyz "Bit Diameter" parameter.

The plunge tool allows the generation of gcode required to plunge the bit at the depth indicated in the "Material Thickness" Parameters dialog.
OR
You can set the percentage depth before you click. This hole will then be that percentage of the material thickness in depth. You will need to set the depth for every hole.
AND
You can hold down the SHIFT key when clicking, and you will be prompted for a diameter. The hole will then be spiral bored to that diameter. This is quite slow so holes that are greater than 3 times the diameter of the bit should rather be a circle with an inside cut to remove the waste.
Feedrate will be the normal rate set for cuts.
Downfeed will be limited to either
  • half the bit diameter per revolution
  • the multipass depth if multipass is on.
Notes:
  1. Note that the various CNC controllers will perform this operation in different ways. LinuxCNC will do true spiral decending cuts, while other controllers might step down and do a circle with constant Z instead.
  2. The normal cut direction is anticlockwise giving a 'climbing cut'. On stiff machines this will give a superior surface finish. If your machine gives a bad finish in this and pocket cuts, please review the Use_pocket_CW and Use_plunge_CW settings in the Options menu section
Center line Tool - This tool is used to define a center line cut on a SketchUp edge. The common use of center lines, is to cut a shallow graphical design or slot. If you are able to draw the necessary pattern of lines to form a pocket, you can also use center lines to cut out the pocket. Pocket milling is when you cut out shallow openings, that doesn't penetrate to the other side.

It automatically selects all connected edges. Press the ["Shift" key], if you only want a single edge.

Use the ["Left Arrow"]["Right Arrow"] keys to scroll through the preset depths: [25%, 50%, 75% & 100%]. This will result in the cut depth, as a percentage of the material thickness. You can see the current depth factor in the VCB (lower right hand corner in SketchUp).
Use the ["Down" key] to set the depth back to the default of 50%.

Note: You can type custom depth values into the VCB, using your keyboard. The value is not accepted, until the "Enter" key is pressed. Then the % suffix will appear with the VCB value, which indicates the value is now set. Max value allowed is 140%.  
Pocket Tool - This tool is used to create a pocket inside a shape.

A pocket is a shallow depression in the surface of the part. While this tool will automatically deal with simple shapes, some shapes will produce incorrect results. These can be fixed manually or can be drawn using the keyboard options as follows:

  • hold down CTRL key to draw only the boundary inside the shape. Click to accept it.
  • hold down SHIFT to draw only the zigzag. If there are errors or missing portions, do this:
    1. simplify the shape by drawing one or more lines across it to split it up into simple convex shapes.
    2. Hold SHIFT and zigzag the resulting subshapes
    3. Remove the lines you added
  • press the END key to swap zigzag direction from 'along X' to 'along Y'. Each time you press END, the direction will toggle. 'Along Y' is particularly useful on Phlatprinters as it helps prevent the material slipping.
    You can set the default direction in Options menu

Note: You can type custom depth values into the VCB, using your keyboard. The value is not accepted, until the "Enter" key is pressed. Then the % suffix will appear with the VCB value, which indicates the value is now set. Max value allowed is 99%.  

Eraser Tool - With this tool you can erase any Phlatboyz Edge.

Default is to erase all types of Phlatedges. This is the cursor that has no letters next to it.

Use the ["Left Arrow"]["Right Arrow"] keys, if you want to erase only one type of edge. It will cycle through and show in the VCB(lower right hand corner of SketchUp) which line type is currently assigned to the eraser. Also, each type has it's own unique cursor.
Use the ["Down" key] to quickly go back to the default "erase All types".

Tab highlighting has been added to the eraser tool:
Use the ["Home" key], to toggle Bold Tab viewing mode off/on. When the eraser tool is active, this feature makes the tabs easy to see. Turn it off, if sketchup slows down when using the eraser tool.

Note: The right click context menu will also allow you to erase ALL selected Phlatboyz edges.

Tip: Instead of deleting one item at a time, select many or all. Activate the eraser tool. And click the selected items. If any unwanted Phlatboyz edges still remain, then repeat.  
Safe Area Tool - Use this to graphically define the safe cutting area for your parts. This tool uses the safe width and height defined in the parameters dialog and allows dynamic placement of the "safe" cutting area rectangle.

G-code output will be generated only from designated Phlatboyz edges within this safe rectangle and will be relative to the safe origin (bottom left corner).

Note: Even if the user doesn't use this tool to graphically define a safe area, the safe cutting area still exists and assumed to be at sketchup's origin.  
Reorder Groups Tool - Redorder groups to change cut order

Grouped cuts will be cut first, in the order they were grouped. However, in order to edit a group it has to be exploded. Grouping it again affects the cut order.
To reorder groups select this tool and then simply click on each group in the order you want them cut.
You can use the 'Tools|Phlatboyz|Groups Summary' menu item to see the current group ordering.

Generate GCode - This tool is the last step in the PhlatScripT process. Once the parts are surrounded by safe cutting area and all cut lines and tabs have been assigned, click on this icon to open a file save dialogue box to save your g-code file to the location you specify.

The Phlatscript will calculate the optimal cut order. Or you can choose your own cut order. You do this by grouping your parts and they will be cut in the same order.

Note: The output g-code file has the extension .cnc but is simply a text file of X, Y, Z coordinates for the Phlatboyz machine to follow. Depending on your control software, this extension can be renamed to anything desired. To edit the g-code file, you can right click and open with a text editor of your choice. If you alter this file, your machine may do unexpected things, be very careful!  
Link to the Phlatboyz homepage.  
Opens this help file.
Known to not display on Linux under WINE, search for file help.html under the Sketchup Plugins folder within ~/.wine. Installing IE8 using 'winetricks ie8' may solve this.  

 



Thank you for your interest in the Phlatboyz project. Please take the time to visit the Phlatforum for lots of great people sharing great ideas and designs created with the PhlatScripT on their Phlatboyz machines!