This repository has been archived on 2026-10-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
HiNC-2025-win-desktop-Deploy/App/wwwroot/HiAPI-docsite/api/Hi.NcParsers.Dependencys.StrokeLimitUtil.html
T
2026-09-15 01:12:50 +08:00

453 lines
19 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class StrokeLimitUtil | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class StrokeLimitUtil | HiAPI-C# 2025 ">
<meta name="description" content="Load-time audit helpers for : which machine-coordinate axes the chain has, and which of them the stroke limit check cannot judge because no limit is configured. Both checks — the per-block and the per-step — compare only axes that carry a limit, so a machine file without limits passes every position silently while EnableStrokeLimitCheck reads as on. The session begin reports that gap once through these helpers.">
<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.Dependencys.StrokeLimitUtil">
<h1 id="Hi_NcParsers_Dependencys_StrokeLimitUtil" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil" class="text-break">
Class StrokeLimitUtil
</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>.<a class="xref" href="Hi.NcParsers.Dependencys.html">Dependencys</a></dd></dl>
<dl><dt>Assembly</dt><dd>HiMech.dll</dd></dl>
</div>
<div class="markdown summary"><p>Load-time audit helpers for <a class="xref" href="Hi.NcParsers.Dependencys.IStrokeLimitConfig.html">IStrokeLimitConfig</a>: which
machine-coordinate axes the chain has, and which of them the stroke limit
check cannot judge because no limit is configured. Both checks — the
per-block <a class="xref" href="Hi.NcParsers.Semantics.StrokeLimitCheckSemantic.html">StrokeLimitCheckSemantic</a> and the per-step
<a class="xref" href="Hi.NcParsers.Dependencys.IStrokeLimitConfig.html#Hi_NcParsers_Dependencys_IStrokeLimitConfig_CheckStrokeLimit_Hi_Geom_DVec3d_System_IProgress_Hi_Common_Messages_IMessage__">CheckStrokeLimit(DVec3d, IProgress&lt;IMessage&gt;)</a> — compare only axes that
carry a limit, so a machine file without limits passes every position
silently while <code>EnableStrokeLimitCheck</code> reads as on. The session
begin reports that gap once through these helpers.</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class StrokeLimitUtil</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">StrokeLimitUtil</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_Dependencys_StrokeLimitUtil_McAxisNames" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.McAxisNames">
McAxisNames
</h3>
<div class="markdown level1 summary"><p>Machine-coordinate axis names, linear first then rotary.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static readonly string[] McAxisNames</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>
<h3 id="Hi_NcParsers_Dependencys_StrokeLimitUtil_Tolerance" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.Tolerance">
Tolerance
</h3>
<div class="markdown level1 summary"><p>Slack, in mm or degrees, past which a position counts as over a
stroke limit. A machine coordinate that arrives through a work
offset, a tilt and a kinematic solve carries rounding noise of the
order of 1e-12; a program that parks an axis exactly on its limit
(CHEM20180926: <code>G28 Z0</code> on a machine whose Z travel ends at 0)
used to be reported as &ldquo;0.0000 &gt; 0.0000&rdquo; on every such block and
step. A tenth of a micrometre / microdegree is far below any
control's resolution and above any arithmetic noise.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const double Tolerance = 0.0001</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>
<h2 class="section" id="methods">Methods
</h2>
<a id="Hi_NcParsers_Dependencys_StrokeLimitUtil_DescribeUnlimitedAxes_" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.DescribeUnlimitedAxes*"></a>
<h3 id="Hi_NcParsers_Dependencys_StrokeLimitUtil_DescribeUnlimitedAxes_System_Collections_Generic_IEnumerable_System_String__System_Func_System_String_System_Nullable_System_Double___System_Func_System_String_System_Nullable_System_Double___" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.DescribeUnlimitedAxes(System.Collections.Generic.IEnumerable{System.String},System.Func{System.String,System.Nullable{System.Double}},System.Func{System.String,System.Nullable{System.Double}})">
DescribeUnlimitedAxes(IEnumerable&lt;string&gt;, Func&lt;string, double?&gt;, Func&lt;string, double?&gt;)
</h3>
<div class="markdown level1 summary"><p>Describes the axes among <code class="paramref">axisNames</code> that the stroke
limit check cannot judge: an axis with neither end configured is
listed by name, an axis with one end only is listed with the missing
end (<code>&quot;Z (no negative limit)&quot;</code>). Empty when every axis has both
ends. A limit of NaN or ±infinity counts as not configured (the legacy
<code>HardNcEnv</code> boxes default to an infinite box).</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;string&gt; DescribeUnlimitedAxes(IEnumerable&lt;string&gt; axisNames, Func&lt;string, double?&gt; positiveLimit, Func&lt;string, double?&gt; negativeLimit)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>axisNames</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
<dd><p>The axes to audit, normally <a class="xref" href="Hi.NcParsers.Dependencys.StrokeLimitUtil.html#Hi_NcParsers_Dependencys_StrokeLimitUtil_GetChainAxisNames_Hi_Numerical_Xyzabc_IXyzabcChain_System_Boolean_">GetChainAxisNames(IXyzabcChain, bool)</a>.</p>
</dd>
<dt><code>positiveLimit</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</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.double">double</a>?&gt;</dt>
<dd><p>Positive-end limit per axis; null when not configured.</p>
</dd>
<dt><code>negativeLimit</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</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.double">double</a>?&gt;</dt>
<dd><p>Negative-end limit per axis; null when not configured.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_Dependencys_StrokeLimitUtil_GetChainAxisNames_" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.GetChainAxisNames*"></a>
<h3 id="Hi_NcParsers_Dependencys_StrokeLimitUtil_GetChainAxisNames_Hi_Numerical_Xyzabc_IXyzabcChain_System_Boolean_" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.GetChainAxisNames(Hi.Numerical.Xyzabc.IXyzabcChain,System.Boolean)">
GetChainAxisNames(IXyzabcChain, bool)
</h3>
<div class="markdown level1 summary"><p>The machine-coordinate axes <code class="paramref">chain</code> actually has: an
axis counts when a transformer is bound to its name
(<a class="xref" href="Hi.Numerical.Xyzabc.IXyzabcChain.html#Hi_Numerical_Xyzabc_IXyzabcChain_GetTransformerX">GetTransformerX()</a> …
<a class="xref" href="Hi.Numerical.Xyzabc.IXyzabcChain.html#Hi_Numerical_Xyzabc_IXyzabcChain_GetTransformerC">GetTransformerC()</a>). A three-axis chain yields
X, Y, Z only; a null chain yields nothing.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static List&lt;string&gt; GetChainAxisNames(IXyzabcChain chain, bool linearOnly = false)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>chain</code> <a class="xref" href="Hi.Numerical.Xyzabc.IXyzabcChain.html">IXyzabcChain</a></dt>
<dd><p>The machine chain, or null.</p>
</dd>
<dt><code>linearOnly</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>When true, only the translation axes (X, Y, Z) are returned. A travel
audit wants this: a linear axis always has a finite travel, so a
missing limit is unambiguously a gap, while a rotary table that turns
continuously legitimately has none and cannot be given one.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_Dependencys_StrokeLimitUtil_IsWithinRotaryTravel_" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.IsWithinRotaryTravel*"></a>
<h3 id="Hi_NcParsers_Dependencys_StrokeLimitUtil_IsWithinRotaryTravel_System_Double_System_Nullable_System_Double__System_Nullable_System_Double__" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.IsWithinRotaryTravel(System.Double,System.Nullable{System.Double},System.Nullable{System.Double})">
IsWithinRotaryTravel(double, double?, double?)
</h3>
<div class="markdown level1 summary"><p>Whether a rotary angle (degrees) lies within a travel given by its
two ends, either of which may be absent. A span of a full turn or
more admits every angle; otherwise the angle is wrapped into the
turn starting at the negative end before the test.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsWithinRotaryTravel(double angle_deg, double? negative_deg, double? positive_deg)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>angle_deg</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The angle to test.</p>
</dd>
<dt><code>negative_deg</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>?</dt>
<dd><p>The negative end, or null when unbounded.</p>
</dd>
<dt><code>positive_deg</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>?</dt>
<dd><p>The positive end, or null when unbounded.</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_Dependencys_StrokeLimitUtil_RotaryAdmissibility_" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.RotaryAdmissibility*"></a>
<h3 id="Hi_NcParsers_Dependencys_StrokeLimitUtil_RotaryAdmissibility_System_Collections_Generic_IEnumerable_Hi_NcParsers_Dependencys_INcDependency__" data-uid="Hi.NcParsers.Dependencys.StrokeLimitUtil.RotaryAdmissibility(System.Collections.Generic.IEnumerable{Hi.NcParsers.Dependencys.INcDependency})">
RotaryAdmissibility(IEnumerable&lt;INcDependency&gt;)
</h3>
<div class="markdown level1 summary"><p>The rotary-travel admissibility test for an inverse-kinematics solve
(<a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html#Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_Hi_Geom_Vec3d_System_Func_Hi_Geom_Vec3d_System_Boolean__Hi_Geom_Vec3d__">OrientationToMcAbc(Vec3d, Func&lt;Vec3d, bool&gt;, out Vec3d)</a>):
accepts a machine ABC (radians) whose configured A/B/C limits on the
list's <a class="xref" href="Hi.NcParsers.Dependencys.IStrokeLimitConfig.html">IStrokeLimitConfig</a> (degrees) are all met, so a
tilt solve prefers the branch the machine can reach. Null — admit
everything — when the list carries no stroke config or no rotary
limit at all. An axis whose two limits span a full turn or more is
always admissible; a narrower span is tested on the angle wrapped
into the turn that starts at the negative limit (the solver reports
atan2 angles, the limits are wherever the builder put them); a NaN
component (an axis the chain does not have) is not tested.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Func&lt;Vec3d, bool&gt; RotaryAdmissibility(IEnumerable&lt;INcDependency&gt; dependencyList)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>dependencyList</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="Hi.NcParsers.Dependencys.INcDependency.html">INcDependency</a>&gt;</dt>
<dd><p>The runner's effective dependency list.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;<a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>&gt;</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>