CAM DressupZCorrect
Description
The 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
-
Create the probe file, for example with a CAM Probe Operation (G38 probing) on the machine.
-
Select one Operation or Dressup.
-
There are several ways to invoke the command:
-
Select the option from the menu.
-
Select the Dressup Operations dropdown on the Path Modification toolbar.
-
Select the option from the Tree view context menu.
-
-
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.
-
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
-
Base (
Link): The base Toolpath to modify. -
interpSurface (
Shape): The interpolated surface; internal.
-
probefile (
File): The point file from the surface probing. Note the lower-case property name.
-
Arc Interpolate (
Distance): Deflection distance used to discretise arcs; default0.1 mm. -
Seg Interpolate (
Distance): Straight segments are broken into smaller segments of this length so the Z correction follows the surface; default1.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 unchangedand 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()