Table of Contents

Class RadiusCompInterference

Namespace
Hi.NcParsers
Assembly
HiMech.dll

Classifies cutter-compensation interference — the case a real control refuses under G41/G42: the compensated tool path runs against the programmed direction because the offset radius is larger than the inner feature it has to follow (an inner arc smaller than the offset, a groove bottom narrower than the tool). Fanuc stops with alarm PS0041 INTERFERENCE IN CUTTER COMPENSATION; Heidenhain and Siemens have equivalents. The simulation has no interference check and keeps running the swapped-side path — so a program that simulates cleanly can still stop on the machine, and a wrongly filled D row (the tool radius entered against a tool-centre CAM path that expects wear only) shows up as an overcut instead of an alarm. The diagnostics built from this class exist to close that gap; they never change the path.

The gate works on the selected G17/G18/G19 plane: both engines pass the block's plane through planeNormalDir, and the in-plane projections below use it (neither engine checks a polar G12.1 block). Until 2026-09-11 both engines built the perpendicular as Z × axis whatever plane was selected, so a G18/G19 region was offset along its normal and could never be judged here.

public static class RadiusCompInterference
Inheritance
RadiusCompInterference
Inherited Members

Fields

ArcTolerance_mm

How far (mm) the compensated arc end must sit beyond the arc centre before an arc counts as interfering. An offset equal to the inner radius collapses the compensated arc to a point — the tool exactly fills the corner, no overcut — and CAM rounding puts such end points a fraction of a micrometre on either side of the centre, so exact equality stays silent instead of flickering with the last decimal.

public const double ArcTolerance_mm = 0.001

Field Value

double

DiagnosticId

Diagnostic id shared by the SoftNc and HardNc compensation walks.

public const string DiagnosticId = "RadiusComp--Interference"

Field Value

string

Methods

TryDescribeArc(Vec3d, Vec3d, Vec3d, int, double, int, out string, out Dictionary<string, object>)

Classifies an arc block of a compensation region. Interference means the perpendicular offset of the arc's end point sits on the far side of the arc centre from the programmed end point, on the compensation plane — the compensated arc then runs against the programmed direction. Returns false for a degenerate programmed radius and for an offset equal to the inner radius within ArcTolerance_mm (the compensated arc collapses to a point rather than reversing); returns true with a constant notification text and a value-carrying detail on interference.

public static bool TryDescribeArc(Vec3d programEnd, Vec3d compensatedEnd, Vec3d center, int planeNormalDir, double offsetRadius_mm, int offsetId, out string text, out Dictionary<string, object> detail)

Parameters

programEnd Vec3d

Programmed (nominal) end point of the arc.

compensatedEnd Vec3d

Perpendicular offset of the arc end (the arc's own transient end, not the corner intersection with the next block).

center Vec3d

Arc centre in program coordinates.

planeNormalDir int

Index (0/1/2) of the compensation plane's normal axis.

offsetRadius_mm double

Unsigned offset radius applied by the region.

offsetId int

The D row the region resolves its radius from.

text string

Constant notification text (fold-stable), or null.

detail Dictionary<string, object>

Offset radius, programmed arc radius and D row, or null.

Returns

bool

TryDescribeLinear(Vec3d, Vec3d, int, double, int, out string, out Dictionary<string, object>)

Classifies a straight block of a compensation region (not the start-up block). Interference means the compensated displacement — from the previous compensated position to this block's compensated position — runs against the programmed displacement on the compensation plane: the corner intersections on either side of a step narrower than the offset radius cross over. Returns false for a collapsed (zero-length) compensated move; returns true with a constant notification text and a value-carrying detail on interference.

public static bool TryDescribeLinear(Vec3d programDisplacement, Vec3d compensatedDisplacement, int planeNormalDir, double offsetRadius_mm, int offsetId, out string text, out Dictionary<string, object> detail)

Parameters

programDisplacement Vec3d

Nominal displacement of the block.

compensatedDisplacement Vec3d

Displacement between the compensated end points of the previous block and this block.

planeNormalDir int

Index (0/1/2) of the compensation plane's normal axis.

offsetRadius_mm double

Unsigned offset radius applied by the region.

offsetId int

The D row the region resolves its radius from.

text string

Constant notification text (fold-stable), or null.

detail Dictionary<string, object>

Offset radius, programmed and compensated lengths and D row, or null.

Returns

bool