CAM Surface

This operation requires OpenCamLib and the preference Edit  Preferences  CAM  Advanced  Enable OCL dependent features. Enabling it requires a restart of FreeCAD.
This page is incomplete; it was marked as unfinished on the wiki.

CAM Surface CAM Surface

Menu location

CAM  3D Surface

Toolbar

New Operations → 3D Surface (only shown when OCL dependent features are enabled)

Workbenches

CAM

Default shortcut

None

Introduced in version

0.19

See also

CAM Waterline, CAM RotarySurface

Description

The CAM Surface CAM Surface command creates a new 3D Surface operation which is capable of generating G-code paths for the entire top surface of a 3D model (or is able to work with selected faces) and allows for faces to be avoided. Its tooltip reads: Create a 3D Surface Operation from a model. This operation offers multiple cut patterns: Line, Zigzag, Circular, Circular Zigzag, Offset, and Spiral (similar to an adaptive pattern). This Operation offers many customizations through its properties; most are only accessible in the Property view.

The 3D Surface command is also capable of generating basic rotational 3D surfacing paths. The rotational capabilities are limited to the entire model, and do not allow for specific faces or regions to be isolated. The rotational paths are also limited to line cut patterns.

The command interfaces to OCL.pyd, a 3rd party Open Source module titled OpenCamLib, that generates Toolpaths from a 3D model. OpenCamLib is not integrated directly into FreeCAD.

Note: In order to use the 3D Surface operation you must:

  1. Properly install OpenCamLib.

  2. Check Edit  Preferences  CAM  Advanced  Enable OCL dependent features and restart FreeCAD.

Usage

Usage instructions for multiple variations of the 3D Surface operation are presented here.

Basic Operation

  1. Press the CAM Surface 3D Surface icon, or select CAM  3D Surface from the dropdown menu.

  2. On the Tool Controller tab select the Tool Controller and Coolant mode. 26.3 and later

  3. In the Base Geometry tab, select any specific faces you wish to focus on and/or avoid for the operation.

  4. On the Heights tab adjust Clearance, Retract, Start depth, Final depth and Step down. 26.3 and later depths and heights share a single Heights tab.

  5. Configure settings in the Operation tab as needed:

    • Choose the Bounding box: Stock or BaseBoundBox.

    • Set the Scan type for the operation: Planar or Rotational.

    • Select the Layer mode for the operation: Single-pass or Multi-pass.

      1. Single-pass is for a finishing pass.

      2. Multi-pass could be used for clearing in combination with the use of Depth offset to leave a thin surface layer for a finish pass.

    • Set the Cut pattern, Profile edges and Avoid last X faces (Planar scans only).

    • Add additional Bounding box extra offset to X and Y as desired (Rotational scans only).

    • Set the Drop cutter direction: X or Y. This is the linear direction the cutter (spindle) will travel. (Rotational scans only)

    • Add a Depth offset value if you wish to leave a specified thickness of material on the surface, for say a final finish pass.

    • Set the Sample interval used for the OCL scan (default 1 mm).

    • Set the Step over value as a percentage of the diameter of the Tool Bit (default 50).

    • Check the Use start point box if you wish to provide a start point for the operation in the properties view of the data tab for the operation.

    • Boundary enforcement is enabled by default. This forces the cutter to remain inside the boundaries of the feature geometry for the operation, like a pocketing operation. Disable to allow the cutter to extend to the outside of the feature geometry. The Boundary Adjustment property supersedes this property.

    • Optimize linear paths is enabled by default. Disabling will yield a longer G-code result and likely increase cut time.

    • Optimize stepover transitions (Planar scans only).

  6. If you wish to preview the result before accepting the settings, click Apply.

  7. Click OK button to confirm and generate the Toolpath.

To achieve different, or more complex, effects, adjust additional operation properties within the Data tab of the Properties View for the operation.

