跳到正文
cccskills
免费在 GitHub 公开

sdf

Create, edit, and validate SDFormat files that describe robots and simulation worlds. Check coordinate frames, joints, geometry, and physical properties, review models in CAD Viewer, and report assumptions and compatibility risks before simulator handoff.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

SDFormat/SDF model and world authoring, validation, and simulator handoff. Use for `.sdf` files, SDFormat XML, models, worlds, links, joints, poses, frames, inertials, visual/collision geometry, mesh URIs, sensors, lights, physics, plugins, includes, Gazebo, static SDF review, or simulator-specific metadata. Do not use for signed-distance-field geometry. Open and visually review existing SDF files in CAD Viewer.

查看安装方法

适用场景

  • Create reusable robot models or simulation worlds
  • Review coordinate frames, joint axes, and inertial properties
  • Validate SDF files and inspect models in CAD Viewer
  • Derive SDF from an existing URDF for simulator handoff

包含的文件(11)

  • SKILL.md10.6 KB
  • agents/openai.yaml296 B
  • LICENSE1.0 KB
  • references/design-ledger.md4.1 KB
  • references/examples.md4.3 KB
  • references/frame-semantics.md3.6 KB
  • references/interoperability.md3.5 KB
  • references/llm-guardrails.md4.4 KB
  • references/sdf-workflow.md4.2 KB
  • references/smoke-tests.md3.3 KB
  • references/validation.md8.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

SDF

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.

Use this skill when the deliverable is an SDFormat document. SDFormat describes simulator and world behavior: models, worlds, frames, poses, links, joints, inertials, visuals, collisions, sensors, lights, physics, plugins, includes, and simulator metadata.

This skill is for SDFormat, not signed-distance-field geometry.

The .sdf file is the source of truth: author and edit the XML directly. There is no gen_sdf() contract.

Setup

Run cadgen through uv, so this skill's commands share one installation, and its warm build daemon, with the CAD app's server:

  • cadgen below means uvx --no-config --managed-python --python 3.13 --from cadgen==0.7.26 cadgen
  • python below means uvx --no-config --managed-python --python 3.13 --from cadgen==0.7.26 python

The first run downloads that installation and the first snapshot its headless browser; later runs reuse both.

Core rules

  1. Author .sdf XML directly and validate every created or modified file with cadgen sdf validate before reporting completion.
  2. Identify the target consumer before editing: Gazebo/libsdformat version, another simulator, visualization-only tooling, model package, or world handoff.
  3. Decide document kind: model-level SDF, world-level SDF, or model-in-world. Prefer model-level SDF for reusable robot/object exports.
  4. Use SI units unless the target explicitly requires otherwise: meters, kilograms, seconds, radians.
  5. Prefer version="1.12" for new outputs unless the target consumer constrains the version.
  6. Establish the design ledger before writing poses, frames, joint axes, mesh scales, inertials, sensors, or plugins, and keep it as a comment block at the top of the .sdf. Use references/design-ledger.md and references/llm-guardrails.md.
  7. Write relative_to / expressed_in explicitly on every nontrivial pose and axis. Implicit frame defaults are the top SDF failure mode. See references/frame-semantics.md.
  8. Do not infer spatial transforms from visual impression alone. Derive poses, axes, scale, mass, inertia, and frame names from upstream source data, drawings, simulator documentation, measured values, or explicit assumptions. Never freehand computed numbers — use formulas or a throwaway helper script (inertia tensors, unit conversions).
  9. When the robot already has a URDF, derive the SDF from it instead of re-authoring geometry; see references/interoperability.md.
  10. Regenerate upstream geometry, mesh, robot-description, render, topology, or package assets with their owning workflows before editing SDF that references them.
  11. After authoring, run available checks: bundled validation (which runs gz sdf --check itself whenever gz is on PATH), simulator load, joint motion, and plugin/sensor startup.
  12. Report assumptions, skipped checks, unresolved resource paths, and target-specific compatibility risks.

Scope

Use this skill for SDFormat outputs. Do not use it for signed-distance-field modeling, raw geometry generation, planning semantics, or to paper over incorrect upstream robot/source data unless the task is explicitly simulator-only.

Show the model

