sdf
Skill này làm gì
Skill này hướng dẫn AI của bạn viết và xác thực file SDF, định dạng XML cho mô hình và thế giới của trình mô phỏng. Skill dành cho kỹ sư robot và mô phỏng.
Khi nào nên dùng
- ✓Khi bạn cần tạo hoặc chỉnh sửa một file mô hình hoặc thế giới SDF.
- ✓Khi bạn muốn kiểm tra một file mô phỏng có lỗi về liên kết, khớp nối, cảm biến hoặc vật lý không.
- ✓Khi bạn cần xem lại một file SDF có sẵn trước khi giao cho trình mô phỏng.
Liên kết skill
https://github.com/earthtojake/text-to-cad/blob/main/skills/sdf/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể viết một file SDF cho robot hai bánh có cảm biến lidar và kiểm tra xem nó có hợp lệ không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI viết trực tiếp XML, rồi chạy một lệnh kiểm tra để xác nhận file đúng trước khi công việc được coi là xong.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
SDF
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.
Setup
Run the cad command (~/.local/bin/cad where ~/.local/bin is not on your PATH, or where a
project's environment puts its own cad first; cad.cmd on Windows). If cad is not found and
the CAD app was only just added, its server may still be starting: wait five seconds and run the
command again, for up to a minute, before anything else. Otherwise install text-to-cad, outside a sandbox or with its permission:
curl -fsSL https://texttocad.dev/install.sh | sh
On Windows, in PowerShell: irm https://www.texttocad.dev/install.ps1 | iex. Any other failure
says what to do, and cad doctor explains the installation.
Core rules
- Author
.sdfXML directly and validate every created or modified file withcad sdf validatebefore reporting completion. - Identify the target consumer before editing: Gazebo/libsdformat version, another simulator, visualization-only tooling, model package, or world handoff.
- Decide document kind: model-level SDF, world-level SDF, or model-in-world. Prefer model-level SDF for reusable robot/object exports.
- Use SI units unless the target explicitly requires otherwise: meters, kilograms, seconds, radians.
- Prefer
version="1.12"for new outputs unless the target consumer constrains the version. - 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. Usereferences/design-ledger.mdandreferences/llm-guardrails.md. - Write
relative_to/expressed_inexplicitly on every nontrivial pose and axis. Implicit frame defaults are the top SDF failure mode. Seereferences/frame-semantics.md. - 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).
- When the robot already has a URDF, derive the SDF from it instead of re-authoring geometry; see
references/interoperability.md. - Regenerate upstream geometry, mesh, robot-description, render, topology, or package assets with their owning workflows before editing SDF that references them.
- After authoring, run available checks: bundled validation (which runs
gz sdf --checkitself whenevergzis on PATH), simulator load, joint motion, and plugin/sensor startup. - 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 model you create or change, and any model or file they ask to see.
A file you export is a download: give its path, do not open it.
Snapshots and validation don't replace this. Never screenshot the viewer to confirm your
own work; review with cad snapshot.
- If your tools include
cad_show(your host may prefix it), call it with the model's id or the file's absolute path, and follow its description for when to call it again. The other tools depend on the host. A host that draws CAD cards or tabs (Claude Desktop, the Codex app) also hascad_view, which reads what the user selected, andcad_screenshot, which shows you what they see, both of a card or tab that is open, for when they ask about it. A text host (Claude Code in a terminal,codex exec) draws nothing: itscad_showopens the model's page in the user's browser and answers with the URL to give them, and it has no view to read.cad_inspect,cad_snapshotandcad_exportare on every host. Call only the tools you have, and never say a card shows a model when your host drew none. - Otherwise give the user the page's link once: a model's page is the
view:line its run prints
Câu hỏi thường gặp
SDFormat là gì?
Đó là định dạng XML mà các trình mô phỏng như Gazebo dùng để mô tả mô hình và thế giới.
Đây có phải về hình khối 3D đặc không?
Không. Hình học signed-distance-field không nằm trong phạm vi. Skill này nói về định dạng của trình mô phỏng.
Kiểm tra có chạy mô phỏng không?
Không. Nó kiểm tra chính file, nên bạn vẫn nên thử nó trong trình mô phỏng.
Chi tiết
Mô tả gốc của tác giả
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.
repo: earthtojake/text-to-cad
Độ phổ biến
- Sao GitHub
- 25k
- Vị trí xếp hạng
- #10073
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
bambu-labs
25kGiúp agent của bạn gửi một mô hình 3D đã cắt lớp hoặc chưa cắt lớp đến máy in Bambu Lab qua Bambu Connect hoặc Bambu Studio.
cad
25kGiúp agent của bạn thiết kế chi tiết và cụm lắp 3D dưới dạng script Python build123d, xuất ra file STEP hoặc STL và kiểm tra kích thước của chúng.
dfam-check
25kGiúp agent của bạn kiểm tra xem một file lưới 3D có thể in tốt không, báo cáo phần nhô ra, độ dày thành và nhu cầu hỗ trợ.
dfm
25kGiúp agent của bạn review một chi tiết để gia công tấm kim loại, CNC hoặc ép khuôn, kiểm tra xem nó có thể chế tạo được không và cần sửa gì.
Skill tương tự
blucli
394kGiúp agent của bạn tìm, phát, tạm dừng, nhóm và chỉnh âm lượng loa Bluesound và NAD qua lệnh blu.
camsnap
394kGiúp agent của bạn chụp ảnh, quay clip ngắn hoặc lấy sự kiện chuyển động từ camera mạng và webcam nội bộ mà bạn đã thiết lập.
eightctl
394kGiúp agent của bạn kiểm tra và điều khiển thiết bị Eight Sleep pod, gồm nhiệt độ, báo thức và lịch ngủ.