WC

wyuebei-cloud/detail-to-lsp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

4 stars Качество 59 Тренд 20NOASSERTION

Rebuild a CAD detail from a PDF or screenshot as a generated AutoLISP script, gated by a LISP simulator before delivery.

Обзор

Rebuild an engineering/CAD detail shown in a PDF sheet or a screenshot as a single AutoLISP file that draws it 1:1 in model space - geometry, text, leaders, symbols and real DIMENSION objects on separate layers. The skill is meant to be executed by an AI coding agent: one Python model per detail, a fixed pre-verified LISP runtime, and numeric gates that must pass before anything is delivered. - Python 3.9 or newer. - pip install -r requirements.txt for intake and the overlay. The generation and verification chain itself (detail_model.py, emit_lsp.py, check_lsp.py, lisp_sim.py) is standard library only. - AutoCAD or Civil 3D . The generated runtime drives dimension styles and DIMENSION objects through ActiveX, which is Windows only. AutoCAD LT 2024 or newer is expected to work (LT 2024 added AutoLISP and supports most VLA/VLAX functions) but has not been tested. AutoCAD for Mac is not supported. - An agent with capability.

README

Показан фрагмент оригинального README. Открыть оригинал.

detail-to-lsp

Rebuild an engineering/CAD detail shown in a PDF sheet or a screenshot as a single AutoLISP file that draws it 1:1 in model space - geometry, text, leaders, symbols and real DIMENSION objects on separate layers.

The skill is meant to be executed by an AI coding agent: one Python model per detail, a fixed pre-verified LISP runtime, and numeric gates that must pass before anything is delivered.

source --probe--> extract/measure --calibrate--> model.py (Detail API)
   --> emit .lsp + report --> check_lsp (parens, lint, simulation) --> overlay + coverage
   --> fix model.py --> repeat --> deliver

Requirements

  • Python 3.9 or newer.
  • pip install -r requirements.txt for intake and the overlay. The generation and verification chain itself (detail_model.py, emit_lsp.py, check_lsp.py, lisp_sim.py) is standard library only.
  • AutoCAD or Civil 3D on Windows. The generated runtime drives dimension styles and DIMENSION objects through ActiveX, which is Windows only. AutoCAD LT 2024 or newer is expected to work (LT 2024 added AutoLISP and supports most VLA/VLAX functions) but has not been tested. AutoCAD for Mac is not supported.
  • An agent with vision capability. Phase 0 locates the detail in a rendered page, Phase 4 accepts the overlay by eye, and text drawn as glyph outlines or on a scanned sheet can only be read from the image. Coordinates never come from looking - they come from raster_measure.py and calibrate.py.

Quick start

pip install -r requirements.txt
python scripts/probe.py sheet.pdf --render page.png      # VECTOR / RASTER / MIXED
python tests/run_tests.py                                # both reference cases

SKILL.md is the operating procedure. references/ holds the model API and the vector and raster playbooks; references/autocad_notes.md lists what the generated file does and what cannot be verified outside AutoCAD.

How it works

  • One model.py per detail is the only place a coordinate exists. It records every key value with provenance (dim, derived, vector, measured, standard, assumed) and every dimension gets the source text it must reproduce (expect=).
  • emit_lsp.py writes a self-contained .lsp: identical runtime + one record list + one c: command. Pure ASCII, CRLF, real-valued group codes.
  • check_lsp.py is the delivery gate. It balances parentheses, lints, then executes the whole file in lisp_sim.py (an AutoLISP subset against an AutoCAD stub). Every entmake is validated against DXF group-code rules, so unknown functions, arity errors, missing text styles or linetypes and bad setvar calls fail before delivery. For files built on the runtime, the simulated run must also close at
Открыть полный README на GitHub

Рекомендуемые инструменты

Попробуйте другой запрос или уберите фильтр.

Установка

npx skillfish add wyuebei-cloud/detail-to-lsp
Новичок в MCP? Начните с руководства на mcpskill.org →