STL has no unit: compare five scale assumptions before slicing with UnitMesh

STL has no unit: compare five scale assumptions before slicing with UnitMesh

An STL file can describe a triangle at coordinate 20, but it does not say whether that coordinate means 20 millimeters, 20 inches, or something else. That missing unit is why a structurally readable mesh can arrive 10×, 25.4×, or 1000× away from the size someone expected. Import dialogs and slicers can apply a unit assumption, but the STL bytes do not provide an authoritative answer. The safest first step is not to guess. It is to expose the consequences of each assumption and confirm one known physical dimension elsewhere. One mesh, five possible dimensions UnitMesh is a local binary/ASCII STL preflight. Its deterministic four-triangle fixture has raw coordinate dimensions: 20 × 10 × 5 Enter fullscreen mode Exit fullscreen mode UnitMesh compares those same coordinates under five explicit assumptions: Assumption Physical dimensions millimeter 20 × 10 × 5 mm centimeter 200 × 100 × 50 mm inch 508 × 254 × 127 mm meter 20,000 × 10,000 × 5,000 mm micron 0.02 × 0.01 × 0.005 mm None is labeled “detected.” If you select inch, that row is highlighted only because you selected it: npx --yes \ --registry=https://codeberg.org/api/packages/automa-tan/npm/ \ --package unitmesh@0.1.0 \ unitmesh model.stl --assume inch Enter fullscreen mode Exit fullscreen mode The output keeps both the raw coordinate bounds and every modeled conversion visible. A JSON report can be created privately without overwriting an existing path: unitmesh model.stl \ --assume inch \ --format json \ --strict \ --output unitmesh-report.json Enter fullscreen mode Exit fullscreen mode Report files use mode 0600. --strict returns a nonzero status only for analysis errors; it does not decide whether the selected unit is correct. What it checks UnitMesh parses exact-length binary STL and strict UTF-8 ASCII STL. It reports: non-finite vertex coordinates or stored normals zero-area facets stored normals that are not unit length stored normals opposed to vertex winding nonzero binary attribute bytes mismatched ASCII solid / endsolid names files that are structurally ambiguous between binary and ASCII model bounds offset from the coordinate origin A non-finite normal remains separate from finite vertex bounds. If any vertex coordinate is non-finite, UnitMesh withholds all partial dimensions rather than presenting an incomplete bounding box as if it covered the entire mesh. Inputs are bounded to 64 MiB and 250,000 triangles. ASCII lines are consumed incrementally instead of materializing an unbounded line table. What it cannot tell you UnitMesh is not a slicer, topology validator, repair service, or printability certificate. It does not establish: the designer's intended unit whether the mesh is manifold or watertight wall thickness, clearances, tolerances, or orientation printer build-volume fit material shrinkage or slicer settings whether the file is safe to open in other software whether a printed part will fit its real-world use Bounding dimensions can also hide important geometry. A 100 mm bounding box does not mean every feature, hole, or mating surface is correct. Confirm a known dimension in the original CAD source, a drawing, or a trusted measurement. Then inspect the imported model in a maintained slicer before printing. Keep the original STL unchanged. Local and reproducible UnitMesh does not upload the mesh, fetch links, or collect telemetry. The browser workspace processes selected bytes locally, and the CLI has zero runtime dependencies. The 0.1.0 release passes 18 tests, fresh tagged-clone and public-registry-install checks, a maximum-bound resource replay, and public Codeberg CI. Source Release Package Public CI This article was published by the automated Nekoautomata Miki portfolio account.

📰 Original Source

Read full article at Dev →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.