Show the user each file you create or change, and any they ask to see. Snapshots and validation don't replace this.

  • If your tools include cad_show (your host may prefix it), use it with the file's absolute path, and follow its description for when to call it again. cad_view reads what the user selected; cad_screenshot shows you what they see. Neither is a review of your own work.

  • Otherwise run the CAD Viewer, from any folder:

    cadgen viewer --host 127.0.0.1 --json --detach
    

    --detach returns once the viewer answers requests and leaves it running in the background: always pass it, since a foreground viewer never exits (and piping its output through tail can hide the URL for good). It starts this machine's one viewer, or reuses it. Read url from its one JSON line (never guess the port), and for each file return url?file=<its URL-encoded absolute path>. If it fails to launch, say so.

Review placement, resources and joints. The viewer does not execute simulator plugins or validate dynamics; keep simulator checks separate.

Workflow

  1. Locate the target .sdf and its consumers.
  2. Read or create the design ledger comment block.
  3. Read references/frame-semantics.md before editing any <pose>, <frame>, joint axis, relative_to, expressed_in, nested scope, sensor frame, or plugin frame.
  4. Author the XML directly, following the worked examples in references/examples.md.
  5. Validate the explicit target with cadgen sdf validate; treat bundled validation as a guardrail, not simulator proof.
  6. Run target-consumer smoke tests when available (references/smoke-tests.md).
  7. Show the result (Show the model). Static rendering does not execute SDF plugins or read file-authored motion metadata.
  8. Report checks run, checks skipped, and assumptions.

Commands

Run cadgen as Setup defines it. cadgen doctor <skill-dir> reports the installation in use and checks that it is the one this skill pins — docs drift silently on another. Validation itself needs nothing beyond the Python standard library; only snapshots need the browser. Use cadgen <verb> --help for the complete current interface.

cadgen sdf validate path/to/model.sdf
cadgen sdf validate path/to/model.sdf --strict
cadgen sdf validate path/to/model.sdf --json
cadgen sdf snapshot path/to/model.sdf review.png

The validator checks document shape, name scopes, pose/frame graphs, joints, geometry, mesh URIs, inertials, sensors, and plugins, and prints its findings plus a summary. One run validates ONE file: --strict treats warnings as failures and --json prints one line of {"ok", "path", "issues": [{"severity", "code", "message", "element", "hint"}], "summary"}, where element is the XML path. It exits nonzero if the target fails.

External checking is on by default:

cadgen sdf validate path/to/model.sdf --gz-check required
cadgen sdf validate path/to/model.sdf --gz-check never

gz sdf --check is target-consumer validation. --gz-check auto is the default: it runs when gz is on PATH, reporting gz_check_passed or the tool's own output as the error gz_check_failed, and otherwise notes info: gz_check_unavailable and carries on. An absent optional tool says nothing about the file, so it never fails a clean document and --strict does not change that. --gz-check required makes the tool mandatory — a missing gz is then an error — and --gz-check never skips it outright.

Required report shape

When finishing an SDF task, include a compact report:

Validated: path/to/model.sdf
Checks run:
- bundled SDF validation: passed
- gz sdf --check: skipped, gz not installed
- simulator load: skipped, target simulator unavailable
- viewer review: live link returned, or explicit launch failure
Assumptions:
- Assumed mesh units are meters.
- Assumed lidar frame is coincident with lidar_link.
Risks:
- Camera plugin filename was not verified in the target simulator environment.

Snapshot Tool

cadgen sdf snapshot renders the robot to a PNG still, using the same shared CLI and headless browser runtime every rendering skill uses — so a snapshot matches what the CAD Viewer shows.

cadgen sdf snapshot path/to/robot.sdf review.png

It accepts .sdf only (a format door, same TARGET [OUT] grammar as the rest). Pose the robot with --joint-values — {joint: degrees} JSON, joints you do not name staying at their defaults, where the CAD Viewer opens the robot (the "jointValues" job field is the same thing in a packet). The snapshot draws the robot with the viewer's own scene, so it shows what the viewer shows, and a link mesh that cannot be loaded fails it rather than leaving the link out. Robots are authored in metres and are framed on the robot scene scale automatically.

