A utility CAD-like application to apply modifications to a prosthetic limb socket STL file, and output the modifications to a GCode file.
Requires Node.js 24+ (see .nvmrc).
git clone https://github.com/andrewgremlich/socket-print.git
cd socket-print
npm install
npm run devOpen http://localhost:4200.
npm run build # Production build (runs tests first)
npm run test # Run Vitest
npm run check # TypeScript + Biome
npm run knip # Find unused files/exports/depsThe app is a fully static site deployed to Cloudflare Workers via Workers Static Assets. No Worker script is required — Cloudflare serves the dist/ build directly from the edge. Config lives in wrangler.jsonc; edge caching/header rules live in public/_headers.
npm run deploy # Build, then `wrangler deploy`
npm run cf:preview # Build, then serve the production bundle locally via `wrangler dev`.github/workflows/deploy-cloudflare.yml deploys on every push to main. Set these repository secrets:
CLOUDFLARE_API_TOKEN— a token with the Edit Cloudflare Workers permissionCLOUDFLARE_ACCOUNT_ID— your Cloudflare account ID
The first deploy (locally via npm run deploy) creates the Worker and prints its *.workers.dev URL; attach a custom domain in the Cloudflare dashboard or via a routes entry in wrangler.jsonc.
The app installs a service worker for offline use. See SERVICE_WORKER.md.
To inspect a generated GCode file, use NCViewer.
This application bridges two different coordinate system conventions:
- Three.js (3D visualization): Y-up coordinate system where Y is the vertical axis
- 3D Printing / GCode: Z-up coordinate system where Z is the vertical axis
When generating GCode from Three.js geometries, coordinate transformations are necessary to convert between these systems:
- In Three.js: Objects are positioned with Y representing height
- In GCode: The Z axis represents height (vertical movement)
- src/3d/generateGCode.ts —
makeGCodePoint()andflipVerticalAxis()handle the Y↔Z swap when emitting GCode points - src/3d/sliceWorker.ts — points are collected in Three.js (Y-up) space and later transformed during GCode generation
Variables like verticalAxis and flipHeight carry this transformation through the pipeline.
- Pellet extruder flow / RPM: https://dyzedesign.com/2024/05/flow-to-rpm-factor-optimize-your-3d-printing-with-pellet-extruders/
- Clipper polygon-clipping library (under evaluation): https://github.com/junmer/clipper-lib