Chuyển đến nội dung
Skillpedia
PDF, Word và slide25k · #10071

engineering-drawing

Skill này làm gì

Skill này tạo một tờ bản vẽ PDF có kích thước cho một chi tiết, gồm các hình chiếu và ghi chú. Skill dành cho kỹ sư và người làm cần bản vẽ gia công hoặc sản xuất.

Khi nào nên dùng

  • ✓Khi bạn yêu cầu một bản vẽ hoặc bản in có kích thước của một chi tiết.
  • ✓Khi xưởng cần một file PDF có hình chiếu, kích thước và khung tên.
  • ✓Khi bạn muốn các hình chiếu 2D của mô hình 3D kèm đường khuất và ghi chú lỗ.

Liên kết skill

https://github.com/earthtojake/text-to-cad/blob/main/skills/engineering-drawing/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/earthtojake/text-to-cad/blob/main/skills/engineering-drawing/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể làm một bản vẽ kỹ thuật PDF của chi tiết này với kích thước và khung tên không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI viết một script chiếu các hình từ hình học của chi tiết và đặt kích thước lên đó. Khi mô hình thay đổi, chạy lại script sẽ cập nhật bản vẽ.

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.

Engineering drawing

An engineering drawing is a DOCUMENT derived from a part. cad.eng_drawing projects views from the part's geometry, places dimensions between points ON that geometry, finds centre marks on it, and lays the result out on an ISO sheet with a frame and a title block. Change the model, rerun the drawing script, and the views, hidden lines and measured values move with it. Nothing on the sheet is drawn by hand, and nothing on it is a number you typed unless you chose to override a value.

The output is one PDF. That is what a shop receives and what every operating system opens. No DXF is written, nothing is paired or linked, and there is no CLI: the script is the interface. Cut layouts and flat patterns are toolpaths, not documents, and a different job.

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.

Workflow

  1. Get the part. Call the model: enclosure(), imported from the model's script, is built by text-to-cad's server (a replay when the server already holds it), and its .shape is the part. For a part with no model, read its file: read_step for a STEP, read_xbf for an xbf, anchored on Path(__file__).parent. Any build123d shape works. The drawing documents geometry, it does not build it.

  2. Write <name>_drawing.py beside the model, from the template. Import the model facts the dimensions reference (hole pitch, overall size, wall) from the model module rather than retyping them, so moving a feature moves its dimension.

  3. Place views with sheet.three_views(part, iso=True), which returns FOUR views: top, front and right in third angle with room for two rows of dimensions, plus an isometric in the free corner. sheet.three_views(part) returns three. Use sheet.view(part, name, at=(x, y)) (sheet millimetres from the bottom-left corner; A3 is 420 × 297, A4 is 297 × 210) only for a custom layout.

  4. Dimension what a maker needs, in MODEL coordinates: overall size per view (view.overall()), feature positions and sizes (view.dim, with tol= or fit= where the design requires one), holes as callouts (view.hole: thru, depth, counterbore, countersink, thread), and notes with leaders (view.note). Leave text unset so the dimension is measured; give a value only where the model does not define it. Leave offset unset too and the dimension takes the next free row outside the view; pass one only to place a dimension deliberately, and remember it is measured from the dimension's own points, not the view's edge. Keep notes few and short; one wider than the sheet's note column is refused, and notes= takes a LIST (notes="BREAK EDGES" is a sequence of eleven characters, so it is refused too).

  5. Run cad run <name>_drawing.py. It prints the PDF it wrote, and anything it noticed while drawing — read those first:

    • "measures blank paper": the dimension's model points do not land on the view's geometry. Almost always the part was built from a corner and the script assumed it was centred. Check the part's bounding box.
    • "annotation overlaps": two callouts print on top of each other, usually one view's outermost dimension against the label of the view above it. Pass a bigger three_views(gap=...) or place one with offset=. The text is measured as the renderer draws it, glyph by glyph, so this fires on ink and not on markup: a chain of toleranced dimensions is silent when the values clear each other.

    Steps 3 and 5 stand on their own: a sheet of views with no dimensions on it yet is a drawing, and writes its PDF.

    When running unattended, set MPLCONFIGDIR to a writable directory so matplotlib's font cache does not warn.

  6. Read the PDF and fix what collides. Check that no dimension text sits on a view, that hidden

Câu hỏi thường gặp

Nó có tạo file DXF không?

Không. Kết quả là một tờ bản vẽ PDF duy nhất.

Kích thước có lấy từ mô hình không?

Có. Các hình chiếu và giá trị đo được lấy từ hình học của chi tiết, không phải số gõ tay.

Tôi có dùng nó để cắt laser được không?

Không. Bố cục cắt là việc khác, nên hãy dùng skill DXF cho việc đó.

Chi tiết

Mô tả gốc của tác giả

Make an engineering drawing of a part as a PDF - orthographic views with hidden lines and centre marks, real dimensions, hole callouts, notes and a title block on ISO sheets, all projected from the part's geometry so the drawing follows the model. Use when the user asks for a drawing, a dimensioned sheet, shop or manufacturing drawings, a print, or "2D views of this part". Not for DXF cut layouts or flat patterns.

repo: earthtojake/text-to-cad

Độ phổ biến

Sao GitHub
25k
Vị trí xếp hạng
#10071
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự