PHLATBOYZ
Phlatboyz PhlatScripT
Version 0.922
11/15/2009

Check for Latest Version of the Phlatscript
Introduction
The PhlatScripT is a set of tools in the form of a plug in 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 the PhlatScript 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. The PhlatScripT 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 the Phlatscript grow, please contact us
Since the PhlatScripT 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 the Phlatscript www.Phlatforum.com
The PhlatScripT 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
Phlatboyz Command Toolbar
Enter Phlatboyz parameters for spindle speed, feed rate, plunge rate, material thickness, bit diameter, tab width, tab depth factor, the safe cutting area, width and height and comment text which will appear in the generated g-code. All g-code output is relative to the safe cutting area's point of origin which is 0 (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.
Inside Cut Tool - This tool is used to develop cuts along the inside path of any edge that contains a face. It differs from the outside cut tool in that the path cut direction will be counter-clockwise. The cut path is offset from the edge by half the bit diameter therefore, cutting on the actual design line. You will notice when you assign an inside cut, the corresponding face will change to transparent to let you know that you have just assigned a cut out or a hole in your design.

Use the "N" key to go to the next face among joining faces when the tool locks in on the wrong edge.

Use the "Shift" key in the event that the cutting edge developed by the tool is on the wrong side of the edge you are selecting. Just press and hold "Shift" prior to clicking and the new edge will switch to the other side and back again when you release it.  

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 blue side (default color) facing up for all faces before you assign cut lines. Otherwise, if the face is reversed (light grey), and a cut line is assigned whether inside or outside, the rough edge will be on the part file. So, in short, make sure that the blue side is facing up and the PhlatScripT will cut your part file in the right direction leaving a nice clean edge on the part.
Outside Cut Tool - This tool is used to develop cuts along the outside path of any edge. It differs from the inside cut tool in that the path cut direction will be clockwise. The cut path is offset from the edge by half the bit diameter. Same basic function of the Inside Cut Tool apply to the Outside Cut tool. You will notice that the face color does not change when you assign an outside cut like an inside cut. The inside cut tool face changes to let you know you have just cut a hole in the part.

Use the "Shift" key in the event that the cutting edge developed by the tool is on the wrong side of the edge you are selecting. Just press and hold "Shift" prior to clicking and the new edge will switch to the other side and back again when you release it.

Use the "N" key to go to the next face among joining faces when the tool locks in on the wrong edge.  

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.
Tab Tool - This tool is used to place tabs along any inside or outside 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.

When your design is completely cut out a hand tool (razor knife) will be needed to remove the parts that were held in by the tabs.

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.  
Fold Tool - This tool is used to define a fold line on a currently defined SketchUp edge. It will not work on any inside or outside cut Phlatboyz edges.

The fold tool has two modes. The first mode will replace a single edge and shorten both sides of it by a fixed amount. The second mode (called the wide mode) will replace a complete edge. The "w" key is used to toggle between the two modes.

For either mode the tool is in, the depth of the fold cut is controlled by pressing the keyboard "d" key. This allows toggling through 25%, 50%, 75% and 100% cut depth factors (you will notice this depth value in the bottom right hand corner of SketchUp's measurement window). This factor will result in the cut depth as a percentage of the material thickness.

Note: If one of those values is not what you actually want, then just type the number directly using the keyboard.  
Plunge Tool - This tool is used to create a plunge point at any given cursor position.

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.
Center line Tool - This tool is used to define a center line cut on a currently defined SketchUp edge. It will not work on any inside or outside cut Phlatboyz edges. See the "Order Selected Edges" context menu, below, in the event that this tool does not find all edges of the desired path for the center line cut.

The depth of the centerline cut is the same as the fold tool which is controlled by pressing the keyboard "d" key. This allows toggling through 25%, 50%, 75% and 100% cut depth factors. This factor will result in the cut depth as a percentage of the material thickness. You can see the current depth factor on the lower right hand side of the screen in SketchUp.

Note: If one of those values is not what you actually want, then just type the number directly using the keyboard and then assign the center line.  
Eraser Tool - With this tool you can erase any Phlatboyz Edge.

Simply click on the eraser tool icon, use the Ctrl key to cycle through individual types of Phlatboyz edges to erase, select the Phlatboyz edge to erase.

Note: Default is erase all types. This is the cursor that has no letters next to it. You can look in the lower right hand corner of SketchUp to see what line is assigned to the eraser and the eraser will only erase those lines. Also note that the right click context menu will allow you to erase ALL selected Phlatboyz edges as well.  
Safe Area Tool - Use this too 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).  
G-Code - 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.

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.  
Link to the Phlatboyz homepage.  
Opens this help file.  
Phlatboyz Edge Context Menu
These menu items appear in the "Phlat Edge" sub menu when right clicking on any edge.
Inside Edge   Selecting this command will mark selected edges as Phlatboyz Inside edge. No other change will be made to the edge. This allows you to select individual edges in SketchUp and create Phlatboyz cut edges from them.  
Outside Edge   Selecting this command will mark selected edges as Phlatboyz Outside edges. This allows you to select individual edges in SketchUp and create Phlatboyz cut edges from them. No other change will be made to the edge.  
Erase Selected Phlat Edges   This command will clear all selected edges that are currently marked as Phlatboyz edges.

Note: The original design edges will remain but the original Phlatboyz edges will be deleted.  
Phlatten Selected Edges   This command will set all selected parts to 0 on the Z plane. This is a great tool for laying parts out in the safe cutting area before assigning cuts to them. A great feature of this tool is that it ensures that the part is perfectly flat and that the proper face (default blue) is facing upward.  

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!