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,323 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Fixture | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Fixture | 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="Anatomy-Fixture">
<h1 id="fixture">Fixture</h1>
<p>The fixture is what holds the workpiece on the machine table: one geometry, and the two anchor
transformers that place that geometry against the workpiece and against the table. It has two
surfaces:</p>
<ul>
<li>the <code>equipment/fixture</code> branch of the General Setup page's Control Tree
(<code>/general-setup?tree=equipment/fixture</code>), an equipment child of the General Setup group between
Coolant and Workpiece. <code>/fixture</code> and anything below it redirects there;</li>
<li>in the WPF client, a sub-window opened from the <a class="xref" href="../shell/main-panel.html">Main Panel</a>.</li>
</ul>
<p>Both edit the one fixture the project owns.</p>
<ul>
<li>Key Model:
<ul>
<li><a class="xref" href="../../api/Hi.NcMech.Fixtures.Fixture.html">Fixture</a>
On the web it is addressed by an IndexService key handed to the
<a class="xref" href="../widget/object-management-menu-button.html">Object Management Menu Button</a> and installed back onto
the project through the controller's UpdateFixture. On the WPF client the same button is wired
with a TargetObjectGetter / TargetObjectSetter pair (see that page for the design pattern).</li>
</ul>
</li>
<li>Assistant Model:
<ul>
<li><a class="xref" href="../../api/Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a> — owns the fixture as
<a class="xref" href="../../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_Fixture">Fixture</a>.</li>
</ul>
</li>
</ul>
<p>The displayee differs by client. The web branch has no fixture-only canvas: it shares the General
Setup canvas, whose displayee is the equipment-setup displayee (<code>Disp/EquipmentSetupDisplayee.cs</code>) —
the merged fixture + workpiece scene with the anchor, buckle and controller-coordinate overlays. Its
option set is the equipment-setup config (<code>Disp/EquipmentSetupDisplayeeConfig.cs</code>), carried on
<code>UserService.UserConfig</code> as its <code>EquipmentSetupDisplayeeConfig</code> property. The WPF sub-window has a
canvas of its own, whose displayee is <a class="xref" href="../../api/Hi.NcMech.Fixtures.FixtureEditorDisplayee.html">FixtureEditorDisplayee</a> configured by
<a class="xref" href="../../api/Hi.NcMech.Fixtures.FixtureEditorDisplayeeConfig.html">FixtureEditorDisplayeeConfig</a>, taken from <code>UserService.UserConfig</code> as its
<code>FixtureSetupDisplayeeConfig</code> property.</p>
<h2 id="layout">Layout</h2>
<h3 id="control-tree-branch">Control Tree Branch</h3>
<p>The root panel is rendered inline by the dock's primary editor pane, so it has no title label of its
own — the wrapping expansion header carries the selection breadcrumb. Every item below is a tree
node whose editor is swapped into that same PRIMARY row.</p>
<ul>
<li>Fixture Root Panel — <code>equipment/fixture</code>, item type <code>FixtureRoot</code>
<ul>
<li><a class="xref" href="../widget/object-management-menu-button.html">Object Management Menu Button</a> — file extension
<code>.Fixture</code>, load type <code>Hi.NcMech.Fixtures.Fixture, HiMech</code>, rel file <code>Fixture.xml</code>, based at the
project directory. Load / Save As / Copy / Paste / XML.</li>
<li>Geometry Type Badge — the attached geometry's kind name, <code>none</code> when the slot is empty.</li>
<li>Intro caption, and an empty-state caption while no fixture key is minted.</li>
</ul>
</li>
<li><code>equipment/fixture/geometry</code> — &ldquo;Geometry&rdquo;, a Geometry slot backing
<a class="xref" href="../../api/Hi.NcMech.Fixtures.Fixture.html#Hi_NcMech_Fixtures_Fixture_Geom">Geom</a>. The slot's own panel is the kind picker
(<a class="xref" href="../geom/geom-manage-control.html">Geometry Management Control</a>, selector only); the picked kind's
editor is the slot's child item. Kinds offered: <code>Box3d</code>, <code>Cylindroid</code>, <code>StlFile</code>,
<code>TransformationGeom</code>, <code>GeomCombination</code>, plus None. The geometry must satisfy <code>IStlSource</code>, so the
runtime-only voxel <code>CubeTreeFile</code> is not among them.</li>
<li><code>equipment/fixture/anchor</code> — &ldquo;Anchor&rdquo;, a Group stem whose info text states how the fixture is
placed. Two Transformer slots hang from it, each a kind picker
(<a class="xref" href="../geom/transformer-panel.html">Transformer Manage Panel</a>) over the picked kind's child editor:
<ul>
<li><code>equipment/fixture/geom-to-workpiece</code> — &ldquo;Geom To Workpiece&rdquo;,
<a class="xref" href="../../api/Hi.NcMech.Fixtures.Fixture.html#Hi_NcMech_Fixtures_Fixture_GeomToWorkpieceTransformer">GeomToWorkpieceTransformer</a>, which places the workpiece buckle
— where the workpiece attaches — relative to the fixture geometry (see
<a class="xref" href="workpiece.html">Workpiece</a>).</li>
<li><code>equipment/fixture/geom-to-table</code> — &ldquo;Geom To Table&rdquo;,
<a class="xref" href="../../api/Hi.NcMech.Fixtures.Fixture.html#Hi_NcMech_Fixtures_Fixture_GeomToTableTransformer">GeomToTableTransformer</a>, which pins the fixture geometry onto
the machine table buckle.</li>
<li>Kinds offered on both: <code>StaticTranslation</code>, <code>StaticRotation</code>, <code>StaticFreeform</code>,
<code>DynamicTranslation</code>, <code>DynamicRotation</code>, <code>GeneralTransform</code>, <code>NoTransform</code>.</li>
</ul>
</li>
<li>Shared slave view: the General Setup equipment canvas in the page's MAIN column, shared with
Machine Tool, Workpiece and Controller (see <a class="xref" href="index.html">General Setup Page</a>). Its
Display Options dropdown carries this branch's share of the scene — the <strong>Fixture</strong>
Solid / Edge / Hide radio group, and the Fixture Geom Anchor, Workpiece Buckle and Table Buckle
flags in the Anchors group.</li>
</ul>
<h3 id="wpf-page">WPF Page</h3>
<ul>
<li>Head Line
<ul>
<li><a class="xref" href="../widget/object-management-menu-button.html">Object Management Menu Button</a> — file extension
<code>.Fixture</code>, load type <a class="xref" href="../../api/Hi.NcMech.Fixtures.Fixture.html">Fixture</a>, rel file <code>Fixture.xml</code>. The pointed
Editor Panel is the Management Tabs Panel, a ContentPresenter the button swaps between the tab
stack and XML mode.</li>
<li>Title Label</li>
</ul>
</li>
<li>Management Tabs Panel — the same content the tree renders as nodes, stacked as tabs:
<ul>
<li>Geometry Tab — <a class="xref" href="../geom/geom-manage-control.html">Geometry Management Control</a> over
<a class="xref" href="../../api/Hi.NcMech.Fixtures.Fixture.html#Hi_NcMech_Fixtures_Fixture_Geom">Geom</a>.</li>
<li>Anchor Tab — a nested tab stack, each tab a
<a class="xref" href="../geom/transformer-panel.html">Transformer Manage Panel</a>:
<ul>
<li>Geom To Workpiece Tab</li>
<li>Geom To Table Tab</li>
</ul>
</li>
</ul>
</li>
<li>Viewer Panel
<ul>
<li>Viewer ToolBar
<ul>
<li><a class="xref" href="../widget/renderingcanvas-tool-bar.html">RenderingCanvas Tool Bar</a></li>
<li>Display Options menu — the Show Geom Anchor, Show Workpiece Buckle and Show Table Buckle
checkboxes and the Solid / Edge / Hide rendering-mode radio group, all writing
<a class="xref" href="../../api/Hi.NcMech.Fixtures.FixtureEditorDisplayeeConfig.html">FixtureEditorDisplayeeConfig</a>.</li>
</ul>
</li>
<li>RenderingCanvas — its <a class="xref" href="../../api/Hi.Disp.DispEngine.html">DispEngine</a>.<a class="xref" href="../../api/Hi.Disp.DispEngine.html#Hi_Disp_DispEngine_Displayee">Displayee</a> is
<a class="xref" href="../../api/Hi.NcMech.Fixtures.FixtureEditorDisplayee.html">FixtureEditorDisplayee</a>.</li>
</ul>
</li>
</ul>
<p>Both clients put a draggable divider between the editor column and the canvas: a GridSplitter in the
WPF page, nested draggable splitters on the web page (dock / content column / canvas), plus the
dock's own height divider between the tree row and the editor row.</p>
<h2 id="behavior">Behavior</h2>
<ul>
<li><a class="xref" href="../../api/Hi.NcMech.Fixtures.Fixture.html#Hi_NcMech_Fixtures_Fixture_ClearGeomCache">ClearGeomCache()</a> runs after any change at or below the branch. On
the web each node's afterChange chain ends in the controller's ClearGeometryCache, which calls it;
in WPF the page calls it directly from the geometry control's setter and update callbacks.</li>
<li>The two anchor slots re-commit their swap-in <em>before</em> clearing the cache: an inner-value edit
re-posts UpdateGeomToWorkpieceTransformer / UpdateGeomToTableTransformer, so the object the
switchboard produced is always the one installed on the owning field when the redraw happens.</li>
<li>Load / Paste / XML-Apply only swap the IndexService entry. The tree root then installs the result
onto the project through UpdateFixture — the equipment setter re-attaches the buckles itself —
re-runs Initialize to re-mint the branch's keys, and clears the geometry cache. The button's XML
dialog re-emits its object-loaded event on Apply, so that install and refresh chain runs exactly
once.</li>
<li>Kind pickers are parent-aware. Picking a geometry kind calls CreateGeometry, which installs the
new object on <a class="xref" href="../../api/Hi.NcMech.Fixtures.Fixture.html#Hi_NcMech_Fixtures_Fixture_Geom">Geom</a> server-side and maps the literal <code>None</code> to
null; picking a transformer kind creates the object and then rebinds the owning field.</li>
<li>View snapping differs by client. The WPF page snaps its canvas to the isometric view when the
displayee is bound, and again whenever a new geometry object is set, on the assumption that a
shape swap changes the scene more than an edit within one shape does. The shared web canvas snaps
once, when its displayee is bound — the display controller's initialize does it server-side.
Afterwards a geometry set only clears the cache, and the operator re-frames from the
<a class="xref" href="../widget/renderingcanvas-tool-bar.html">RenderingCanvas Tool Bar</a>'s view picker.</li>
<li>Both canvases draw the live model, so an edit shows on the next frame with no further calls.</li>
</ul>
<h2 id="source-code-path">Source Code Path</h2>
<p>See <a class="xref" href="../index.html">HiNC App Anatomy</a> for git repository links.</p>
<h3 id="web-application">Web Application</h3>
<p>HiNC-2025-webservice (Quasar CLI SPA):</p>
<ul>
<li><code>wwwroot-src/src/components/controlTree/useControlTreeHost.ts</code> — builds the <code>equipment/fixture</code>
root (item type <code>FixtureRoot</code>, keyed on the IndexService fixture key) with its <code>geometry</code> slot and
the <code>anchor</code> Group holding <code>geom-to-workpiece</code> and <code>geom-to-table</code>; owns the clear-cache and
transformer-rebind afterChange chains, the create hooks and the Object Management install
handlers.</li>
<li><code>wwwroot-src/src/components/controlTree/PrimarySlavePanel.vue</code> — renders the root editor inline:
the Object Management button, the geometry-type badge and the intro / empty-state captions.</li>
<li><code>wwwroot-src/src/components/controlTree/itemTypes.ts</code> — the ItemType registry that binds the
branch's Geometry and Transformer slots and every concrete kind to their panels, and grows the
sub-tree from the indexed object's type.</li>
<li><code>wwwroot-src/src/components/controlTree/GeometrySlotPanel.vue</code> — the Geometry node's kind picker.</li>
<li><code>wwwroot-src/src/components/controlTree/TransformerSlotPanel.vue</code> — the Geom To Workpiece and
Geom To Table nodes' kind picker.</li>
<li><code>wwwroot-src/src/components/controlTree/SoleEditorPanel.vue</code> — hosts the concrete kind's own
editor once a geometry or transformer kind is chosen.</li>
<li><code>wwwroot-src/src/components/controlTree/ControlTreeDock.vue</code> — the left dock: the Control Tree row
over the PRIMARY editor row, with a draggable height divider.</li>
<li><code>wwwroot-src/src/pages/GeneralSetupPage.vue</code> — the three-column host page (dock / content column /
canvas) that provides the equipment-scope control-tree host.</li>
<li><code>wwwroot-src/src/components/mech/EquipmentSetupPanel.vue</code> — the shared canvas column: the
RenderingCanvasToolBar, the Display Options dropdown and the RenderingCanvas.</li>
<li><code>wwwroot-src/src/components/widgets/ObjectManagementMenuButton.vue</code> — the reused
object-management dropdown, keyed entirely on its <code>modelKey</code> (see
<a class="xref" href="../widget/object-management-menu-button.html">Object Management Menu Button</a>).</li>
<li><code>wwwroot-src/src/components/geom/GeometryEditor.vue</code> — the generic geometry kind switchboard
reached from the Geometry slot panel, including its None (unset) entry.</li>
<li><code>wwwroot-src/src/components/topo/TransformerSelectPanel.vue</code> — the generic transformer kind
switchboard reached from the Transformer slot panels.</li>
<li><code>wwwroot-src/src/api/fixture.ts</code> — typed client for <code>/api/Fixture/*</code>: Initialize, UpdateFixture,
the three Get…Type reads, UpdateGeometry, the two Update…Transformer rebinds, CreateGeometry and
ClearGeometryCache.</li>
<li><code>wwwroot-src/src/api/equipmentSetup.ts</code> — typed client for the shared canvas: binds the
equipment-setup displayee onto the connection's engine and drives its display options.</li>
<li><code>wwwroot-src/src/router/routes.ts</code> — declares <code>general-setup</code> and the <code>fixture/:rest(.*)*</code>
redirect onto <code>?tree=equipment/fixture</code>.</li>
<li><code>Mech/FixtureController.cs</code> — REST surface at <code>/api/Fixture</code>: Initialize, UpdateFixture,
GetGeometryType, GetGeomToWorkpieceType, GetGeomToTableType, UpdateGeometry,
UpdateGeomToWorkpieceTransformer, UpdateGeomToTableTransformer, CreateGeometry,
IndexCurrentGeometry and ClearGeometryCache.</li>
<li><code>Mech/EquipmentSetupDisplayController.cs</code> — <code>/api/mech/equipment-setup-display</code>: binds and
configures the displayee per rendering connection and serves its whole option set — the three
rendering-mode endpoints (fixture, raw-geom, ideal-geom), show-machine, show-tool,
show-dimension-bar, show-fixture-geom-anchor, show-workpiece-buckle, show-table-buckle,
show-workpiece-geom-anchor, show-program-zero-anchor, show-meshed-geom,
show-controller-coordinate and controller-coordinate-id.</li>
<li><code>Disp/EquipmentSetupDisplayee.cs</code> — the displayee the General Setup canvas renders: the merged
fixture + workpiece scene with the anchor, buckle and controller-coordinate overlays.</li>
</ul>
<h3 id="hiapi-engine">HiAPI Engine</h3>
<ul>
<li><code>HiMech/NcMech/Fixtures/Fixture.cs</code> — the key model: the geometry, the table and workpiece
buckles, the geom anchor, the two anchor transformers and ClearGeomCache.</li>
<li><code>HiMech/NcMech/Fixtures/FixtureEditorDisplayee.cs</code> — the WPF fixture canvas's displayee.</li>
<li><code>HiMech/NcMech/Fixtures/FixtureEditorDisplayeeConfig.cs</code> — its option set: ShowGeomAnchor,
ShowWorkpieceBuckle, ShowTableBuckle and the rendering mode.</li>
</ul>
<h2 id="see-also">See Also</h2>
<ul>
<li><a class="xref" href="../util/mech-builder.html">Mechanism Builder Page</a> — reuses this page’s parent-aware transformer rebind pattern</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>