StlFile Editor
The STL file editor points a geometry at an .stl 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 server, not on the machine running the browser, and
that difference shapes everything else on the page.
Layout
- File reference — a read-only field showing the path currently referenced, with an empty-state hint when there is none.
- The picker — a Select dropdown whose menu holds Browse…, Browse Resource… and, only
while a path is set, Clear. Either Browse entry opens the in-app File Explorer dialog filtered
to
.stl. There is no reload action. - STL info — 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.
Behavior
- The picker browses the server's named roots, not a file system. Three roots are exposed — Project, Resource and Admin — and nothing outside them is reachable.
- A pick outside the current project is silently re-homed. The update endpoint stores
Geom/<filename>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. - The info dialog refetches on each open, 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.
- The picker previews. Double-clicking an
.stlrow 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 STL Preview Pane. - One endpoint ships without a caller. The controller exposes
Reload; nothing in the SPA calls it.
Reach
StlFile 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.
Source Code Path
See HiNC App Anatomy for git repository links.
HiNC-2025-webservice (Quasar CLI SPA):
wwwroot-src/src/components/geom/StlFileEditor.vue— the editor: the caption, the file-path input, and the info dialog with its triangle-count badge and four read-only vector rows.wwwroot-src/src/components/widgets/FilePathInput.vue— the picker widget: the Select dropdown with its Browse, Browse Resource and Clear entries beside a read-only field.wwwroot-src/src/components/widgets/FileExplorerDialog.vueandwwwroot-src/src/components/FileExplorer.vue— the in-app browser the Browse entries open, and the row gestures that swap in the STL preview.wwwroot-src/src/components/StlPreviewPane.vueandwwwroot-src/src/api/stlPreview.ts— that preview and the surface behind it.wwwroot-src/src/components/widgets/Vec3Input.vue— the read-only vector rows in the info dialog.wwwroot-src/src/components/geom/geometryEditors.ts— maps theStlFilekind to this editor.wwwroot-src/src/components/geom/GeometryEditor.vue— the kind picker; it leaves this kind's label verbatim.wwwroot-src/src/components/controlTree/itemTypes.ts— registersStlFileagainst the sole-editor panel, lists it among the container kinds, and builds the node label that carries the referenced file.wwwroot-src/src/components/controlTree/SoleEditorPanel.vueandwwwroot-src/src/components/controlTree/GeometrySlotPanel.vue— the kind node's panel and the parent slot's picker.wwwroot-src/src/components/controlTree/useControlTreeHost.ts— the three tree slots that admit the kind, and the node-label refresh when the source file changes.wwwroot-src/src/components/geom/TransformationGeomEditor.vue,wwwroot-src/src/components/geom/GeomCombinationEditor.vue,wwwroot-src/src/components/toolhouse/UpperBeamDiv.vueandwwwroot-src/src/pages/MechBuilderPage.vue— the inline hosts that also admit it.wwwroot-src/src/api/geometry.ts—getStlFile,getStlFileInfo,setStlFileSourceand the create entry.wwwroot-src/src/i18n/en/geom.ts— thestl.*strings and thebounds.*captions shared with the Box3d editor.Geom/StlFileController.cs— REST endpoints at/api/StlFile/*:New,NewWithPath,Get,GetInfo,UpdateSourceFile,UpdateSource,Clear,GetFileInfoandReload.UpdateSourceis where the re-homing happens;GetInfoanswersloaded: falsewhen nothing is cached.Common/NamedRootResolver.cs— the three named roots the picker can reach, and the only three.Common/IndexService.cs— the keyed object store every STL file key resolves against.Mech/WorkpieceController.cs— the workpiece slots' create paths.Disp/StlPreviewController.csandDisp/StlPreviewService.cs— the picker's preview, loaded onto the caller's own rendering connection and superseded as the selection moves.
See Also
- Geometry Editor — the switchboard that offers this kind and hosts this editor
- MeshedGeomFile Editor — the other file-backed kind, and the one the workpiece's raw geometry offers beside this one
- STL Preview Pane — the preview the picker opens on an
.stlrow before the pick is confirmed