Path Workbench

Introduction
The Path Workbench is used to produce machine instructions for CNC machines from a FreeCAD 3D model. These produce real-world 3D objects on CNC machines such as mills, lathes, lasercutters, or similar. Typically, instructions are a G-Code dialect. A general CNC lathe tool path sequence simulation example is presented here.



The FreeCAD Path Workbench workflow creates these machine instructions as follows:
 * A 3D model is the base object, typically created using one or more of the [[Image:Workbench_PartDesign.svg|24px]] Part Design, [[Image:Workbench_Part.svg|24px]] Part or [[Image:Workbench_Draft.svg|24px]] Draft Workbenches.
 * A Path Job is created in Path Workbench. This contains all the information required to generate the necessary G-Code to process the Job on a CNC mill: there is Stock material, the mill has a certain set of tools and it follows certain commands controlling speed and movements (usually G-Code).
 * Path Tools are selected as required by the Job Operations.
 * Milling paths are created using e.g. Contour and Pocket Operations. These Path objects use internal FreeCAD G-Code dialect, independent of the CNC machine.
 * Export the job with a G-Code, matching to your machine. This step is called post processing; there are different post processors available.

General concepts
The Path Workbench generates G-Code defining the paths required to mill the Project represented by the 3D model on the target mill in the Path Job Operations FreeCAD G-Code dialect, which is later translated to the appropriate dialect for the target CNC controller by selecting the appropriate postprocessor.

The G-Code is generated from directives and Operations contained in a Path Job. The Job Workflow lists these in the order they will be executed. The list is populated by adding Path Operations, Path Dressups, Path Supplemental Commands, and Path Modifications from the Path Menu, or GUI buttons.

The Path Workbench provides a Tool Manager (Library, Tool-Table), and G-Code Inspection, and Simulation tools. It links the Postprocessor, and allows importing and exporting Job Templates.

The Path Workbench has external dependencies including:
 * 1) The FreeCAD 3D model units are defined in the .  The Postprocessor configuration defines the final G-Code units.
 * 2) The Macro file path, and Geometric tolerances, are defined in the  tab.
 * 3) Colors are defined in the  tab.
 * 4) Holding tag parameters are defined in the  tab.
 * 5) That the Base 3D model quality supports the Path workbench requirements, passes Check Geometry.

Limitations
Some current limitations of which you should be aware are:
 * Most of the Path Tools are not true 3D tools but only 2.5D capable. This means that they take a fixed 2D shape and can cut it down to a given depth. However, there are two tools which produce true 3D paths: and  (which is still an experimental feature as of November 2020).
 * Most of Path workbench is designed for a simple, standard 3-axis (xyz) CNC mill/router, but lathe tools are under development in 0.19_pre.
 * Most operations in Path workbench will return paths based on a standard endmill tool/bit only, regardless of the tool/bit type assigned in a given tool controller with the exception of the and  operations.
 * The operations within the Path workbench are not aware of clamping mechanisms in use to secure the model to your machine. Consequently, please review and simulate the paths you generate prior to sending the code to your machine.  If necessary, model your clamping mechanisms in FreeCAD in order to better inspect the paths generated.  Look for possible collisions with clamps or other obstacles along the paths.

Units
Unit handling in Path can be confusing. There are several points to understand:
 * 1) FreeCAD base units for length and time are 'mm' and 's' respectively. Velocity is thus 'mm/s'. This is what FreeCAD stores internally regardless of anything else
 * 2) The default unit schema uses the default units. If you're using the default schema and you enter a feed rate without a unit string, it will get entered as 'mm/s'
 * 3) Most CNC machines expect feed rate in the form of either 'mm/min' or 'in/min'.  Most post-processors will automatically convert the unit when generating gcode.

Schemas:
 * 1) Changing schema in preferences changes default unit string for the input fields.  If you're a Path user and prefer to design in metric, it's highly recommended that you use the "Metric Small Parts & CNC" schema.  If you design in US units, either the Imperial Decimal and Building US will work
 * 2) Changing your preferred unit schema will have no effect on output but will help avoid input errors

Output:
 * 1) Generating the correct unit in output is the responsibility of the post-processor and is done only at that time
 * 2) Machine output unit is completely unrelated to your selected unit schema
 * 3) Post-processors produce either metric (G21) output, Imperial (G20) output or are configurable.
 * 4) Configurable post-processors default to metric (G21)
 * 5) If you want your configurable post-processor to output imperial gcode (G20), Set the correct argument in your job output configation (ie --inches for linuxcnc).  This can be stored in a job template and set as your default template to make it automatic for all future jobs

Path Inspection:
 * 1) If you use the Path Inspect tool to look at g-code, you will see it in 'mm/s' because it is not being post-processed

Heights and depths
Many of the commands have various heights and depths:



Commands
Some commands are experimental and not available by default. To enable them see Path experimental.

Project Commands

 * [[Image:Path_Job.svg|32px]] Job: Creates a new CNC job.


 * [[Image:Path_Post.svg|32px]] Post: Exports a project to G-code.


 * Path_Sanity.svg Check the path job for common errors: Checks the selected job for missing values. Path_experimental.


 * [[Image:Path_ExportTemplate.svg|32px]] Export Template: Export the current job as a template.

Tool Commands

 * Path_Inspect.svg Inspect G-code: Shows the G-code for checking.


 * Path_Simulator.svg CAM Simulator: Shows the milling operation like it's done on the machine.


 * Path_SelectLoop.svg Finish Selecting Loop: Completes a loop from two selected edges.


 * [[Image:Path_OpActiveToggle.svg|32px]] Toggle the Active State of the Operation: Activates or de-activates a path operation.


 * [[Image:Path_ToolBitLibraryOpen.svg|32px]] ToolBit Library editor: Opens an editor to manage ToolBit libraries.


 * [[Image:Path_ToolBitDock.svg|32px]] ToolBit Dock: Toggles the ToolBit Dock.

Basic Operations

 * [[Image:Path_Profile.svg|32px]] Profile: Creates a profile operation of the entire model, or from one or more selected faces or edges.


 * [[Image:Path_Pocket.svg|32px]] Pocket Shape: Creates a pocketing operation from one ore more selected pocket(s).


 * [[Image:Path_Drilling.svg|32px]] Drilling: Performs a drilling cycle.


 * [[Image:Path_Face.svg|32px]] Face: Creates a surfacing path.


 * [[Image:Path_Helix.svg|32px]] Helix: Creates a helical path.


 * [[Image:Path_Adaptive.svg|32px]] Adaptive: Creates an adaptive clearing and profiling operation.


 * [[Image:Path_Slot.svg|32px]] Slot: Creates a slotting operation from selected features or custom points. Path_experimental.


 * [[Image:Path_Engrave.svg|32px]] Engrave: Creates a engraving path.


 * [[Image:Path_Vcarve.svg|32px]] Vcarve: Creates a path for a 3D pocket.

3D Operations

 * [[Image:Path_3DPocket.svg|32px]] 3D Pocket: Creates a path for a 3D pocket.


 * [[Image:Path_Surface.svg|32px]] 3D Surface: Creates a path for a 3D surface. Path_experimental.


 * [[Image:Path_Waterline.svg|32px]] Waterline: Creates a waterline path for a 3D surface. Path_experimental.

Path Dressup

 * [[Image:Path_DressupPathBoundary.svg|32px]] Boundary Dressup: Adds a boundary dressup modification to a selected path.


 * [[Image:Path_DressupDogbone.svg|32px]] Dogbone Dressup: Adds a dogbone dressup modification to a selected path.


 * [[Image:Path_DressupDragKnife.svg|32px]] DragKnife Dressup: Adds a dragknife dressup modification to a selected path.


 * [[Image:Path_DressupLeadInOut.svg|32px]] LeadInOut Dressup: Adds a lead-in and/or lead-out point to a selected path.


 * [[Image:Path_DressupRampEntry.svg|32px]] RampEntry Dressup: Adds ramp entry dressup modification to a selected path.


 * [[Image:Path_DressupTag.svg|32px]] Tag Dressup: Adds a holding tag dressup modification to a selected path.

Supplemental Commands

 * [[Image:Path_Fixture.svg|32px]] Fixture: Changes the fixture position.


 * [[Image:Path_Comment.svg|32px]] Comment: Inserts a comment in the G-code of a path.


 * [[Image:Path_Stop.svg|32px]] Stop: Inserts a full stop of the machine.


 * [[Image:Path_Custom.svg|32px]] Custom: Inserts custom G-code.


 * [[Image:Path_Shape.svg|32px]] From Shape: Creates a path object from a selected Part object. Path_experimental.

Path Modification

 * [[Image:Path_Copy.svg|32px]] Copy the operation in the job: Creates a parametric Copy of a selected path object.


 * [[Image:Path_Array.svg|32px]] Array: Creates an array by duplicating a selected path.


 * [[Image:Path_SimpleCopy.svg|32px]] Simple Copy: Creates a non-parametric copy of a selected path object.

Miscellaneous

 * [[Image:Path_Area.svg|32px]] Area: Creates a feature area from selected objects. Path_experimental.


 * [[Image:Path_Area_Workplane.svg|32px]] Area workplane: Creates a feature area workplane. Path_experimental.

Obsolete

 * [[Image:Path_ToolLibraryEdit.svg|32px]] Tool Manager: Edit the Tool Manager. 'Legacy' tool system.

ToolBit architecture
Manage tools, bits, and the Tool Library. Based on the ToolBit architecture.


 * Path Tools
 * Path ToolShape
 * Path ToolBit
 * Path ToolBit Library
 * Path ToolController

Other

 * Path FAQ: The Path Workbench shares many concepts with other CAM software packages but has its own peculiarities. If something seems wrong this is a good place to start.
 * Path SetupSheet: You can use a SetupSheet to customize how various property values for operations are calculated.
 * Path Postprocessor Customization: If you have a special machine which cannot use one of the available post-processors you may need to write your own post-processor.
 * Path fourth axis: Experimental four axis milling.
 * Path Development Roadmap: Read this if you are a developer and want to contribute to Path.

Preferences

 * [[Image:Preferences-path.svg|32px]] Preferences...: Preferences available in Path Tools.

Scripting
See the Path_scripting page.

The Path workbench offers a broad Python scripting API. With it, you can create and modify paths from python scripts, or extend the available functionality of the workbench.

Tutorials

 * Path Walkthrough for the Impatient: a quick tutorial to get familiar with Path.
 * FreeCAD Path: Custom paths with Python - Part 1 - 5: a playlist with a series of 5 videos in English by sliptonic. This series shows how to work with the Path Workbench.