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.Syntaxs.TransformationUtil.html
T

857 lines
36 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class TransformationUtil | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class TransformationUtil | HiAPI-C# 2025 ">
<meta name="description" content="Utilities for the chain. Each entry is {Source, Kind, Mat4d}; entries are composed in order with pure matrix multiplication (). partitions the entries by contour validity: — the matrix is valid across the whole block, applicable to any interpolated point along the contour. — the matrix is a block-endpoint snapshot of a rotary-state-dependent transform (RTCP rotary-dynamic). Composing it produces a correct endpoint MC, but interpolated points along the contour must be derived per-step by motion semantics (); do not apply it to interpolated ProgramXyz. Both kinds carry a real Mat4d so composition stays a pure matrix product — no entry has a missing matrix. Use to detect the dynamic-rotary state without consulting a sibling section flag.">
<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.Syntaxs.TransformationUtil">
<h1 id="Hi_NcParsers_Syntaxs_TransformationUtil" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil" class="text-break">
Class TransformationUtil
</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.Syntaxs.html">Syntaxs</a></dd></dl>
<dl><dt>Assembly</dt><dd>HiMech.dll</dd></dl>
</div>
<div class="markdown summary"><p>Utilities for the <a class="xref" href="Hi.NcParsers.Keywords.ITransformationDef.html#Hi_NcParsers_Keywords_ITransformationDef_ProgramToMcTransform">ProgramToMcTransform</a> chain.
Each entry is <code>{Source, Kind, Mat4d}</code>; entries are composed in order
with pure matrix multiplication (<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransform_System_Text_Json_Nodes_JsonObject_">GetComposedTransform(JsonObject)</a>).</p>
<p>
<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindKey">KindKey</a> partitions the entries by contour validity:
<ul><li><a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindStatic">KindStatic</a> — the matrix is valid across the whole
block, applicable to any interpolated point along the contour.</li><li><a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindDynamic">KindDynamic</a> — the matrix is a block-endpoint snapshot
of a rotary-state-dependent transform (RTCP rotary-dynamic). Composing it
produces a correct endpoint MC, but interpolated points along the contour
must be derived per-step by motion semantics
(<a class="xref" href="Hi.NcParsers.Semantics.ClLinearMcMotionSemantic.html">ClLinearMcMotionSemantic</a>); do not apply it to
interpolated ProgramXyz.</li></ul>
Both kinds carry a real Mat4d so composition stays a pure matrix product —
no entry has a missing matrix. Use <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_HasDynamicEntry_System_Text_Json_Nodes_JsonObject_">HasDynamicEntry(JsonObject)</a> to detect
the dynamic-rotary state without consulting a sibling section flag.
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class TransformationUtil</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">TransformationUtil</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_Syntaxs_TransformationUtil_KindDynamic" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.KindDynamic">
KindDynamic
</h3>
<div class="markdown level1 summary"><p>The entry's Mat4d is a block-endpoint snapshot only; intermediate
contour points must be resolved by per-step IK in motion semantics.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string KindDynamic = &quot;Dynamic&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>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_KindKey" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.KindKey">
KindKey
</h3>
<div class="markdown level1 summary"><p>JSON key for the entry's contour-validity classification.
Value must be <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindStatic">KindStatic</a> or <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindDynamic">KindDynamic</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string KindKey = &quot;Kind&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>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_KindStatic" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.KindStatic">
KindStatic
</h3>
<div class="markdown level1 summary"><p>The entry's Mat4d is valid for any point along the contour.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string KindStatic = &quot;Static&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>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_Mat4dKey" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.Mat4dKey">
Mat4dKey
</h3>
<div class="markdown level1 summary"><p>JSON key for the <a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a> snapshot inside each chain entry.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string Mat4dKey = &quot;Mat4d&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>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_PivotTransformSource" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.PivotTransformSource">
PivotTransformSource
</h3>
<div class="markdown level1 summary"><p>Canonical source name for the RTCP pivot transform — the
kinematic transform from Pn (post-G54, post-G68.2) to MC at the
block's endpoint ABC. Contributed by
<a class="xref" href="Hi.NcParsers.LogicSyntaxs.PivotTransformationSyntax.html">PivotTransformationSyntax</a>. Must be the
<b>last</b> entry written into the chain so that all Pn-frame
operations (tilt, tool-height, coord-offset) are accumulated before
the final kinematic IK; this ordering is enforced by the syntax-
chain registration order, not by the writer API.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string PivotTransformSource = &quot;PivotTransform&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>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_SourceKey" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.SourceKey">
SourceKey
</h3>
<div class="markdown level1 summary"><p>JSON key for the transform origin label inside each chain entry.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string SourceKey = &quot;Source&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>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_ToolHeightCompensationSource" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.ToolHeightCompensationSource">
ToolHeightCompensationSource
</h3>
<div class="markdown level1 summary"><p>Canonical source name for the tool-height-compensation entry
(tool-normal · offset_mm along the current tool axis). Matches the
<code>ToolHeightCompensation</code> section key read for
<a class="xref" href="Hi.NcParsers.Keywords.IToolHeightCompensationDef.html#Hi_NcParsers_Keywords_IToolHeightCompensationDef_Offset_mm">Offset_mm</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string ToolHeightCompensationSource = &quot;ToolHeightCompensation&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_Syntaxs_TransformationUtil_AddOrReplaceTransform_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.AddOrReplaceTransform*"></a>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_AddOrReplaceTransform_System_Text_Json_Nodes_JsonObject_System_String_System_String_Hi_Geom_Mat4d_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.AddOrReplaceTransform(System.Text.Json.Nodes.JsonObject,System.String,System.String,Hi.Geom.Mat4d)">
AddOrReplaceTransform(JsonObject, string, string, Mat4d)
</h3>
<div class="markdown level1 summary"><p>Adds or replaces a named transformation entry in the chain.
If an entry with the same source already exists, it is replaced in-place.
Otherwise the new entry is appended.
<code class="paramref">kind</code> must be <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindStatic">KindStatic</a> or <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindDynamic">KindDynamic</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void AddOrReplaceTransform(JsonObject json, string source, string kind, Mat4d mat)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>json</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonobject">JsonObject</a></dt>
<dd></dd>
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>kind</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>mat</code> <a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a></dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransform_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.GetComposedTransform*"></a>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransform_System_Text_Json_Nodes_JsonObject_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.GetComposedTransform(System.Text.Json.Nodes.JsonObject)">
GetComposedTransform(JsonObject)
</h3>
<div class="markdown level1 summary"><p>Composes all entries in the chain into a single block-endpoint Mat4d
(left-to-right multiplication). Pure multiplication — no special
cases, no kinematic lookup. The returned matrix is valid <b>only</b>
for the block's endpoint state; see
<a class="xref" href="Hi.NcParsers.Keywords.ITransformationDef.html#Hi_NcParsers_Keywords_ITransformationDef_ProgramToMcTransform">ProgramToMcTransform</a> for
the endpoint-semantic contract.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Mat4d GetComposedTransform(JsonObject json)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>json</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonobject">JsonObject</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a></dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransformAtAbc_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.GetComposedTransformAtAbc*"></a>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransformAtAbc_System_Text_Json_Nodes_JsonObject_Hi_Geom_Vec3d_Hi_Geom_Vec3d_Hi_Numerical_Xyzabc_IMachineKinematics_System_Double_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.GetComposedTransformAtAbc(System.Text.Json.Nodes.JsonObject,Hi.Geom.Vec3d,Hi.Geom.Vec3d,Hi.Numerical.Xyzabc.IMachineKinematics,System.Double)">
GetComposedTransformAtAbc(JsonObject, Vec3d, Vec3d, IMachineKinematics, double)
</h3>
<div class="markdown level1 summary"><p>Composes the chain into the Mat4d valid at an INTERPOLATED contour
point whose rotary state is <code class="paramref">stepAbc_rad</code>, by
rebuilding every <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindDynamic">KindDynamic</a> entry at that rotary state
while keeping every <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindStatic">KindStatic</a> entry's stored snapshot.
The per-step dual of <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransform_System_Text_Json_Nodes_JsonObject_">GetComposedTransform(JsonObject)</a>, which is
endpoint-only when the chain carries a Dynamic entry.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Mat4d GetComposedTransformAtAbc(JsonObject json, Vec3d stepAbc_rad, Vec3d endpointAbc_rad, IMachineKinematics kinematics, double toolHeightOffset_mm)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>json</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonobject">JsonObject</a></dt>
<dd><p>The block's JSON sections carrying the chain.</p>
</dd>
<dt><code>stepAbc_rad</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>The interpolated point's MC rotary state in
radians (NaN axes are treated as 0, mirroring
<a class="xref" href="Hi.NcParsers.LogicSyntaxs.PivotTransformUtil.html#Hi_NcParsers_LogicSyntaxs_PivotTransformUtil_ResolveEndpointAbc_Hi_Common_Collections_LazyLinkedListNode_Hi_NcParsers_Syntaxs_SyntaxPiece__Hi_NcParsers_Dependencys_IMachineAxisConfig_">ResolveEndpointAbc(LazyLinkedListNode&lt;SyntaxPiece&gt;, IMachineAxisConfig)</a>).</p>
</dd>
<dt><code>endpointAbc_rad</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd><p>The block-endpoint MC rotary state in
radians — the state the stored Dynamic snapshots were built at.</p>
</dd>
<dt><code>kinematics</code> <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html">IMachineKinematics</a></dt>
<dd><p>The machine kinematics; null keeps every
stored snapshot.</p>
</dd>
<dt><code>toolHeightOffset_mm</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd><p>The block's
<a class="xref" href="Hi.NcParsers.Keywords.ToolHeightCompensation.html">ToolHeightCompensation</a> offset in mm (the value its
Dynamic height entry was built with).</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a></dt>
<dd></dd>
</dl>
<h4 class="section" id="Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransformAtAbc_System_Text_Json_Nodes_JsonObject_Hi_Geom_Vec3d_Hi_Geom_Vec3d_Hi_Numerical_Xyzabc_IMachineKinematics_System_Double__remarks">Remarks</h4>
<div class="markdown level1 remarks"><p>Rebuild rules, per Dynamic entry source:</p>
<ul><li><a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_ToolHeightCompensationSource">ToolHeightCompensationSource</a> — rebuilt with
<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_MakeToolHeightMat_Hi_Numerical_Xyzabc_IMachineKinematics_Hi_Geom_Vec3d_System_Double_">MakeToolHeightMat(IMachineKinematics, Vec3d, double)</a> at <code class="paramref">stepAbc_rad</code>
and <code class="paramref">toolHeightOffset_mm</code>: the same construction
every writer uses (<a class="xref" href="Hi.NcParsers.LogicSyntaxs.G43p4RtcpSyntax.html">G43p4RtcpSyntax</a>,
<a class="xref" href="Hi.NcParsers.LogicSyntaxs.Siemens.SiemensTraoriSyntax.html">SiemensTraoriSyntax</a>), so at
<code class="paramref">stepAbc_rad</code> equal to the block-endpoint ABC the
rebuilt matrix is bit-identical to the stored snapshot.</li><li><a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_PivotTransformSource">PivotTransformSource</a> — rebuilt
anchor-agnostically as
<code>stored · K(endpointAbc) · K(stepAbc)⁻¹</code>, recovering the
writer's pre-pivot anchor (<code>preFrameToPn = stored · K(endpointAbc)</code>,
see <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_MakePivotTransformMat_Hi_Numerical_Xyzabc_IMachineKinematics_Hi_Geom_Vec3d_Hi_Geom_Mat4d_">MakePivotTransformMat(IMachineKinematics, Vec3d, Mat4d)</a>)
from the snapshot itself instead of assuming the NC pipeline's
machine-zero anchor — the CLSF pivot
(<a class="xref" href="Hi.Numerical.ClsfParsers.ClToMcTransformSyntax.html">ClToMcTransformSyntax</a>) folds a
fixture-topology anchor into the same entry and stays correct here.</li><li>Any other Dynamic source — kept as stored (no rebuild recipe;
no shipped writer produces one).</li></ul>
With a <code>null</code> <code class="paramref">kinematics</code> every entry keeps its
stored snapshot, collapsing to <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransform_System_Text_Json_Nodes_JsonObject_">GetComposedTransform(JsonObject)</a> —
correct for the only kinematics-less Dynamic corner (the
<a class="xref" href="Hi.NcParsers.LogicSyntaxs.G43p4RtcpSyntax.html">G43p4RtcpSyntax</a> UnitZ height fallback,
whose matrix does not depend on ABC).
</div>
<a id="Hi_NcParsers_Syntaxs_TransformationUtil_GetTransformBySource_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.GetTransformBySource*"></a>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_GetTransformBySource_System_Text_Json_Nodes_JsonObject_System_String_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.GetTransformBySource(System.Text.Json.Nodes.JsonObject,System.String)">
GetTransformBySource(JsonObject, string)
</h3>
<div class="markdown level1 summary"><p>Gets a specific entry's Mat4d by source name. Returns identity if not found.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Mat4d GetTransformBySource(JsonObject json, string source)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>json</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonobject">JsonObject</a></dt>
<dd></dd>
<dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a></dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_Syntaxs_TransformationUtil_HasDynamicEntry_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.HasDynamicEntry*"></a>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_HasDynamicEntry_System_Text_Json_Nodes_JsonObject_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.HasDynamicEntry(System.Text.Json.Nodes.JsonObject)">
HasDynamicEntry(JsonObject)
</h3>
<div class="markdown level1 summary"><p>Returns <code>true</code> if any entry in the chain carries
<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindDynamic">KindDynamic</a>. Used by motion-form selection
(<a class="xref" href="Hi.NcParsers.LogicSyntaxs.LinearMotionSyntax.html">LinearMotionSyntax</a>) and ProgramXyz
strategy dispatch (<a class="xref" href="Hi.NcParsers.LogicSyntaxs.ProgramXyzUtil.html">ProgramXyzUtil</a>) to
detect RTCP-rotary-dynamic state without consulting a flag on a
sibling section. Throws if any entry lacks <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindKey">KindKey</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool HasDynamicEntry(JsonObject json)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>json</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonobject">JsonObject</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.boolean">bool</a></dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_Syntaxs_TransformationUtil_MakePivotTransformMat_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.MakePivotTransformMat*"></a>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_MakePivotTransformMat_Hi_Numerical_Xyzabc_IMachineKinematics_Hi_Geom_Vec3d_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.MakePivotTransformMat(Hi.Numerical.Xyzabc.IMachineKinematics,Hi.Geom.Vec3d)">
MakePivotTransformMat(IMachineKinematics, Vec3d)
</h3>
<div class="markdown level1 summary"><p>Builds the <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_PivotTransformSource">PivotTransformSource</a> Mat4d — an
empirically-constructed Pn→MC rigid-affine transform at the block's
endpoint ABC. Equivalent to
<code>kinematics.PnToMc(pn_input, normal).Point</code> when applied to
a Pn-frame point, but expressed as a reusable Mat4d so the chain
stays a pure matrix product (no per-point IK call inside
<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransform_System_Text_Json_Nodes_JsonObject_">GetComposedTransform(JsonObject)</a>).</p>
<p>
The pre-pivot anchor is the machine-zero attacher point
<code>McToPn(0).Point</code> as a <b>pure translation</b> — the same
origin anchor HardNc keeps in
<code>HardNcEnv.AttacherAtMcZeroOnTableCoordinate</code>. Program-frame
vectors already point along the Pn (table-buckle) axes, so only
<code>K(0)</code>'s translation may enter the anchor. Folding the full
<code>K(0)</code> (its linear part encodes per-axis motion sense — a
workpiece-side linear axis contributes a <b>negated</b> row)
would flip those axes' program components before the IK; on a
machine whose Z rides the table (e.g. the B-x7000 WAC chain,
table branch <code>Base→Z→B→W</code>) that mirrored every program Z
and, at B≈180°, threw the resolved MC off by twice the
pivot-to-attacher distance (~3.5 m).
</p>
<p>
Requiring machine files to be modelled the other way instead —
workpiece-side axes negative, which makes <code>K(0)</code>'s linear part
the identity and the two constructions equivalent — was evaluated as
an alternative to this fix and deliberately rejected.
<a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html">IMachineKinematics</a> resolves either axis direction, so a
file that positions correctly through
<a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html#Hi_Numerical_Xyzabc_IMachineKinematics_PnToMc_Hi_Geom_DVec3d_Hi_Geom_DVec3d__">PnToMc(DVec3d, out DVec3d)</a> has to position correctly
through this transform as well; a precondition enforced here and
nowhere else would only make one consumer diverge from the kinematics
on files every other consumer accepts. The modelling convention
governs how MC values read against the machine panel, and belongs to
a check on the data when it loads — never to this matrix.
</p>
<p>
Constructed by probing <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html#Hi_Numerical_Xyzabc_IMachineKinematics_McToPn_Hi_Geom_DVec3d_">McToPn(DVec3d)</a> at
the four standard basis points (origin + XYZ unit vectors) at the
target ABC to derive <code>K(abc)</code>; returns
<code>T(McToPn(0).Point) · K(abc).GetInverse()</code>. Topology-
agnostic — works for any affine kinematic chain regardless of axis
order. Legacy <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html#Hi_Numerical_Xyzabc_IMachineKinematics_PnToMc_Hi_Geom_DVec3d_Hi_Geom_DVec3d__">PnToMc(DVec3d, out DVec3d)</a> remains the
reference oracle.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Mat4d MakePivotTransformMat(IMachineKinematics kinematics, Vec3d abc_rad)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>kinematics</code> <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html">IMachineKinematics</a></dt>
<dd></dd>
<dt><code>abc_rad</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a></dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_Syntaxs_TransformationUtil_MakePivotTransformMat_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.MakePivotTransformMat*"></a>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_MakePivotTransformMat_Hi_Numerical_Xyzabc_IMachineKinematics_Hi_Geom_Vec3d_Hi_Geom_Mat4d_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.MakePivotTransformMat(Hi.Numerical.Xyzabc.IMachineKinematics,Hi.Geom.Vec3d,Hi.Geom.Mat4d)">
MakePivotTransformMat(IMachineKinematics, Vec3d, Mat4d)
</h3>
<div class="markdown level1 summary"><p>Variant anchored to an arbitrary pre-pivot frame: builds the
<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_PivotTransformSource">PivotTransformSource</a> Mat4d
<code>preFrameToPn · K(abc)⁻¹</code> that maps a point of the chain's
accumulated pre-pivot frame directly to MC at the block's endpoint
ABC. The two-parameter overload is this variant specialised to the
NC pipeline's machine-zero program frame
(<code>preFrameToPn = T(McToPn(0).Point)</code>, translation only — see
its remarks for why <code>K(0)</code>'s linear part must stay out); the
CLSF pipeline passes its workpiece→Pn fixture-topology matrix
instead, so the pivot entry absorbs the workpiece placement
together with the kinematics.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Mat4d MakePivotTransformMat(IMachineKinematics kinematics, Vec3d abc_rad, Mat4d preFrameToPn)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>kinematics</code> <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html">IMachineKinematics</a></dt>
<dd></dd>
<dt><code>abc_rad</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd></dd>
<dt><code>preFrameToPn</code> <a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Mat4d.html">Mat4d</a></dt>
<dd></dd>
</dl>
<a id="Hi_NcParsers_Syntaxs_TransformationUtil_MakeToolHeightMat_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.MakeToolHeightMat*"></a>
<h3 id="Hi_NcParsers_Syntaxs_TransformationUtil_MakeToolHeightMat_Hi_Numerical_Xyzabc_IMachineKinematics_Hi_Geom_Vec3d_System_Double_" data-uid="Hi.NcParsers.Syntaxs.TransformationUtil.MakeToolHeightMat(Hi.Numerical.Xyzabc.IMachineKinematics,Hi.Geom.Vec3d,System.Double)">
MakeToolHeightMat(IMachineKinematics, Vec3d, double)
</h3>
<div class="markdown level1 summary"><p>Builds the tool-height-compensation Mat4d for a given rotary state:
translate by (tool-normal at <code class="paramref">abc_rad</code>) · <code class="paramref">height_mm</code>.
Pure translation (no rotation component); combines with the
downstream <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_PivotTransformSource">PivotTransformSource</a> to form the full
Pn→MC IK.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Mat4d MakeToolHeightMat(IMachineKinematics kinematics, Vec3d abc_rad, double height_mm)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>kinematics</code> <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html">IMachineKinematics</a></dt>
<dd></dd>
<dt><code>abc_rad</code> <a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd></dd>
<dt><code>height_mm</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="Hi.Geom.Mat4d.html">Mat4d</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>