[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81076":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":27,"discoverSource":28},81076,"cad-viewer","earthtojake\u002Fcad-viewer","earthtojake","Interactive browser-based CAD viewer for inspecting STEP, STL, 3MF, GLB, DXF, URDF, SDF, and SRDF files","https:\u002F\u002Fdemo.cadskills.xyz",null,"JavaScript",49,3,44,0,2,5,6,1.81,false,"main",true,[],"2026-06-12 02:04:10","# CAD Explorer Viewer\n\nThis package contains the CAD Explorer viewer: a Vite\u002FReact app for inspecting CAD and robot-description files, plus a package-local snapshot CLI. This README is only for developing and iterating on this viewer package.\n\nThe viewer is read-only with respect to the active scan root. It discovers existing files and colocated viewer assets; it does not generate CAD, run Python, or start robot middleware.\n\n## Quick Start\n\nRun these commands from this directory:\n\n```bash\nnpm install\nnpm run dev\nnpm run test\nnpm run build\n```\n\nFor a root-aware dev server that prints a reusable URL:\n\n```bash\nnpm run dev:ensure -- \\\n  --workspace-root \u002Fpath\u002Fto\u002Fworkspace \\\n  --root-dir models \\\n  --file fun\u002Frobotic_hand_end_effector.step\n```\n\nUse the URL printed by `dev:ensure`; do not assume a fixed port during development.\n\n## Package Map\n\n- `main.jsx`: React entrypoint.\n- `components\u002FCadWorkspace.js`: workspace shell, file selection, side panels, and shared viewer state.\n- `components\u002FCadExplorer.js`: 3D CAD, mesh, URDF, SRDF, and SDF scene runtime.\n- `components\u002FDxfExplorer.js`: 2D DXF flat-pattern runtime.\n- `components\u002Fworkbench\u002F`: workbench controls, file sheets, toolbar, and theme settings UI.\n- `common\u002F`: shared non-React scene, theme, STEP module, topology, and snapshot helpers.\n- `lib\u002F`: file scanning, format parsers, selector runtime, persistence, and viewer utilities.\n- `scripts\u002Fensure-dev.mjs`: reusable dev-server launcher.\n- `snapshot\u002Findex.mjs`: headless snapshot CLI.\n\n## Data Inputs\n\nThe viewer scans `EXPLORER_ROOT_DIR` under `EXPLORER_WORKSPACE_ROOT`. If `EXPLORER_WORKSPACE_ROOT` is unset, it is inferred from the process working directory. If `EXPLORER_ROOT_DIR` is unset, the workspace root is scanned.\n\nSupported visible entries:\n\n- `.step` and `.stp`\n- `.stl`\n- `.3mf`\n- `.glb`\n- `.dxf`\n- `.urdf`\n- `.srdf`\n- `.sdf`\n\nSTEP entries use colocated hidden GLB sidecars named `.\u003Cstep-filename>.glb`. For example, `models\u002Fpart.step` pairs with `models\u002F.part.step.glb`. The GLB may contain the `STEP_topology` extension used for assembly structure, face picking, edge picking, and copied `@cad[...]` references.\n\nURDF, SRDF, and SDF entries are parsed directly from XML. Referenced mesh files are resolved relative to the selected robot-description file when possible. SRDF entries use `\u003Cexplorer:urdf path=\"...\"\u002F>` metadata to locate the linked URDF.\n\n## Runtime\n\n`npm run dev` starts Vite on `EXPLORER_PORT` with `strictPort`. If that port is occupied, Vite reports the conflict.\n\n`npm run dev:ensure` probes existing local viewer servers with `GET \u002F__cad\u002Fserver`, reuses a matching scan root when possible, and otherwise starts a detached Vite server on the first available port from `EXPLORER_PORT` through `EXPLORER_PORT_END`.\n\nImportant environment variables:\n\n- `EXPLORER_WORKSPACE_ROOT`: base workspace path.\n- `EXPLORER_ROOT_DIR`: scan root relative to the workspace root, or an absolute scan root inside it.\n- `EXPLORER_DEFAULT_FILE`: scan-root-relative file opened when `?file=` is absent.\n- `EXPLORER_PORT`: preferred dev\u002Fpreview port, default `4178`.\n- `EXPLORER_PORT_END`: optional end of the `dev:ensure` port search range.\n- `EXPLORER_GITHUB_URL`: top-bar GitHub link target.\n- `EXPLORER_ALLOWED_HOSTS`: extra hostnames accepted by local Vite dev and preview.\n- `EXPLORER_MOVEIT2_WS_URL`: optional websocket URL for SRDF MoveIt2 controls in local dev.\n- `EXPLORER_SERVER_REGISTRY`: optional path for the local server registry JSON file.\n\nProduction builds scan at build time. Set `EXPLORER_WORKSPACE_ROOT`, `EXPLORER_ROOT_DIR`, and `EXPLORER_DEFAULT_FILE` before `npm run build` when the static app should include a specific catalog\u002Fdefault file.\n\n## Persistence\n\nURL query params own shareable selection state:\n\n- `?file=` selects the active entry.\n- `?refs=` carries copied CAD references into the workspace.\n- `?moveit2Ws=` overrides `EXPLORER_MOVEIT2_WS_URL` for one local browser session.\n\nBrowser storage is intentionally narrow. Theme selection and custom themes are stored by `lib\u002Fworkbench\u002Fpersistence.js`. The storage key is `cad-explorer:theme` because it belongs to CAD Explorer viewer UI state.\n\nWorkspace state such as panels, directory expansion, drawing state, active tools, and per-file view state is React\u002Fsession state, not durable browser storage.\n\n## Snapshot CLI\n\nThe package-local snapshot CLI creates still images, STEP-module parameter GIFs, SVG sections, and part lists from the same shared scene helpers used by the UI. Use GIFs only for CAD parameter animation review; use still snapshots otherwise.\n\n```bash\nnpm run snapshot -- --job path\u002Fto\u002Fjob.json\nnpm run snapshot -- --job -\nnpm run snapshot -- --input models\u002Fpart.step --output \u002Ftmp\u002Fpart.png --theme technical\n```\n\nShortcut flags are for common theme snapshots:\n\n- `--input`\n- `--output`\n- `--mode`\n- `--theme`\n- `--camera`\n- `--width`\n- `--height`\n- `--size-profile`\n- `--view-labels`\n- `--params`\n\nSupported modes are `view`, `orbit`, `section`, and `list`. `--theme` accepts a built-in theme id, an inline JSON theme object, or a path to a JSON theme file. Set `theme.display.mode` to `solid` or `wireframe` for surface\u002Fwire output. `--params` targets `.step.js` STEP module sidecar parameters.\n\nThe snapshot daemon is optional and managed by the CLI:\n\n```bash\nnpm run snapshot -- daemon status\nnpm run snapshot -- daemon stop\n```\n\n## UX Contract\n\n- STEP entries expose face picking from visible GLB triangles and edge picking from selector proxy geometry when topology is available.\n- Occurrence, shape, face, and edge references are copied as `@cad[...]` strings.\n- DXF entries are read-only flat-pattern views.\n- URDF and SDF entries show direct robot\u002Fmodel structure with joint sliders when joints are available.\n- SRDF entries show linked-URDF structure, SRDF group-state presets, and optional local MoveIt2 controls when a websocket endpoint is configured.\n- The viewer selects one file at a time.\n- Sidebar grouping follows the exact active scan-root directory structure.\n\n## Verification\n\nRun the full viewer suite before handing off viewer changes:\n\n```bash\nnpm run test\nnpm run build\n```\n\nUseful targeted checks:\n\n```bash\nnode --test --experimental-default-type=module snapshot\u002Fsnapshot.test.mjs\nnode --test --experimental-default-type=module lib\u002FthemeSettings.test.js\nnode --test --experimental-default-type=module lib\u002Fworkbench\u002Fsidebar.test.js\nnode --test --experimental-default-type=module scripts\u002Fensure-dev.test.mjs\n```\n\nFor UI changes, also open a representative file with `npm run dev:ensure` and verify the app renders, selection works, and the browser console is clean.\n","这是一个基于浏览器的交互式CAD查看器，支持STEP、STL、3MF、GLB、DXF、URDF、SDF和SRDF文件的检查。项目使用JavaScript编写，基于Vite和React构建，提供了一个可读取多种CAD及机器人描述文件格式的可视化工具。它具有发现现有文件及其关联资源的能力，但不支持生成CAD或运行Python脚本等功能。适用于需要在网页环境中查看和分析上述格式文件的设计、制造或教育场景。用户可以通过简单的命令行操作启动开发服务器，并通过提供的URL访问该查看器。","2026-06-11 04:03:26","CREATED_QUERY"]