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
@@ -0,0 +1,181 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Machine Chain Code | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Machine Chain Code | HiAPI-C# 2025 ">
<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="">
<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="Technique-ChainCode">
<h1 id="machine-chain-code">Machine Chain Code</h1>
<p>A machine tool file can carry its kinematic topology as a <strong>chain code</strong> — a short bracket notation
for the same connectivity the mechanism builder produces, meant for hand-editing the XML. It is read
and written by <a class="xref" href="../../api/Hi.Numerical.Xyzabc.CodeXyzabcChain.html">CodeXyzabcChain</a><small>(API)</small>, which builds the very
same mechanism, so a hand-written code and a builder-drawn structure are interchangeable — with two
exceptions on the way back: a mechanism with two components sharing one name, or with an unnamed
component that more than one segment would have to mention, cannot be written down as code.</p>
<p>The code carries <strong>connectivity only</strong>. Pivots, exact axis vectors, end-anchor offsets and shapes
are properties of the mechanism, and editing the code preserves them for every component whose name
is unchanged.</p>
<h2 id="the-notation">The Notation</h2>
<p>Each segment declares branches from left to right:</p>
<pre><code>[O][base][Z][C][w];[O][base][Y][X][B][S][t]
</code></pre>
<ul>
<li><p><code>[A][B][C]</code> is shorthand for the branches <code>[A][B];[B][C]</code>, so a segment is just a path.</p>
</li>
<li><p>Words are components. The <strong>same word in different segments is the same component</strong>, which is how
segments join into one structure.</p>
</li>
<li><p>The first word of the whole code names the ground anchor. Within a segment each branch runs from
the word on its left to the word on its right.</p>
</li>
<li><p>Reserved words are the topology keywords: <code>X</code>, <code>Y</code>, <code>Z</code>, <code>A</code>, <code>B</code>, <code>C</code> become motion axes, and <code>w</code>
and <code>t</code> become the end anchors. <strong>Any other word is a plain component</strong> carried along without
motion, such as <code>base</code> or <code>S</code> above. A code must name exactly one <code>[w]</code> and one <code>[t]</code>; the six
axes are optional, and each may be used at most once. That uniqueness check reads the words
without regard to letter case, so it refuses a code naming no table buckle at all — <em>the chain
code must contain the table buckle [w]</em> — and a code letting two components claim one role —
<em>more than one component claims the table buckle: [w], [W]</em>. A lone <code>[W]</code> satisfies it, one
component claiming the role, and builds a component named <code>W</code>; that code is refused further
along, by the exact-match end-anchor check below.</p>
</li>
<li><p><strong>Spell the keywords exactly</strong> — upper case for the axes, lower case for <code>t</code> and <code>w</code>. Everything
downstream of the code compares them as written: axis discovery, the default collision pairs, and
the end-anchor check a machine file is loaded through. So a mis-cased axis contributes no motion,
and a mis-cased end anchor stops the file loading, with a message naming the near miss.</p>
</li>
<li><p><code>[]</code> is an anonymous component. Each occurrence is a separate one, it cannot be referred to from
another segment, and it cannot hold a geometric shape — shapes are stored by component name.</p>
</li>
<li><p>Declaring the same branch twice is harmless; it states the same connection.</p>
</li>
<li><p>A segment with a single word just declares a component, which is how a ground anchor that only
receives branches gets named.</p>
</li>
<li><p>Any number of segments is allowed, so auxiliary structures can branch off any component:</p>
<pre><code>[O][base][Z][C][w];[O][base][Y][X][B][S][t];[base][loader][gripper]
</code></pre>
</li>
</ul>
<h2 id="direction-and-convergence">Direction and Convergence</h2>
<p><strong>Branch direction is free.</strong> A branch authored towards the ground anchor is simply written that way,
as in <code>[Z][O]</code>. A branch belongs to the component farther from the ground anchor, so <code>[O][Y]</code> and
<code>[Y][O]</code> both make <code>Y</code> the axis; only the direction differs. Pointing every branch away from the
ground anchor remains a readability convention — it makes the structure read outwards, ground → base
→ motion axes → the <code>t</code> and <code>w</code> end anchors — but the motion, the axis keywords and the default
collision pairs all read a branch the same way round regardless.</p>
<p><strong>Limbs may meet again.</strong> <code>[A][B][D];[A][C][D]</code> gives <code>D</code> two incoming branches. Only one route
through such a loop drives the motion, so use it for structure rather than for a second motion path.</p>
<p>Axis directions follow the machine-building convention: axes between the ground anchor and <code>w</code> are
seeded negative, the others positive.</p>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="topology.html">Kinematic Topology</a> — the anchors, branches and assemblies this notation encodes</li>
<li><a href="../../manual/setup/machine-tool.html">Machine Tool</a> — building the same structure in the mechanism builder, and the keywords both forms share</li>
</ul>
</article>
<div class="contribution d-print-none">
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></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>