cad-viewer

GitHub

启动本地CAD查看器服务,支持多种CAD及机器人描述文件格式的可视化审查,并生成包含文件路径的实时Review链接。

skills/cad-viewer/SKILL.md earthtojake/text-to-cad

Trigger Scenarios

需要预览或审查STEP、GLB、STL等CAD文件 需要检查URDF/SRDF等机器人描述文件 从CAD生成技能接收文件后需进行视觉验证

Install

npx skills add earthtojake/text-to-cad --skill cad-viewer -g -y
More Options

Use without installing

npx skills use earthtojake/text-to-cad@cad-viewer

指定 Agent (Claude Code)

npx skills add earthtojake/text-to-cad --skill cad-viewer -a claude-code -g -y

安装 repo 全部 skill

npx skills add earthtojake/text-to-cad --all -g -y

预览 repo 内 skill

npx skills add earthtojake/text-to-cad --list

SKILL.md

Frontmatter
{
    "name": "cad-viewer",
    "description": "Start CAD Viewer and return review links for explicit CAD, implicit CAD, and robot-description files. Use when visually reviewing `.step`, `.stp`, `.implicit.js`, `.implicit.mjs`, `.glb`, `.stl`, `.3mf`, `.dxf`, `.urdf`, `.srdf`, or `.sdf` files, especially when handed off from CAD, implicit-cad, URDF, SRDF, or SDF generation skills."
}

CAD Viewer

Provenance: maintained in earthtojake/text-to-cad. Use the installed local skill files as the runtime source of truth; the repository link is only for provenance and release review. If the user asks to modify, debug, or iterate on CAD Viewer source itself, clone that repository and work there — this installed skill runtime runs the Viewer, it is not where you edit it.

Use this skill to open existing or newly generated CAD, implicit CAD, robot-description, or DXF files in CAD Viewer and hand back live review links. The expected input is one or more explicit file paths.

Start Viewer

Start one local CAD Viewer with npm run start. It serves the prebuilt Viewer bundle plus the CAD API on a single fixed port (3245). It is NOT started against a directory — a URL names the directory, so one Viewer serves any folder.

The default port 3245 is 0xCAD — "CAD" in hexadecimal.

Run from this skill directory:

npm --prefix scripts/viewer run start -- --host 127.0.0.1

URL shape

A Viewer URL's path is the absolute directory, exactly as in a file:// URL, and file= selects one artifact inside it:

http://127.0.0.1:3245/absolute/project/models?file=mechanisms/lift_table.step.py

Always build the path from an absolute directory. The Viewer runs from an arbitrary working directory — usually wherever the skill happens to be installed, not the model directory — so a relative path resolves against the wrong place. The file= value is relative to that directory.

On Windows the drive goes in the path, after the URL's leading slash, with forward slashes: D:\project\models is http://127.0.0.1:3245/D:/project/models. The launcher prints this form already; build it the same way by hand.

The path is the workspace, not the file's folder. The Viewer scans it recursively, so the file browser lists every model beneath it and the user can switch files without a new link. Pick the directory the user thinks of as their model workspace — typically the project's models/ directory, or the nearest common parent of the files you were asked to review — and put the rest of the path in file=. Naming the artifact's own deep folder (.../models/step/mechanisms?file=lift_table.step.py) opens the same model but hides the rest of the project, which is almost never what the user wants.

If port 3245 is already in use, the launcher exits with an error rather than rolling to another port; rerun with an explicit free port, --port <n>, and use the URL it prints. In sandboxed agent environments, local binding failures such as EPERM/EACCES can be expected; rerun with the needed permission/escalation.

Add --json to also print a machine-readable result as the last stdout line beginning with { ({"url": ..., "port": ..., "action": "start"}). The printed URL points at the launch directory; replace its path to review any other folder.

Links

  • Before returning any link, resolve <directory>/<file> and confirm it exists. For a generated model pass the generator source (<name>.step.py) — that is what the catalog itself lists, the backend resolves it directly and builds the render artifacts on demand, and no .step file needs to exist. It is also the only form that carries a params sidecar, because a same-stem <name>.step.py shadows <name>.step anyway. For an imported STEP with no generator, pass the .step/.stp itself. If the resolved path is missing, do not return the link; report the problem and point to the correct path.
  • Return one Viewer URL per requested file.
  • Start the Viewer once and pick one workspace root for the session. Every link is that same absolute root plus ?file=<path relative to it>, so all of them share one browsable catalog. Only use a second root for an artifact that lives outside the first.
  • For directory-only review links, return the directory URL without ?file=.
  • Do not stop an existing Viewer server unless the user asks.
  • If Viewer startup fails, report the failure and continue with the owning skill's non-GUI validation or artifacts.

References

  • Read references/viewer-features.md when you need supported file types, Viewer controls, or file-specific feature details.
  • Read references/moveit2-server.md only when the user specifically needs optional SRDF MoveIt2 IK or path-planning controls.

Version History

  • 0.4.12 Current 2026-08-16 02:05

    修复Windows环境下驱动器盘符路径解析错误导致的403及URL格式异常问题。

  • 0.3.13 2026-08-02 21:20

    修正文档错误:将不再存在的npm脚本'agent:start'更正为实际可用的'serve'命令。同步更新服务端逻辑,包括端口自动回退、JSON模式输出及通过API探测复用服务器,解决打包后命令失效问题。

  • 0.3.9 2026-07-24 11:54

Same Skill Collection

plugins/cad/skills/bambu-labs/SKILL.md
plugins/cad/skills/cad-viewer/SKILL.md
plugins/cad/skills/cad/SKILL.md
plugins/cad/skills/dxf/SKILL.md
plugins/cad/skills/gcode/SKILL.md
plugins/cad/skills/implicit-cad/SKILL.md
plugins/cad/skills/sdf/SKILL.md
plugins/cad/skills/sendcutsend/SKILL.md
skills/bambu-labs/SKILL.md
skills/cad/SKILL.md
skills/dxf/SKILL.md
skills/gcode/SKILL.md
skills/implicit-cad/SKILL.md
skills/sdf/SKILL.md
skills/sendcutsend/SKILL.md
skills/srdf/SKILL.md
skills/urdf/SKILL.md
plugins/cad/skills/srdf/SKILL.md
plugins/cad/skills/step-parts/SKILL.md
plugins/cad/skills/urdf/SKILL.md
skills/step-parts/SKILL.md

Metadata

Files
0
Version
0.4.12
Hash
fbe7f1f4
Indexed
2026-07-24 11:54

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-17 02:39
浙ICP备14020137号-1 $mapa de visitantes$