A normal snapshot uses Solid mode and Light appearance. The display mode is solid (the default) or parts (each link its own colour), each at its own defaults; --grid draws the measuring grid under the robot, and --preview draws Preview's shared photographic scene instead, in perspective. Inline display JSON and JSON files are the Viewer's display object: mode, grid, appearance (light, the default, or dark), camera (projection and focal length) and clip. Top-level --camera and --joint-values remain active in every display mode. display.clip cuts the robot as the viewer's Clip does ({"clip":{"axis":"x","at":0.05}}, at in metres); exploded, and shaded, xray, hidden-line and wireframe, describe a STEP model's CAD edges and parts, and are refused by name here. A Quick Edit job from the viewer replays as it is: its jointValues, its selection.hide (the parts hidden in the Links panel, by their ids), its clip and annotation (cadgen snapshot --job <file>). Quick Edit supplies inline JSON or a .snapshot.json path; save inline JSON to a temporary file before using --job. Inspect supplied annotations before editing. Without annotations, the captured view is optional context; render it when useful to the request.

Link meshes are resolved relative to the description, so they must be present: an unhydrated Git LFS pointer fails as "No link mesh loaded for robot". Run git lfs checkout <mesh dir> first.

The grammar is cadgen sdf snapshot TARGET [OUT] [flags], the same one every format door uses. Use cadgen sdf snapshot --help for the complete current interface — the flags a robot cannot act on are absent from it, not refused by it.

References

  • SDF workflow: references/sdf-workflow.md
  • Worked examples (golden skeletons): references/examples.md
  • LLM guardrails: references/llm-guardrails.md
  • Design ledger: references/design-ledger.md
  • Frame semantics: references/frame-semantics.md
  • Validation scope: references/validation.md
  • Smoke tests: references/smoke-tests.md
  • Interoperability notes (URDF-derived SDF, meshes, Gazebo): references/interoperability.md

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Prepare files for printing on Bambu Lab printers by opening sliced files in Bambu Connect or unsliced models in Bambu Studio. The user selects the printer, checks the setup, and starts printing in the app.

中文简介正在准备中。当前显示英语简介。

  • Open a sliced file in Bambu Connect
  • Open an unsliced model in Bambu Studio
  • Prepare printing through Bambu Cloud or LAN
earthtojake/text-to-cad2.3万2026年10月22日 更新

cad

免费

Create and edit 3D parts and assemblies with adjustable dimensions using cadgen. Export STEP, STL, 3MF, or GLB files, inspect geometry, and open existing models in CAD Viewer for visual review.

中文简介正在准备中。当前显示英语简介。

  • Create a part from specified dimensions or a drawing
  • Revise part dimensions and assembly placements
  • Export models as STEP, STL, 3MF, or GLB
earthtojake/text-to-cad2.3万2026年10月22日 更新

Check mesh files for 3D printing by measuring geometry and comparing it with process-specific design limits. Get findings on wall thickness, overhangs, and supports, plus build orientation options and concrete redesign guidance.

中文简介正在准备中。当前显示英语简介。

  • Check whether a mesh meets printing design limits
  • Find thin walls and unsupported overhangs
  • Compare build orientations to reduce supports
earthtojake/text-to-cad2.3万2026年10月22日 更新

dfm

免费

Review part designs for sheet metal, CNC machining, or injection molding. Compare geometry measurements with applicable supplier or tooling limits, then document manufacturing concerns, suggested changes, and checks that still need evidence.

中文简介正在准备中。当前显示英语简介。

  • Review sheet metal bends and flat patterns
  • Check CNC tool access and internal corners
  • Review molding draft and undercuts
earthtojake/text-to-cad2.3万2026年10月22日 更新

dxf

免费

Create and update 2D DXF drawings from written requirements or CAD geometry using Python and build123d. Prepare cutting profiles and marking layers, check for open contours and duplicate geometry, and review drawings in CAD Viewer.

中文简介正在准备中。当前显示英语简介。

  • Create dimensioned gasket or panel drawings
  • Generate flat profiles from STEP geometry
  • Separate cutting and engraving geometry into layers
earthtojake/text-to-cad2.3万2026年10月22日 更新

Create a manufacturing drawing PDF from a part’s 3D geometry, with projected views, measured dimensions, hole callouts, and a title block. Rerun the drawing script after model changes to update the sheet.

中文简介正在准备中。当前显示英语简介。

  • Prepare a dimensioned drawing for manufacturing
  • Document hole sizes and machining requirements
  • Update drawings after changing a part model
earthtojake/text-to-cad2.3万2026年10月22日 更新

查看 earthtojake 的全部技能

报告此技能的问题