Rotational Scans (4th-axis)

  1. Initiate a Basic Operation as described above and set the Scan Type to Rotational.

  2. Note: Face selection is unavailable for Rotational scans, so changes to Base Geometry are ignored.

  3. Locate the Data tab and Properties View for the new 3D Surface operation. A Rotation section should be available with additional properties to adjust, listed below.
    It is recommended that you set the desired rotation properties all at once before recomputing. This is done by clicking the ENTER key immediately after changing a property setting. This process will allow you to change and save multiple properties before recomputing the operation.

  4. Adjust the following settings as needed:

    • Set Cutter Tilt to the cutter tilt angle in degrees, range -90 to 90 (used with ball end Tool Bits).

    • Change Drop Cutter Dir to the axis of travel for the cutter (spindle).

    • Change Drop Cutter Extra Offset to extend the BoundBox in the X and Y directions.

    • Set Rotation Axis to the desired axis.

    • Adjust Start Index to start index(angle) [0-360].

    • Adjust Stop Index to stop index(angle) [0-360].

  5. Click the View refresh Refresh icon in the tool bar.

  6. Wait for the results…​

Notes About Rotational Scans
  • Rotational scans require much more time and processing than Planar scans. Factors affecting processing time include: Sample Interval, Step Over, Tool Bit diameter, and model size. Again, rotational scans can take a long time. Some might take 3, 5 or 10 minutes or longer.

  • For time purposes, it is better that you not recompute a rotational scan after every property change; rather, consider one of the following:

    • use the ' change all settings with ENTER key ' technique mentioned in Step 2 above, then View refresh Refresh the operation.

    • deactivate the operation with the CAM OpActiveToggle Active toggle tool, make your changes to the operation’s properties, then click the CAM OpActiveToggle Active icon again to re-activate the operation - which triggers a recompute internally.

  • Rotational scans are less mature than planar scans; report issues in the FreeCAD CAM Forum.

  • Neither the CAM SimulatorGL CAM Simulator nor the CAM Simulator Legacy CAM Simulator simulates 4th-axis motion. Use CAMotics or another external simulator to verify rotational Toolpaths.

  • You will likely see red rotational lines around your model in the viewport. This is normal in FreeCAD for the time being.

Notes About Scans of complex models

Excessively long processing times (longer than 10 minutes) can occur when processing large complex models. In addition to the factors already mentioned the following steps could help identify potential causes and solutions.

Low Memory
Check how much memory is available while the scan is running using a tool such as the Windows Task Manager, Memory tab. If more than 90% of memory is consistently being used then a small Linear Deflection parameter could be generating a mesh that is too large for the available memory.
To confirm this:

  1. Create a new CAM Surface 3D Surface command.

  2. Switch to the Model tab and increase the Linear Deflection value. For example change from 2.5um to 20um.

  3. Switch back to the Tasks tab to complete setting up the operation.

  4. Click OK button to confirm and generate the Toolpath.

Linear Deflection defaults to one quarter of the Job’s Geometry Tolerance property. To change the default for all new Jobs (and thereby all new CAM Surface 3D Surface operations), edit Edit  Preferences  CAM  Job Preferences  Default geometry tolerance.

Invalid Geometry
If a model contains invalid geometry the scanning time can increase significantly. A model can be checked using the Part CheckGeometry function in Workbench Part Part Workbench.
To run the tool:

  1. Switch to the image:Workbench_Part.svgPart Workbench and select the model to check

  2. Click on the Part CheckGeometry Part CheckGeometry button available in the Part workbench toolbar OR use the Part  Check geometry entry from the top menu.

  3. Click the Run Check button and review the results.

If the results includes items like BOPAlgo SelfIntersect then the geometry is invalid and should be corrected by adjusting the model.
(Hint: Boolean operations and Loft commands can sometimes introduce Self Intersections)

Available Tool (Cutter) Shapes

This 3D Surface op currently uses OpenCamLib to extract Toolpaths from the part base. As such, a translation is required between the FreeCAD Tool Bit and OCL in order to complete the scan with your chosen Tool Shape.

These Tool Shapes are respected and available for this 3D Surface operation:

  • Endmill

  • Ballend

  • Bullnose

  • TaperedBallNose (treated as a ball end of the same diameter)

  • V-bit (treated as a cone with the cutting edge angle)

  • Drill (treated as a cone with the tip angle)

Chamfer, Dovetail, Radius, Reamer, Slitting saw, Tap, Thread-mill and Probe are not supported; the Operation reports Failed to map selected tool to an OCL tool type. Please post any feedback about the FreeCAD-to-OCL translation of non-endmill Tool Shapes to the CAM section in the FreeCAD forums.

