CAM DressupZCorrect

CAM DressupZCorrect CAM DressupZCorrect

Menu location

CAM  Path Dressup  Z Depth Correction

Toolbar

Path Modification → Dressup Operations dropdown

Workbenches

CAM

Default shortcut

None

Introduced in version

-

See also

CAM Probe

Description

The CAM DressupZCorrect CAM DressupZCorrect command corrects the Z depth of an existing Toolpath using a map of probed surface heights. It reads a probe point file, builds a B-spline interpolation surface through the points and shifts the Z of every move by the interpolated surface height at that X, Y. This compensates for Stock that is not parallel to the machine table, for example when engraving a warped PCB. Arcs are discretised and every move is output as G1. Its tooltip reads: Corrects Z depth using a probe map.

Usage

  1. Create the probe file, for example with a CAM Probe Operation (G38 probing) on the machine.

  2. Select one Operation or Dressup.

  3. There are several ways to invoke the command:

    • Select the CAM  Path Dressup  Z Depth Correction option from the menu.

    • Select the Dressup Operations dropdown on the Path Modification toolbar.

    • Select the Path Dressup  Z Depth Correction option from the Tree view context menu.

  4. In the task panel enter or browse for the probe file. While the panel is open the interpolated surface is shown as a transparent yellow object placed at the top of the Stock.

  5. Press OK.

Probe file format

The probe file is a plain text file with one point per line, the first three whitespace-separated numbers being X, Y and Z (the LinuxCNC G38 probe log format with nine values XYZABCUVW is accepted; extra columns are ignored). A comma is accepted as decimal separator. introduced in 26.3 Lines that do not contain three numbers are skipped with a warning. At least three points are required; the points should form a rectangular grid, missing grid positions are filled with the average Z of their row.

Options

The task panel is titled Z Depth Correction:

  • Probe Points File → File Name: The file containing the probe data, with a … button to browse.

All other settings are edited in the property editor.

Properties

Path
  • Base (Link): The base Toolpath to modify.

  • interpSurface (Shape): The interpolated surface; internal.

ProbeData
  • probefile (File): The point file from the surface probing. Note the lower-case property name.

Interpolate
  • Arc Interpolate (Distance): Deflection distance used to discretise arcs; default 0.1 mm.

  • Seg Interpolate (Distance): Straight segments are broken into smaller segments of this length so the Z correction follows the surface; default 1.0 mm.

Limitations

  • introduced in 26.3 If any point of the Toolpath lies outside the probed area, the dressup prints a warning with the point and the probe area bounds and outputs the unmodified base Toolpath (earlier versions raised an error).

  • If the probe file is missing or invalid, the base Toolpath is passed through unchanged.

  • introduced in 26.3 The dressup corrects only a Toolpath whose Work Plane is parallel to the machine table. For a Work Plane with a different Tool Axis, the dressup prints the warning Z correction needs a work plane parallel to the table; path left unchanged and outputs the unmodified base Toolpath.

  • introduced in 26.3 The Toolpath points are in the frame of the Work Plane of the Operation that the dressup modifies. The dressup converts each point to document coordinates and reads the probe map at that X, Y position. The warning for a point outside the probed area shows the point in document coordinates.

Scripting

import FreeCAD
import Path.Dressup.Gui.ZCorrect as ZCorrect
import PathScripts.PathUtils

obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", "ZCorrectDressup")
ZCorrect.ObjectDressup(obj)
obj.Base = op
ZCorrect.ViewProviderDressup(obj.ViewObject)
PathScripts.PathUtils.addToJob(obj)

obj.probefile = "/path/to/probe.txt"
obj.SegInterpolate = 2
FreeCAD.ActiveDocument.recompute()