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,205 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Geometry Combination Control | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Geometry Combination Control | 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-GeomCombinationControl">
<h1 id="geometry-combination-control">Geometry Combination Control</h1>
<p>A <a class="xref" href="../../api/Hi.Geom.GeomCombination.html">GeomCombination</a> is several geometries treated as one, and it has <strong>two faces on the
web</strong>: an inline editor that renders every child's own editor at once, and a Control-Tree panel that
manages the list only and puts each child on its own node. The desktop client has the inline shape
alone. There is no selection model on any of them — every child carries its own remove button.</p>
<h2 id="layout">Layout</h2>
<h3 id="the-inline-editor">The inline editor</h3>
<ul>
<li><strong>Add bar</strong> — a child-kind picker beside an <strong>Add</strong> button, and a <strong>Clear all</strong> button.</li>
<li><strong>One card per child</strong>, each with a <code>#n</code> index badge, the child's type name, its own remove
button, and — in the card body — that child's full editor, rendered recursively. All children are
editable at once.</li>
</ul>
<h3 id="the-control-tree-panel">The Control-Tree panel</h3>
<p>Deliberately shallow: a list of read-only rows with Add, a per-row remove and Clear all, and a
standing hint that an <strong>Item</strong> child node is where a child is actually edited. No editor is embedded
here; each child is its own <code>Item</code> node — <code>.../item-{index}</code> — under this one.</p>
<h3 id="the-desktop-control">The desktop control</h3>
<p>A title, then an <strong>Add</strong> and a <strong>Clear All</strong> button over a scrolling list of bordered cards, each
holding that child's own geometry management panel and a remove button — no index badge and no type
caption. Below the list sits a collapsed <strong>Combination Information</strong> expander reporting the aggregate
triangle count and bounding box, the latter as a read-only box control.</p>
<h2 id="adding-a-child">Adding a Child</h2>
<p>The two clients differ here, and the web is the one that gained something:</p>
<ul>
<li><strong>Web</strong> — pick the kind first, then Add; the request carries the kind.</li>
<li><strong>Desktop</strong> — Add takes no kind and always appends a 100 mm cube. The kind is switched afterwards,
on that child's own Geometry Type combo.</li>
</ul>
<p>Five kinds may be children — Box3d, Cylindroid, StlFile, TransformationGeom and a <strong>nested</strong>
GeomCombination, so combinations nest arbitrarily deep. <code>CubeTreeFile</code> and <code>ExtendedCylinder</code> are
accepted by neither client's switch.</p>
<h2 id="behavior">Behavior</h2>
<ul>
<li><strong>A type switch rewires the slot, not just the alias.</strong> Changing a child's kind goes through
<code>SetItemAt</code>, which replaces the entry in <a class="xref" href="../../api/Hi.Geom.GeomCombination.html#Hi_Geom_GeomCombination_StlSources">StlSources</a> itself.</li>
<li><strong>The aggregate STL is cached, and a child's own controller does not invalidate it.</strong> Editing a
child through its own endpoints leaves the combination returning the mesh it had already built, so
both web faces call <code>CleanCache</code> before bubbling the change, and compose that call into the
ancestor chain. This is the behavioural fact the rest of the page depends on.</li>
<li><strong>Removing a child does not renumber the ones after it.</strong> Item keys are minted as
<code>{key}-item-{index}</code> and the remove endpoint leaves later indices pointing at the old aliases,
which is why every structural change rebuilds the branch and re-mints them.</li>
<li><strong>Clear all confirms only on the desktop.</strong> The web posts it directly.</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>
<p>HiNC-2025-webservice (Quasar CLI SPA):</p>
<ul>
<li><code>wwwroot-src/src/components/geom/GeomCombinationEditor.vue</code> — the inline face: the Add bar, the
per-child cards, and the recursive editor in each. Type switches route through <code>SetItemAt</code>, a
cache clean precedes every <code>changed</code> bubble, and item aliases are released on refresh and unmount.</li>
<li><code>wwwroot-src/src/components/controlTree/GeomCombinationTreePanel.vue</code> — the Control-Tree face:
list management only, emitting a structure change so the host re-mints the item aliases.</li>
<li><code>wwwroot-src/src/components/controlTree/itemTypes.ts</code> — registers the kind against that panel with
a child builder that mints one <code>Item</code> node per element, and declares the five container kinds a
child may be.</li>
<li><code>wwwroot-src/src/components/geom/geometryEditors.ts</code> — maps the <code>GeomCombination</code> kind to the
inline editor.</li>
<li><code>wwwroot-src/src/components/geom/GeometryEditor.vue</code> — the recursive kind picker each child card
embeds.</li>
<li><code>wwwroot-src/src/components/controlTree/GeometrySlotPanel.vue</code> and
<code>wwwroot-src/src/components/controlTree/SoleEditorPanel.vue</code> — an <code>Item</code> node's picker and, once a
kind is chosen, that kind's editor.</li>
<li><code>wwwroot-src/src/components/geom/TransformationGeomEditor.vue</code> — the nesting host: a combination
is an allowed inner geometry.</li>
<li><code>wwwroot-src/src/components/controlTree/useControlTreeHost.ts</code>,
<code>wwwroot-src/src/pages/MechBuilderPage.vue</code> and
<code>wwwroot-src/src/components/toolhouse/UpperBeamDiv.vue</code> — the slots that admit the kind: the
fixture geometry, the workpiece raw geometry, a mechanism anchor's geometry and the cutter upper
beam. The workpiece's target geometry deliberately does not.</li>
<li><code>wwwroot-src/src/api/geometry.ts</code> — <code>getGeomCombination</code>, <code>addGeomCombinationItem</code>,
<code>setGeomCombinationItemAt</code>, <code>removeGeomCombinationItemAt</code>, <code>clearGeomCombination</code>,
<code>cleanGeomCombinationCache</code> and <code>indexGeomCombinationItemAt</code>, with the child-kind and combination
types and the create entry.</li>
<li><code>wwwroot-src/src/api/index-service.ts</code> — the index release the editor uses to drop item aliases.</li>
<li><code>wwwroot-src/src/i18n/en/geom.ts</code> — the <code>combination.*</code> strings, and
<code>wwwroot-src/src/i18n/en/tree.ts</code> — the tree panel's own strings and the <code>Item</code> node label.</li>
<li><code>Geom/GeomCombinationController.cs</code> — REST endpoints at <code>/api/GeomCombination/*</code>: <code>New</code>, <code>Get</code>,
<code>GetCount</code>, <code>AddItem</code>, <code>SetItemAt</code>, <code>RemoveItemAt</code>, <code>Clear</code>, <code>CleanCache</code>, <code>IndexItemAt</code> and
<code>GetItemTypeAt</code>. <code>AddItem</code> and <code>SetItemAt</code> share one five-arm kind switch and both clean the
cache.</li>
<li><code>Geom/TransformationGeomController.cs</code>, <code>Mech/FixtureController.cs</code>,
<code>Mech/WorkpieceController.cs</code>, <code>Mech/MechBuilder/GeneralMechanismController.cs</code> and
<code>Mech/CutterController.cs</code> — the container-aware create switches behind each host's <code>onCreate</code>.</li>
</ul>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="geom-manage-control.html">Geometry Management Panel</a> — the switchboard that offers this kind, and
the panel each desktop child card embeds</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>