Properties

Note: Not all of these Properties are available in the Task Window Editor. Some are only accessible in the Data tab of the Properties View panel for this Operation.

Base

Note: It is suggested that you do not edit the Placement property of path operations. Rather, move or rotate the CAM Job model as needed.

  • Placement: Overall placement [position and rotation] of the object - with respect to the origin (or origin of parent object container)

    • Angle: Angle in degrees applied to rotation of the object around Axis property value

    • Axis: Axis (one or multiple) around which to rotate the object, set in sub-properties: X, Y, Z

      • X: X-axis value

      • Y: Y-axis value

      • Z: Z-axis value

    • Position: Position of the object, set in sub-properties: X, Y, Z - with respect to the origin (or origin of parent object container)

      • X: X-distance value

      • Y: Y-distance value

      • Z: Z-distance value

  • Label: User-provided name of the object (UTF-8)

Clearing Options
  • Bound Box: Select the overall boundary for the Operation. Values: BaseBoundBox (default), Stock

  • Cut Mode: Set the direction for the Tool Bit to engage the material: Climb (clockwise) or Conventional (counterclockwise). Default Conventional

  • Cut Pattern: Set the geometric clearing pattern to use for the Operation. Values: Circular, CircularZigZag, Line (default), Offset, Spiral, ZigZag. Hidden when Scan Type is Rotational

  • Cut Pattern Angle: The yaw angle used for the Line and ZigZag clearing patterns, in degrees. Default 0

  • Cut Pattern Reversed: Reverse the cut order of the stepover paths. For circular cut patterns, begin at the outside and work toward the center

  • Depth Offset: Z-axis offset from the surface of the object

  • Layer Mode: Complete the Operation in a single pass at depth, or multiple passes to final depth. Values: Single-pass (default), Multi-pass

  • Pattern Center At: Choose location of the center point for starting the cut pattern. Values: CenterOfMass (default), CenterOfBoundBox, XminYmin, Custom. Only shown for the Circular, CircularZigZag and Spiral patterns

  • Pattern Center Custom: Set the start point for the cut pattern

  • Profile Edges: Profile the edges of the selection. There are the following options (images can be seen in this forum post: forum.freecad.org/viewtopic.php?p=676452#p676452):

    • None (default): Don’t create a profile

    • Only: Create only a profile and no inner paths

    • First: Start with the profile and then do the rest

    • Last: Start with the rest and then do the profile

  • Sample Interval: Set the sampling resolution. Smaller values quickly increase processing time. Default 1 mm; limited to 0.0001-25.4 mm

  • Step Over: Step over as a percentage of the Tool Bit diameter. Default 50, range 1-100

Depth
  • Clearance Height: The height needed to clear clamps and obstructions

  • Final Depth: Final Depth of Tool- lowest value in Z

  • Safe Height: Rapid safety height between locations.

  • Start Depth: Starting Depth of Tool- first cut depth in Z

  • Step Down: Incremental Step Down of Tool

Mesh Conversion
  • Angular Deflection: Reserved; currently not used by the mesh conversion. Default 0.25

  • Linear Deflection: Smaller values yield a finer, more accurate mesh; they do not increase processing time much but can increase memory consumption. Default: Job Geometry Tolerance / 4 (0.001 mm if the tolerance is 0)

Optimization
  • Circular Use G2 G3: Convert co-planar arcs to G2/G3 gcode commands for 'Circular' and 'CircularZigZag' cut patterns

  • Gap Sizes: Feedback only: the three smallest gaps identified in the Toolpath geometry (default "No gaps identified.")

  • Gap Threshold: Collinear and co-radial artifact gaps that are smaller than this threshold are closed in the Toolpath. Default 0.005 mm

  • Optimize Linear Paths: Enable optimization of linear paths (co-linear points). Removes unnecessary co-linear points from G-Code output

  • Optimize Step Over Transitions: Enable separate optimization of transitions between, and breaks within, each step over path

Path
  • Active: Make False, to prevent operation from generating code

  • Base: The base geometry for this operation

  • Block Delete: Enable post processor to add block delete commands. introduced in 26.3

  • Comment: An optional comment for this Operation

  • Coolant Mode: Coolant mode for this Operation. Values: None, Flood, Mist

  • Cycle Time: Operations Cycle Time Estimation

  • Tool Controller: The Tool Controller that will be used to calculate the Toolpath

  • User Label: User assigned label

  • Workplane: introduced in 26.3 The link to the Work Plane that the Operation works in. An Operation with no link works in the XY of the Job.

Rotation

These properties are only visible when Scan Type is Rotational.

  • Cutter Tilt: Cutter tilt angle in degrees, -90 to 90, default 0

  • Drop Cutter Dir: Dropcutter lines are created parallel to this axis (X or Y)

  • Drop Cutter Extra Offset: Additional offset to the selected bounding box - use sub-properties to set values

    • X: X-distance value

    • Y: Y-distance value

    • Z: Z-distance value

  • Rotation Axis: The Model will be rotated around this axis (X default, or Y)

  • Start Index: Start angle for the rotational scan, 0-360, default 0

  • Stop Index: Stop angle for the rotational scan, 0-360, default 360

Selected Geometry Settings
  • Avoid Last X Faces: Avoid cutting the last 'N' faces in the Base Geometry list of selected faces. Default 0, maximum 100

  • Avoid Last X Internal Features: Do not cut internal features on avoided faces

  • Boundary Adjustment: Positive values push the cutter toward, or beyond, the boundary. Negative values retract the cutter away from the boundary

  • Boundary Enforcement: If true, the cutter will remain inside the boundaries of the model or selected face(s)

  • Handle Multiple Features: Choose how to process multiple Base Geometry features. Values: Collectively (default), Individually

  • Internal Features Adjustment: Positive values push the cutter toward, or into, the feature. Negative values retract the cutter away from the feature

  • Internal Features Cut: Cut internal feature areas within a larger selected face

Start Point
  • Start Point: The custom start point for the Toolpath of this operation, set in sub-properties: X, Y, Z

    • X: X-axis value

    • Y: Y-axis value

    • Z: Z axis value

  • Use Start Point: Make True, if specifying a Start Point

Surface
  • Scan Type: Planar: Flat, 3D surface scan. Rotational: 4th-axis rotational scan.

Op Values

Read-only values computed by the Operation:

  • Op Start Depth: Holds the calculated value for the StartDepth

  • Op Final Depth: Holds the calculated value for the FinalDepth

  • Op Tool Diameter: Holds the diameter of the Tool Bit

  • Op Stock Z Max: Holds the max Z value of Stock

  • Op Stock Z Min: Holds the min Z value of Stock

Tasks Window Editor Layout

Descriptions for the settings are provided in the Properties list above.

This section is simply a layout map of the settings in the window editor for the Operation.

Base Geometry

  • Base Geometry import selection: Use this list to select Base Geometry to be imported from the selected, existing operation

  • Import: Imports the selected operation’s Base Geometry into the current operations Base Geometry list

  • Base Geometry list for current operation: List of Base Geometry for current operation, if any selected

  • Add: Adds selected element(s) which should be the base(s) for the Toolpath(s)

  • Remove: Remove the selected item(s) in the Base Geometry list

  • Clear: Clear all items in the Base Geometry list

Heights

  • Clearance Height (Clearance)

  • Safe Height (Retract)

  • Start Depth

  • Step Down

  • Final Depth

Tool Controller

26.3 and later

  • Tool Controller

  • Coolant Mode

  • The feeds and speeds of the selected Tool Controller

Operation

  • Bounding box

  • Scan type

  • Layer mode

  • Cut pattern *

  • Profile edges *

  • Avoid last X faces *

  • Bounding box extra offset X, Y **

  • Drop cutter direction **

  • Depth offset

  • Step over

  • Sample interval

  • Use start point

  • Optimize linear paths

  • Boundary enforcement

  • Optimize stepover transitions *

(* Planar only, ** Rotational only.)

Scripting

import Path.Op.Surface as PathSurface

op = PathSurface.Create('Surface')
op.ToolController = job.Tools.Group[0]
op.ScanType = 'Planar'
op.CutPattern = 'ZigZag'
op.StepOver = 30
doc.recompute()

Resources

  • CAM Camotics: runs CAMotics on the Job from within FreeCAD when CAMotics is installed.

  • G-code(path) simulator: NCViewer

  • G-code(path) simulator: CAMotics