mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-08-11 00:30:12 -04:00
Sliced files previewed through a vendored copy of PrettyGCode in an iframe. It drew each move as a screen-space line -- a line has no thickness in the scene, so it cannot occlude the layer behind it, which is why prints came out stringy and shimmered where layers crossed. Being a separate app in a frame, it could be neither themed nor translated, and carried its own machinery for detecting a proxy refusing the embed. Now built on libvgcode, the renderer OrcaSlicer draws its own preview with, vendored from three-slicer (AGPL, same as us). It takes the THREE namespace as an argument and imports nothing, so it runs on our 0.181 rather than the 0.160 its package pins. The parser is ours; upstream renders its own kernel's output and ships no G-code parser at all. Two things it has to get right, both found by checking a real plate rather than assuming: - BambuStudio does not use the OrcaSlicer/PrusaSlicer annotations. It writes "; FEATURE:", "; LINE_WIDTH:", "; CHANGE_LAYER" and "; Z_HEIGHT:", not ";TYPE:", ";WIDTH:" and ";LAYER_CHANGE". Reading only the latter showed a 52-layer print as 23,165 layers in one colour, because with no layer marker recognised every travel Z-hop split a layer and every segment took the fallback feature. - It emits a tenth of its moves as G2/G3 arcs -- 706 extruding ones in a single plate. Ignoring them punched holes through curved walls and tree supports. Arcs with no X/Y are the helical travel lift and lay down nothing, so they interpolate as travels. Four colour modes: filament (default, from the AMS slots the file was sliced with), feature, layer height, line width. Speed, fan and temperature are deliberately absent -- upstream derives those from settings rather than the toolpath, and guesses dressed as measurements are worse than an honest omission. The parser now carries the data to do them properly later. Legend entries are switches. Hiding removes the records before the mesh is built rather than recolouring them: the shader packs colour into a single float with no alpha, so there is no transparent to set, and removal is the useful behaviour anyway -- a hidden support stops occluding what it covered. The scene is built once and only the toolpath rebuilds. Doing otherwise constructed a new WebGLRenderer on every render, because the buildVolume default is an object literal and so a fresh identity each time; browsers cap live WebGL contexts and drop the oldest, which blanked the canvas after a few interactions. utils/framing.ts goes with the iframe, along with six now-orphaned strings in all 13 locales. src/lib/vendor is excluded from eslint -- acting on findings in vendored code makes it impossible to re-copy on the next upstream release.
81 lines
2.4 KiB
JSON
81 lines
2.4 KiB
JSON
{
|
|
"name": "frontend",
|
|
"private": true,
|
|
"version": "0.0.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc -b && vite build",
|
|
"lint": "eslint .",
|
|
"preview": "vite preview",
|
|
"test": "vitest",
|
|
"test:run": "vitest run && npm run check:i18n",
|
|
"test:coverage": "vitest run --coverage",
|
|
"test:ui": "vitest --ui",
|
|
"check:i18n": "node scripts/check-i18n-parity.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@dnd-kit/core": "^6.3.1",
|
|
"@dnd-kit/sortable": "^10.0.0",
|
|
"@dnd-kit/utilities": "^3.2.2",
|
|
"@floating-ui/dom": "^1.7.5",
|
|
"@tanstack/react-query": "^5.90.11",
|
|
"@tiptap/extension-color": "^3.11.1",
|
|
"@tiptap/extension-image": "^3.11.1",
|
|
"@tiptap/extension-link": "^3.11.1",
|
|
"@tiptap/extension-text-align": "^3.11.1",
|
|
"@tiptap/extension-text-style": "^3.11.1",
|
|
"@tiptap/extension-underline": "^3.11.1",
|
|
"@tiptap/react": "^3.11.1",
|
|
"@tiptap/starter-kit": "^3.11.1",
|
|
"@types/three": "^0.181.0",
|
|
"dompurify": "^3.4.10",
|
|
"i18next": "25.6.3",
|
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
"jszip": "^3.10.1",
|
|
"lucide-react": "^0.555.0",
|
|
"qrcode.react": "^4.2.0",
|
|
"react": "^19.2.0",
|
|
"react-dom": "^19.2.0",
|
|
"react-i18next": "^16.3.5",
|
|
"react-markdown": "^9.1.0",
|
|
"react-router-dom": "7.18.2",
|
|
"react-simple-keyboard": "^3.8.164",
|
|
"recharts": "^3.5.1",
|
|
"remark-gfm": "^4.0.1",
|
|
"three": "^0.181.2"
|
|
},
|
|
"overrides": {
|
|
"minimatch": "^10.2.1",
|
|
"brace-expansion": "^5.0.9",
|
|
"js-yaml": "^5.2.3",
|
|
"nanoid": "^3.3.18",
|
|
"react-router": "7.18.2"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.39.1",
|
|
"@tailwindcss/postcss": "^4.1.17",
|
|
"@testing-library/jest-dom": "^6.6.0",
|
|
"@testing-library/react": "^16.0.0",
|
|
"@testing-library/user-event": "^14.5.0",
|
|
"@types/node": "^24.10.1",
|
|
"@types/react": "^19.2.5",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@vitejs/plugin-react": "^5.2.0",
|
|
"@vitest/coverage-v8": "^4.1.8",
|
|
"autoprefixer": "^10.4.22",
|
|
"baseline-browser-mapping": "^2.9.19",
|
|
"eslint": "^9.39.1",
|
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
"globals": "^16.5.0",
|
|
"jsdom": "^25.0.0",
|
|
"msw": "^2.6.0",
|
|
"postcss": "^8.5.6",
|
|
"tailwindcss": "^4.1.17",
|
|
"typescript": "~5.9.3",
|
|
"typescript-eslint": "^8.46.4",
|
|
"vite": "^8.0.16",
|
|
"vitest": "^4.1.8"
|
|
}
|
|
}
|