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/anatomy/geom/stlfile-editor.html
T
2026-09-11 03:46:11 +08:00

207 lines
12 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>StlFile Editor | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="StlFile Editor | 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-StlFileControl">
<h1 id="stlfile-editor">StlFile Editor</h1>
<p>The STL file editor points a geometry at an <code>.stl</code> file rather than describing a shape: the model
holds a file reference, and the editor is a picker over it plus a read-only summary of what was
loaded. The file lives on the <strong>server</strong>, not on the machine running the browser, and
that difference shapes everything else on the page.</p>
<h2 id="layout">Layout</h2>
<ol>
<li><strong>File reference</strong> — a read-only field showing the path currently referenced, with an empty-state
hint when there is none.</li>
<li><strong>The picker</strong> — a <strong>Select</strong> dropdown whose menu holds <em>Browse…</em>, <em>Browse Resource…</em> and, only
while a path is set, <em>Clear</em>. Either Browse entry opens the in-app File Explorer dialog filtered
to <code>.stl</code>. There is no reload action.</li>
<li><strong>STL info</strong> — behind an info icon, opening a dialog that shows the triangle count and the
bounding box as read-only vector rows, and states an empty case when nothing is loaded.</li>
</ol>
<h2 id="behavior">Behavior</h2>
<ul>
<li><strong>The picker browses the server's named roots, not a file system.</strong> Three roots are exposed —
Project, Resource and Admin — and nothing outside them is reachable.</li>
<li><strong>A pick outside the current project is silently re-homed.</strong> The update endpoint stores
<code>Geom/&lt;filename&gt;</code> rather than the picked location, so saving the project copies the geometry into
the project folder. The consequence is visible: after such a pick the read-only field shows the
re-homed path, not the one that was chosen.</li>
<li><strong>The info dialog refetches on each open</strong>, because the bounding box is computed server-side by
walking the triangles rather than kept resident. Only Min and Max come back from the server;
Dimension and Center are derived in the browser from them.</li>
<li><strong>The picker previews.</strong> Double-clicking an <code>.stl</code> row in the File Explorer dialog swaps its slave
panel to a 3D preview of that file before the pick is confirmed. The dialog opens with that panel
hidden, which is why the double-click
is the gesture that reaches a preview there; a single click does so only once the toolbar's pencil
has revealed the panel. The preview belongs to the File Explorer rather than to this editor — see
<a class="xref" href="../util/stl-preview-pane.html">STL Preview Pane</a>.</li>
<li><strong>One endpoint ships without a caller.</strong> The controller exposes <code>Reload</code>; nothing in the SPA calls
it.</li>
</ul>
<h2 id="reach">Reach</h2>
<p><code>StlFile</code> is the least restricted geometry kind. It is allowed in every Control-Tree geometry slot —
the fixture's geometry and both of the workpiece's — is one of the container kinds, so it can be a
transformation geometry's inner geometry or a combination child, and it is offered by the two inline
hosts as well: a mechanism anchor's geometry and the cutter's upper beam. The Control-Tree node
carries the referenced file in its own label.</p>
<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/StlFileEditor.vue</code> — the editor: the caption, the file-path
input, and the info dialog with its triangle-count badge and four read-only vector rows.</li>
<li><code>wwwroot-src/src/components/widgets/FilePathInput.vue</code> — the picker widget: the Select dropdown
with its Browse, Browse Resource and Clear entries beside a read-only field.</li>
<li><code>wwwroot-src/src/components/widgets/FileExplorerDialog.vue</code> and
<code>wwwroot-src/src/components/FileExplorer.vue</code> — the in-app browser the Browse entries open, and
the row gestures that swap in the STL preview.</li>
<li><code>wwwroot-src/src/components/StlPreviewPane.vue</code> and <code>wwwroot-src/src/api/stlPreview.ts</code> — that
preview and the surface behind it.</li>
<li><code>wwwroot-src/src/components/widgets/Vec3Input.vue</code> — the read-only vector rows in the info dialog.</li>
<li><code>wwwroot-src/src/components/geom/geometryEditors.ts</code> — maps the <code>StlFile</code> kind to this editor.</li>
<li><code>wwwroot-src/src/components/geom/GeometryEditor.vue</code> — the kind picker; it leaves this kind's
label verbatim.</li>
<li><code>wwwroot-src/src/components/controlTree/itemTypes.ts</code> — registers <code>StlFile</code> against the
sole-editor panel, lists it among the container kinds, and builds the node label that carries the
referenced file.</li>
<li><code>wwwroot-src/src/components/controlTree/SoleEditorPanel.vue</code> and
<code>wwwroot-src/src/components/controlTree/GeometrySlotPanel.vue</code> — the kind node's panel and the
parent slot's picker.</li>
<li><code>wwwroot-src/src/components/controlTree/useControlTreeHost.ts</code> — the three tree slots that admit
the kind, and the node-label refresh when the source file changes.</li>
<li><code>wwwroot-src/src/components/geom/TransformationGeomEditor.vue</code>,
<code>wwwroot-src/src/components/geom/GeomCombinationEditor.vue</code>,
<code>wwwroot-src/src/components/toolhouse/UpperBeamDiv.vue</code> and
<code>wwwroot-src/src/pages/MechBuilderPage.vue</code> — the inline hosts that also admit it.</li>
<li><code>wwwroot-src/src/api/geometry.ts</code> — <code>getStlFile</code>, <code>getStlFileInfo</code>, <code>setStlFileSource</code> and the
create entry.</li>
<li><code>wwwroot-src/src/i18n/en/geom.ts</code> — the <code>stl.*</code> strings and the <code>bounds.*</code> captions shared with
the Box3d editor.</li>
<li><code>Geom/StlFileController.cs</code> — REST endpoints at <code>/api/StlFile/*</code>: <code>New</code>, <code>NewWithPath</code>, <code>Get</code>,
<code>GetInfo</code>, <code>UpdateSourceFile</code>, <code>UpdateSource</code>, <code>Clear</code>, <code>GetFileInfo</code> and <code>Reload</code>. <code>UpdateSource</code>
is where the re-homing happens; <code>GetInfo</code> answers <code>loaded: false</code> when nothing is cached.</li>
<li><code>Common/NamedRootResolver.cs</code> — the three named roots the picker can reach, and the only three.</li>
<li><code>Common/IndexService.cs</code> — the keyed object store every STL file key resolves against.</li>
<li><code>Mech/WorkpieceController.cs</code> — the workpiece slots' create paths.</li>
<li><code>Disp/StlPreviewController.cs</code> and <code>Disp/StlPreviewService.cs</code> — the picker's preview, loaded onto
the caller's own rendering connection and superseded as the selection moves.</li>
</ul>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="geometry-editor.html">Geometry Editor</a> — the switchboard that offers this kind and
hosts this editor</li>
<li><a href="meshed-geom-file-editor.html">MeshedGeomFile Editor</a> — the other file-backed kind, and the one the
workpiece's raw geometry offers beside this one</li>
<li><a class="xref" href="../util/stl-preview-pane.html">STL Preview Pane</a> — the preview the picker opens on an <code>.stl</code> row
before the pick is confirmed</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>