This commit is contained in:
2026-09-09 17:35:23 +08:00
parent 2a98ae7556
commit 161af68fe3
1271 changed files with 58251 additions and 98639 deletions
@@ -149,6 +149,48 @@ Class ActUtil
<h2 class="section" id="fields">Fields
</h2>
<h3 id="Hi_Numerical_Acts_ActUtil_MaxStepNumPerAct" data-uid="Hi.Numerical.Acts.ActUtil.MaxStepNumPerAct">
MaxStepNumPerAct
</h3>
<div class="markdown level1 summary"><p>Hard cap on the number of steps one act may split into. The finest
machining resolution the runner accepts (1/4096 mm, the lower bound of
the machining-resolution clamp) over a one-metre traverse is ~4M steps; a real quotient
beyond that means a degenerate resolution or geometry, not a finer
request. Without the cap, <code>(int)</code> of an infinite or huge
quotient saturates to <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32.maxvalue">MaxValue</a> on .NET 9+ and the
act plays as 2^31 zero-duration steps — the &ldquo;one line, frozen cycle
time, step index climbing forever&rdquo; hang.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const int MaxStepNumPerAct = 4000000</code></pre>
</div>
<h4 class="section">Field Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="methods">Methods
</h2>
@@ -200,17 +242,33 @@ Class ActUtil
<a id="Hi_Numerical_Acts_ActUtil_GetStepNum_" data-uid="Hi.Numerical.Acts.ActUtil.GetStepNum*"></a>
<h3 id="Hi_Numerical_Acts_ActUtil_GetStepNum_Hi_Common_SeqPair_Hi_Geom_DVec3d__Hi_Numerical_Xyzabc_IMachineKinematics_System_Double_Hi_Numerical_MachiningMotionResolutionUtils_IMachiningMotionResolution_" data-uid="Hi.Numerical.Acts.ActUtil.GetStepNum(Hi.Common.SeqPair{Hi.Geom.DVec3d},Hi.Numerical.Xyzabc.IMachineKinematics,System.Double,Hi.Numerical.MachiningMotionResolutionUtils.IMachiningMotionResolution)">
GetStepNum(SeqPair&lt;DVec3d&gt;, IMachineKinematics, double, IMachiningMotionResolution)
<h3 id="Hi_Numerical_Acts_ActUtil_GetStepNum_Hi_Common_SeqPair_Hi_Geom_DVec3d__Hi_Numerical_Xyzabc_IMachineKinematics_System_Double_Hi_Numerical_MachiningMotionResolutionUtils_IMachiningMotionResolution_System_TimeSpan_" data-uid="Hi.Numerical.Acts.ActUtil.GetStepNum(Hi.Common.SeqPair{Hi.Geom.DVec3d},Hi.Numerical.Xyzabc.IMachineKinematics,System.Double,Hi.Numerical.MachiningMotionResolutionUtils.IMachiningMotionResolution,System.TimeSpan)">
GetStepNum(SeqPair&lt;DVec3d&gt;, IMachineKinematics, double, IMachiningMotionResolution, TimeSpan)
</h3>
<div class="markdown level1 summary"><p>Gets the step number for a machine coordinate sequence.</p>
<div class="markdown level1 summary"><p>Gets the step number for a rotary-bearing (XYZABC) machine coordinate
move. Two motions are bounded separately and the larger count wins:</p>
<ul><li>the posture change — each rotary axis delta over
<a class="xref" href="Hi.Numerical.MachiningMotionResolutionUtils.IMachiningMotionResolution.html#Hi_Numerical_MachiningMotionResolutionUtils_IMachiningMotionResolution_RotaryAxisResolution_rad">RotaryAxisResolution_rad</a>;</li><li>the travel — by the resolution's time criterion
(<a class="xref" href="Hi.Numerical.MachiningMotionResolutionUtils.IMachiningMotionResolution.html#Hi_Numerical_MachiningMotionResolutionUtils_IMachiningMotionResolution_GetStepNumByDuration_System_TimeSpan_System_Double_">GetStepNumByDuration(TimeSpan, double)</a>, one
step per spindle cycle) when it applies, otherwise the real tool-tip
travel of the equipped tool over
<a class="xref" href="Hi.Numerical.MachiningMotionResolutionUtils.IMachiningMotionResolution.html#Hi_Numerical_MachiningMotionResolutionUtils_IMachiningMotionResolution_LinearResolution_mm">LinearResolution_mm</a>.</li></ul>
With a posture change the tip travel is never divided by a feed-derived
linear resolution: that resolution describes the controller's commanded
CL point, and under RTCP the real tip can sweep hundreds of millimetres
while the CL point stands still. Without a posture change the tip
translates with the CL point, so the tip travel over the linear
resolution is the CL point's own count — the act keeps the distance
form, exactly the number the XYZ-only splitters produce (Soft/Hard
parity on a 3-axis move that one engine wraps as an XYZABC act; a
time count would differ by one on <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a> tick rounding).
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static int GetStepNum(SeqPair&lt;DVec3d&gt; mcSeq, IMachineKinematics coordinateConverter, double toolHeightForComputingStepNum, IMachiningMotionResolution ncResolution)</code></pre>
<pre><code class="lang-csharp hljs">public static int GetStepNum(SeqPair&lt;DVec3d&gt; mcSeq, IMachineKinematics coordinateConverter, double toolHeightForComputingStepNum, IMachiningMotionResolution ncResolution, TimeSpan duration)</code></pre>
</div>
<h4 class="section">Parameters</h4>
@@ -219,13 +277,16 @@ Class ActUtil
<dd><p>The machine coordinate sequence.</p>
</dd>
<dt><code>coordinateConverter</code> <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html">IMachineKinematics</a></dt>
<dd><p>The coordinate converter to use.</p>
<dd><p>The coordinate converter to use; null when no tool-tip travel is available.</p>
</dd>
<dt><code>toolHeightForComputingStepNum</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The tool height for computing step number.</p>
<dd><p>The equipped tool's spindle-buckle-to-tip length.</p>
</dd>
<dt><code>ncResolution</code> <a class="xref" href="Hi.Numerical.MachiningMotionResolutionUtils.IMachiningMotionResolution.html">IMachiningMotionResolution</a></dt>
<dd><p>The machining motion resolution.</p>
</dd>
<dt><code>duration</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
<dd><p>The act's duration, for the time criterion.</p>
</dd>
</dl>
@@ -288,6 +349,92 @@ Class ActUtil
<a id="Hi_Numerical_Acts_ActUtil_GetToolTipTravel_" data-uid="Hi.Numerical.Acts.ActUtil.GetToolTipTravel*"></a>
<h3 id="Hi_Numerical_Acts_ActUtil_GetToolTipTravel_Hi_Geom_DVec3d_Hi_Geom_DVec3d_Hi_Numerical_Xyzabc_IMachineKinematics_System_Double_" data-uid="Hi.Numerical.Acts.ActUtil.GetToolTipTravel(Hi.Geom.DVec3d,Hi.Geom.DVec3d,Hi.Numerical.Xyzabc.IMachineKinematics,System.Double)">
GetToolTipTravel(DVec3d, DVec3d, IMachineKinematics, double)
</h3>
<div class="markdown level1 summary"><p>Real tool-tip travel between two machine coordinates: the chord between
the tips of the equipped tool (<code class="paramref">compensationHeight</code>
below the spindle buckle along the tool normal) at both poses.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static double GetToolTipTravel(DVec3d mcXyzabc0, DVec3d mcXyzabc1, IMachineKinematics coordinateConverter, double compensationHeight)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>mcXyzabc0</code> <a class="xref" href="Hi.Geom.DVec3d.html">DVec3d</a></dt>
<dd></dd>
<dt><code>mcXyzabc1</code> <a class="xref" href="Hi.Geom.DVec3d.html">DVec3d</a></dt>
<dd></dd>
<dt><code>coordinateConverter</code> <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html">IMachineKinematics</a></dt>
<dd></dd>
<dt><code>compensationHeight</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd></dd>
</dl>
<a id="Hi_Numerical_Acts_ActUtil_ToStepNum_" data-uid="Hi.Numerical.Acts.ActUtil.ToStepNum*"></a>
<h3 id="Hi_Numerical_Acts_ActUtil_ToStepNum_System_Double_" data-uid="Hi.Numerical.Acts.ActUtil.ToStepNum(System.Double)">
ToStepNum(double)
</h3>
<div class="markdown level1 summary"><p>Converts a real-valued step quotient (<code>total / unitPerStep</code>)
into a bounded step count: NaN or non-positive → 0; otherwise the
ceiling, clamped to <a class="xref" href="Hi.Numerical.Acts.ActUtil.html#Hi_Numerical_Acts_ActUtil_MaxStepNumPerAct">MaxStepNumPerAct</a>. Every act's
step-number derivation goes through here so no division can turn
into a saturated integer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static int ToStepNum(double stepQuotient)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>stepQuotient</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd></dd>
</dl>
<a id="Hi_Numerical_Acts_ActUtil_UpdateStepNumByCl_" data-uid="Hi.Numerical.Acts.ActUtil.UpdateStepNumByCl*"></a>
<h3 id="Hi_Numerical_Acts_ActUtil_UpdateStepNumByCl_Hi_Geom_DVec3d_Hi_Geom_DVec3d_Hi_Numerical_Xyzabc_IMachineKinematics_System_Double_System_Double_System_Int32__" data-uid="Hi.Numerical.Acts.ActUtil.UpdateStepNumByCl(Hi.Geom.DVec3d,Hi.Geom.DVec3d,Hi.Numerical.Xyzabc.IMachineKinematics,System.Double,System.Double,System.Int32@)">