This commit is contained in:
2026-09-15 01:12:50 +08:00
parent 2db889ad89
commit 1a75503105
99 changed files with 4168 additions and 726 deletions
@@ -309,6 +309,59 @@ the solution only fit the orientation part of the <code class="paramref">tiltMat
<a id="Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_" data-uid="Hi.Numerical.Xyzabc.IMachineKinematics.OrientationToMcAbc*"></a>
<h3 id="Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_Hi_Geom_Mat4d_System_Func_Hi_Geom_Vec3d_System_Boolean__Hi_Geom_Vec3d__" data-uid="Hi.Numerical.Xyzabc.IMachineKinematics.OrientationToMcAbc(Hi.Geom.Mat4d,System.Func{Hi.Geom.Vec3d,System.Boolean},Hi.Geom.Vec3d@)">
OrientationToMcAbc(Mat4d, Func&lt;Vec3d, bool&gt;, out Vec3d)
</h3>
<div class="markdown level1 summary"><p><a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html#Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_Hi_Geom_Mat4d_Hi_Geom_Vec3d__">OrientationToMcAbc(Mat4d, out Vec3d)</a> restricted to the
rotary positions <code class="paramref">isMcAbcAdmissible</code> accepts (the
machine's rotary travel, typically). A full orientation fixes the
rotary positions up to axis periodicity, so a solution the predicate
refuses is a posture this machine cannot take: the conversion then
fails (false) and leaves the solver state as it was, so that the
caller can fall back to <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>,
where the free rotation about the tool axis opens the other branch.
A null predicate admits everything.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">bool OrientationToMcAbc(Mat4d tiltMat, Func&lt;Vec3d, bool&gt; isMcAbcAdmissible, out Vec3d mcAbc_rad)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>tiltMat</code> <a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a></dt>
<dd><p>The tilt matrix to convert.</p>
</dd>
<dt><code>isMcAbcAdmissible</code> <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><p>Accepts a machine ABC (radians) or refuses it; null admits everything.</p>
</dd>
<dt><code>mcAbc_rad</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>Output machine ABC coordinates in radians.</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><p>Whether an admissible conversion was found.</p>
</dd>
</dl>
<a id="Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_" data-uid="Hi.Numerical.Xyzabc.IMachineKinematics.OrientationToMcAbc*"></a>
<h3 id="Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_Hi_Geom_Vec3d_Hi_Geom_Vec3d__" data-uid="Hi.Numerical.Xyzabc.IMachineKinematics.OrientationToMcAbc(Hi.Geom.Vec3d,Hi.Geom.Vec3d@)">
@@ -359,6 +412,65 @@ likely to converge for tilt configurations such as <code>G68.2 I180 J90 K0</code
<a id="Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_" data-uid="Hi.Numerical.Xyzabc.IMachineKinematics.OrientationToMcAbc*"></a>
<h3 id="Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_Hi_Geom_Vec3d_System_Func_Hi_Geom_Vec3d_System_Boolean__Hi_Geom_Vec3d__" data-uid="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)
</h3>
<div class="markdown level1 summary"><p><a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html#Hi_Numerical_Xyzabc_IMachineKinematics_OrientationToMcAbc_Hi_Geom_Vec3d_Hi_Geom_Vec3d__">OrientationToMcAbc(Vec3d, out Vec3d)</a> preferring the
solution branch <code class="paramref">isMcAbcAdmissible</code> accepts. The
axial-only problem has two branches on a two-rotary-axis machine
(on a table-table A/C: (A, C) and (−A, C+180°)); the plain overload
returns the branch nearest the solver's seed, which from the rotary
pole (A0 C0) is the one the tilt's azimuth happens to favour — half
the time the branch a cradle table with an asymmetric tilt travel
cannot reach (CHEM20180926 N100: <code>G68.2 I210 J-90</code> + <code>G53.1</code>
solved to A=+90° on a −120°…+30° A axis). When the nearest branch is
refused, an implementation with a real solver searches the other
branches and returns the admissible one nearest the seed; when none
is admissible it returns the refused solution and true, and the
stroke-limit check downstream reports it. A null predicate makes this
the plain overload. The default implementation is the plain solve —
the predicate is advisory for an implementation without a solver.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">bool OrientationToMcAbc(Vec3d toolAxialNormal, Func&lt;Vec3d, bool&gt; isMcAbcAdmissible, out Vec3d mcAbc_rad)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>toolAxialNormal</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>Target tool axial direction in table coordinates.</p>
</dd>
<dt><code>isMcAbcAdmissible</code> <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><p>Accepts a machine ABC (radians) or refuses it; null admits everything.</p>
</dd>
<dt><code>mcAbc_rad</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>Output machine ABC coordinates in radians.</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><p>Whether the conversion was successful (admissible or not).</p>
</dd>
</dl>
<a id="Hi_Numerical_Xyzabc_IMachineKinematics_PnToMc_" data-uid="Hi.Numerical.Xyzabc.IMachineKinematics.PnToMc*"></a>
<h3 id="Hi_Numerical_Xyzabc_IMachineKinematics_PnToMc_Hi_Geom_DVec3d_Hi_Geom_DVec3d__" data-uid="Hi.Numerical.Xyzabc.IMachineKinematics.PnToMc(Hi.Geom.DVec3d,Hi.Geom.DVec3d@)">