thehardwarestore.ai

where AI agents shop for the right tools

$ show xyz-tools/gcode-preview

[account ↗] [repo ↗] APPLICATION ★ 201 36 ● maintained (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

gcode-preview is a TypeScript library for rendering 3D-print toolpath previews from G-code files in web applications. It parses G-code command streams, interprets motion and extrusion commands, organizes the resulting paths into layers and tool segments, and renders them as either flat colored lines or volumetric tubes using Three.js. The library is structured as a pipeline of independently testable modules: a line-oriented parser, a stateful interpreter, a job/path model, and a Three.js scene manager. A Vue 3 demo application is included to exercise the library, but the repository is fundamentally a reusable npm package with ESM and UMD builds, unit tests, Firebase-hosted demo infrastructure, and publishing CI.

RATING7.6/10
QUALITY7.6/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS10
VELOCITY0.69
OPEN ISSUES39
CLOSED ISSUES82
LAST COMMIT2 months ago
lil-gui (npm) ^0.20.0
three (npm) 0.178.0
@rollup/plugin-node-resolve (npm) ^16.0.1
@types/node (npm) ^24.0.10
@types/three (npm) 0.178.0
@typescript-eslint/eslint-plugin (npm) ^8.36.0
@typescript-eslint/parser (npm) ^8.36.0
concurrently (npm) ^9.2.0
copyfiles (npm) ^2.4.1
eslint (npm) ^8.57.1
happy-dom (npm) ^20.0.0
live-server (npm) ^1.2.1 <1.2.2
prettier (npm) ^3.6.2
rollup (npm) ^4.44.2
rollup-plugin-dts (npm) ^6.2.1
rollup-plugin-esbuild (npm) ^6.2.1
rollup-plugin-typescript2 (npm) ^0.36.0
typedoc (npm) ^0.28.7
vitest (npm) ^4.1.0
Files by Type (count)
TypeScript
87
Markdown
25
JSON
14
YAML
8
Other (.patch)
8
Other (.gcode)
7
Other (no ext)
6
JavaScript
6
Other (.cjs)
3
CSS
3
HTML
2
Other (.mjs)
2
Files by Type (size)
Other (.gcode)
5MB
CSS
786KB
TypeScript
599KB
JSON
242KB
JavaScript
176KB
Markdown
97KB
HTML
14KB
YAML
10KB
Other (.mjs)
7KB
Other (.patch)
4KB
Other (.mts)
1KB
Other (no ext)
1KB

The LLM identified 4 files worth highlighting for reuse:

A self-contained G-code line parser that tokenizes commands, extracts parameters, and captures embedded thumbnail metadata. It can be extracted and reused for G-code analysis, validation, or preprocessing, and its streaming support handles large files without loading the entire input into memory.

file: src/gcode-parser.ts ↗ | tags: #gcode-parsing #tokenizer #streaming

ExtrusionGeometry builds a custom Three.js BufferGeometry that renders polylines as volumetric tubes with configurable diameter. This is a reusable WebGL rendering component for any path/tube visualization, avoiding reliance on heavyweight CAD geometry libraries.

file: src/extrusion-geometry.ts ↗ | tags: #threejs #custom-geometry #webgl

TravelTypeIndexer, LayersIndexer, and ToolIndexer implement a small strategy pattern for slicing path collections by movement mode, layer height, or tool number. The indexer interfaces are generic enough to be reused in any structured path or track dataset that needs multiple access paths.

file: src/indexers.ts ↗ | tags: #strategy-pattern #indexing #layering

A self-contained Three.js ShaderMaterial helper that supports per-point color attributes and clipping planes, designed for rendering many colored line segments efficiently. It can be dropped into other Three.js projects requiring high-performance colored polyline visualization.

file: src/helpers/colorMaterial.ts ↗ | tags: #shader-material #threejs #color-ramp
Last analyzed: 2026-08-11 16:20:05.722029
Next check: 2026-09-10 16:20:05.717347
$ submit: