Drawmath

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 7, 2026

Metric-imperial conversion for technical drawings: dimensions, tolerances, threads, roughness.

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

在本機把技術圖面上的公制與英制數值(尺寸、公差、螺紋、粗糙度、重量)互相換算,不需連網。

可以做什麼
  • 換算單一工程數值的公制與英制,可指定類型與方向,回傳精確值、顯示值、推導方式與信心分數
  • 換算整段標註字串,保留符號、配合等級與倍數,角度維持不變
  • 查詢 ISO 公制螺紋最接近的 UNC 對應規格,或不帶參數回傳完整 M2–M30 對照表
適用情境
適合閱讀或標註公制與英制混用的機械圖面,希望依現場慣例取整並一致處理配合等級與螺紋對照時使用。此版本不含 PDF 圖面擷取功能,需要該功能時並不適用。
執行需求
以本機程序執行,可透過 npx(需 Node.js)或已發布的 Docker 映像啟動;不需帳號、API 金鑰或環境變數,執行時不需網路。
安裝前請注意
螺紋對應僅為最接近的標準規格,並非可互換件,每個螺紋結果都會明確說明,選用五金件前請自行確認。參數結構為標示的重建版本,原版的 PDF 文字擷取與圖面轉換工具在此版本中缺席。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Drawmath,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

drawmath

Metric and imperial values on a technical drawing, converted with the factors and rounding a shop actually uses — locally, with no network call and nothing to configure.

Give drawmath one value, one printed callout, or one thread designation and it answers in the other system: lengths and GD&T values, ± tolerances, diameters with their fit class, surface roughness, weights and threads. Each answer carries the exact converted value alongside the rounded display value, says how it was derived (exact, rounded, table or nearest), and gives a confidence score.

Precision

  • Factors are the international definitions: 25.4 mm per inch and 0.45359237 kg per pound.
  • Display values follow shop-floor convention: a 0.01 mm step becomes a 4-decimal inch value.
  • Worked examples: 84±0.1 mm becomes 3.3071±0.0039 in, Ø30 H7 becomes Ø1.1811 H7, Ø40 H7 becomes Ø1.5748 H7, and Ra 1.6 µm becomes Ra 63 µin.
  • Threads are matched against a metric/UNC chart covering M2–M30, snapped by major diameter when there is no exact counterpart: M8 becomes 5/16-18 UNC, M6 becomes 1/4-20 UNC, and 1/4-20 UNC becomes M6. A matched thread is a nearest standard, never an interchangeable one — every thread result says so explicitly.

Tools

This is a labelled subset of the original five-tool surface. Three tools are built:

  • convert_value — one value: value (for example "84±0.1 mm", "Ø30 H7", "Ra 1.6", "2.5 kg" or "M8"), with an optional kind (length, tolerance, gdt, roughness, weight, thread or auto) and an optional direction (metric_to_imperial, imperial_to_metric or auto). The result JSON gives exact and display values, the derivation method and a confidence score.
  • convert_text — a whole callout string: text, with an optional direction. Notation is preserved — symbols, fit classes and multipliers stay where they were — and angles are left untouched.
  • lookup_thread — a thread cross-reference: give a designation such as "M8" or "1/4-20 UNC" for its chart row and nearest counterpart in the other system, or omit it for the full M2–M30 chart.

Two original tools are omitted from this subset: extract_drawing_text and convert_drawing_pdf. They depend on a PDF text-extraction and stamping engine that cannot be reproduced from the published specification, and this build carries no PDF library. The original's convert-drawing prompt is likewise out of scope, as prompts sit outside this program's tool parity scope.

Argument shapes are labelled reconstructions: the published material pins behaviour and worked examples, not parameter tables, so each tool takes the primary string its behaviour implies plus the optional direction or kind that behaviour calls for.

CLI

bash
npx @reneturcios/drawmath convert_value '{"value":"84±0.1 mm"}'npx @reneturcios/drawmath convert_text '{"text":"Ø30 H7"}'npx @reneturcios/drawmath lookup_thread '{"designation":"M8"}'npx @reneturcios/drawmath lookup_thread '{}'npx @reneturcios/drawmath --version

Exit codes: 0 on success, 1 on a runtime error, 2 on a usage error.

MCP server

bash
npx -y @reneturcios/drawmath mcp

MCP client config:

json
{  "mcpServers": {    "drawmath": {      "command": "npx",      "args": ["-y", "@reneturcios/drawmath", "mcp"]    }  }}

Docker

bash
docker run -i ghcr.io/cloudcorprecords/drawmathdocker run --rm ghcr.io/cloudcorprecords/drawmath convert_text '{"text":"M8"}'

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (fixture arithmetic only, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

來源:README.md,提交 c0ff798

工具

3

convert_value

Convert one engineering value between metric and imperial: length, tolerance, GD&T, surface roughness, weight, or thread designation. Returns exact and display values, derivation method and confidence.

輸入參數kindvalue必填direction

convert_text

Convert a printed callout string between metric and imperial, preserving notation. Angles stay untouched.

輸入參數text必填direction

lookup_thread

Cross-reference an ISO metric thread with its nearest Unified (UNC) counterpart, or return the full M2-M30 chart when no designation is given.

輸入參數designation

版本歷史

1
  1. v0.1.0最新Nov 4, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分