-
Notifications
You must be signed in to change notification settings - Fork 0
Development
sunnydesigntech edited this page May 6, 2026
·
2 revisions
CutCase is a static browser app with a small geometry core.
https://github.com/sunnydesigntech/CutCase
- Node.js 22 recommended
- npm
- Google Chrome for browser verification
GitHub Actions currently uses Node.js 22.
git clone https://github.com/sunnydesigntech/CutCase.git
cd CutCase
npm install
npm test
npm run build
npm run serveOpen:
http://localhost:5173
index.html App shell and controls
styles.css Workbench UI styling
app.js Browser UI state and rendering
box-model.js Geometry, panels, SVG export
preview3d.js Three.js preview adapter
preview3d.bundle.js Bundled 3D preview for browser/file use
test.js Geometry and SVG tests
verify-ui.mjs Browser verification
scripts/build.mjs Static build script
docs/ Versioned project docs
docs/wiki/ Mirror of GitHub Wiki source
form inputs
-> app.js readConfig()
-> box-model.js normalizeConfig()
-> box-model.js buildPanels()
-> box-model.js layoutPanels()
-> box-model.js buildSvg()
-> app.js writes SVG preview
-> preview3d.js renders panel meshes
box-model.js should remain independent from the DOM.
It owns:
- dimension normalization
- panel definitions
- finger-joint paths
- lid generation
- divider generation
- feature normalization
- SVG export
- fit-test export
app.js owns:
- reading form controls
- feature placement state
- selected feature state
- SVG preview injection
- download behavior
- Three.js preview sync
preview3d.js adapts panel geometry to Three.js.
It owns:
- scene setup
- camera
- orbit controls
- lights and shadows
- panel mesh extrusion
- cut feature holes
- engrave/mark overlays
- exploded view
preview3d.js imports Three.js modules. To keep direct browser file support, it is bundled:
npm run bundle:previewFull build:
npm run buildThis writes dist/.
Geometry tests:
npm testBrowser verification:
TARGET_URL=file:///Users/wcchun/Documents/makercase/index.html npm run verify:uiLive verification:
TARGET_URL=https://sunnydesigntech.github.io/CutCase/ npm run verify:uiverify-ui.mjs checks:
- Three.js canvas exists
- 3D canvas is non-blank
- drag rotation changes pixels
- feature placement changes pixels
- lid and divider generation changes pixels
- add-on SVG panels are present
- mobile viewport renders
- console has no errors
GitHub Pages deploys on push to main.
Workflow:
- checkout
- setup Node
npm cinpm testnpm run build- upload
dist - deploy Pages
Workflow file:
.github/workflows/pages.yml
- Keep geometry code deterministic.
- Keep DOM reads out of
box-model.js. - Update tests when geometry changes.
- Update
verify-ui.mjswhen browser behavior changes. - Rebuild
preview3d.bundle.jswhenpreview3d.jschanges. - Preserve direct
file://support. - Keep SVG and 3D preview driven by the same model.
npm testnpm run build- run browser verifier locally
- commit changes
- push to
main - watch GitHub Pages workflow
- run live browser verifier
- update docs/wiki when behavior changes