This commit is contained in:
2026-09-11 03:46:11 +08:00
parent 45b9f9ed5d
commit b7f55aa631
114 changed files with 3646 additions and 576 deletions
@@ -0,0 +1,402 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class RadiusCompInterference | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class RadiusCompInterference | HiAPI-C# 2025 ">
<meta name="description" content="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. Today the gate is meaningful on the XY plane (G17) only: both compensation engines build the perpendicular as Z &#215; axis whatever plane is selected, so a G18/G19 region is neither compensated in its own plane nor checked here — the planeNormalDir parameters are ready for the day the engines pass the selected plane through.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="Hi.NcParsers.RadiusCompInterference">
<h1 id="Hi_NcParsers_RadiusCompInterference" data-uid="Hi.NcParsers.RadiusCompInterference" class="text-break">
Class RadiusCompInterference
</h1>
<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.NcParsers.html">NcParsers</a></dd></dl>
<dl><dt>Assembly</dt><dd>HiMech.dll</dd></dl>
</div>
<div class="markdown summary"><p>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.</p>
<p>
Today the gate is meaningful on the XY plane (G17) only: both
compensation engines build the perpendicular as <code>Z × axis</code>
whatever plane is selected, so a G18/G19 region is neither compensated
in its own plane nor checked here — the <code>planeNormalDir</code> parameters
are ready for the day the engines pass the selected plane through.
</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class RadiusCompInterference</code></pre>
</div>
<dl class="typelist inheritance">
<dt>Inheritance</dt>
<dd>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
<div><span class="xref">RadiusCompInterference</span></div>
</dd>
</dl>
<dl class="typelist inheritedMembers">
<dt>Inherited Members</dt>
<dd>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
</div>
</dd></dl>
<h2 class="section" id="fields">Fields
</h2>
<h3 id="Hi_NcParsers_RadiusCompInterference_ArcTolerance_mm" data-uid="Hi.NcParsers.RadiusCompInterference.ArcTolerance_mm">
ArcTolerance_mm
</h3>
<div class="markdown level1 summary"><p>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.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const double ArcTolerance_mm = 0.001</code></pre>
</div>
<h4 class="section">Field Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd></dd>
</dl>
<h3 id="Hi_NcParsers_RadiusCompInterference_DiagnosticId" data-uid="Hi.NcParsers.RadiusCompInterference.DiagnosticId">
DiagnosticId
</h3>
<div class="markdown level1 summary"><p>Diagnostic id shared by the SoftNc and HardNc compensation walks.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string DiagnosticId = &quot;RadiusComp--Interference&quot;</code></pre>
</div>
<h4 class="section">Field Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="methods">Methods
</h2>
<a id="Hi_NcParsers_RadiusCompInterference_TryDescribeArc_" data-uid="Hi.NcParsers.RadiusCompInterference.TryDescribeArc*"></a>
<h3 id="Hi_NcParsers_RadiusCompInterference_TryDescribeArc_Hi_Geom_Vec3d_Hi_Geom_Vec3d_Hi_Geom_Vec3d_System_Int32_System_Double_System_Int32_System_String__System_Collections_Generic_Dictionary_System_String_System_Object___" data-uid="Hi.NcParsers.RadiusCompInterference.TryDescribeArc(Hi.Geom.Vec3d,Hi.Geom.Vec3d,Hi.Geom.Vec3d,System.Int32,System.Double,System.Int32,System.String@,System.Collections.Generic.Dictionary{System.String,System.Object}@)">
TryDescribeArc(Vec3d, Vec3d, Vec3d, int, double, int, out string, out Dictionary&lt;string, object&gt;)
</h3>
<div class="markdown level1 summary"><p>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
<a class="xref" href="Hi.NcParsers.RadiusCompInterference.html#Hi_NcParsers_RadiusCompInterference_ArcTolerance_mm">ArcTolerance_mm</a> (the compensated arc collapses to a
point rather than reversing); returns true with a constant
notification <code class="paramref">text</code> and a value-carrying
<code class="paramref">detail</code> on interference.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool TryDescribeArc(Vec3d programEnd, Vec3d compensatedEnd, Vec3d center, int planeNormalDir, double offsetRadius_mm, int offsetId, out string text, out Dictionary&lt;string, object&gt; detail)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>programEnd</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>Programmed (nominal) end point of the arc.</p>
</dd>
<dt><code>compensatedEnd</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>Perpendicular offset of the arc end (the arc's own transient end, not
the corner intersection with the next block).</p>
</dd>
<dt><code>center</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>Arc centre in program coordinates.</p>
</dd>
<dt><code>planeNormalDir</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>Index (0/1/2) of the compensation plane's normal axis.</p>
</dd>
<dt><code>offsetRadius_mm</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>Unsigned offset radius applied by the region.</p>
</dd>
<dt><code>offsetId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The D row the region resolves its radius from.</p>
</dd>
<dt><code>text</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>Constant notification text (fold-stable), or null.</p>
</dd>
<dt><code>detail</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;</dt>
<dd><p>Offset radius, programmed arc radius and D row, or null.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_RadiusCompInterference_TryDescribeLinear_" data-uid="Hi.NcParsers.RadiusCompInterference.TryDescribeLinear*"></a>
<h3 id="Hi_NcParsers_RadiusCompInterference_TryDescribeLinear_Hi_Geom_Vec3d_Hi_Geom_Vec3d_System_Int32_System_Double_System_Int32_System_String__System_Collections_Generic_Dictionary_System_String_System_Object___" data-uid="Hi.NcParsers.RadiusCompInterference.TryDescribeLinear(Hi.Geom.Vec3d,Hi.Geom.Vec3d,System.Int32,System.Double,System.Int32,System.String@,System.Collections.Generic.Dictionary{System.String,System.Object}@)">
TryDescribeLinear(Vec3d, Vec3d, int, double, int, out string, out Dictionary&lt;string, object&gt;)
</h3>
<div class="markdown level1 summary"><p>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 <code class="paramref">text</code> and a value-carrying
<code class="paramref">detail</code> on interference.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool TryDescribeLinear(Vec3d programDisplacement, Vec3d compensatedDisplacement, int planeNormalDir, double offsetRadius_mm, int offsetId, out string text, out Dictionary&lt;string, object&gt; detail)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>programDisplacement</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>Nominal displacement of the block.</p>
</dd>
<dt><code>compensatedDisplacement</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>Displacement between the compensated end points of the previous block and this block.</p>
</dd>
<dt><code>planeNormalDir</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>Index (0/1/2) of the compensation plane's normal axis.</p>
</dd>
<dt><code>offsetRadius_mm</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>Unsigned offset radius applied by the region.</p>
</dd>
<dt><code>offsetId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The D row the region resolves its radius from.</p>
</dd>
<dt><code>text</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>Constant notification text (fold-stable), or null.</p>
</dd>
<dt><code>detail</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;</dt>
<dd><p>Offset radius, programmed and compensated lengths and D row, or null.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd></dd>
</dl>
</article>
<div class="contribution d-print-none">
</div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>