Introduces an engineering/ package that lets MCP clients produce production- quality technical drawings without LLM-improvised geometry. Adds 7 new MCP tools, an 8-step pre-completion validator, and an automatic linetype + layer bootstrap on drawing_new so CENTER/HIDDEN/PHANTOM and standard mechanical layers (GEOMETRY, DIM, HATCH, TEXT, TITLEBLOCK, ...) are always available. - engineering/gear.py: pure-Python involute math, 40+ points/flank, helical + spur front views, deterministic section A-A (no helix lines in section). - engineering/keyway.py: DIN 6885 keyway table + parametric keyed bore / side-section drawers. - engineering/titleblock.py: ISO 7200 A3 (420x297 mm) title block; title text is written verbatim to the title cell. - engineering/validator.py: DrawingValidator with 8 checks (real DIMENSION entities, no hidden orphans, linetypes loaded, bore + keyway in both views when expected, title consistency e.g. forbid 'HELICAL SPUR GEAR' when helix_angle truthy, saved-to-disk + file-on-disk, screenshot exported, dwg path returned). - backends/ezdxf_backend.py: AutoCAD-only linetype fallback (HIDDEN, BORDER families) so ezdxf doc gets correct patterns when linetype_load is called for names ezdxf.tools.standards does not ship. - backends/base.py: concrete helpers set_layer_active / ensure_linetypes. - server.py: Section 12 with 7 engineering tools, drawing_new(bootstrap= True), and an ENGINEERING WORKFLOW block in the MCP instructions string. - 30 new tests covering gear math, DIN6885 lookup, ISO A3 layout, title verbatim, and every validator check. Tool count 89 -> 96.
66 lines
1.9 KiB
Python
66 lines
1.9 KiB
Python
"""Deterministic engineering CAD layer for AutoCAD MCP Pro."""
|
|
|
|
from .gear import (
|
|
draw_gear_section_aa,
|
|
draw_helical_gear_front_view,
|
|
draw_spur_gear_front_view,
|
|
generate_full_gear_outline,
|
|
generate_involute_flank,
|
|
generate_tooth_profile,
|
|
involute_xy,
|
|
)
|
|
from .keyway import (
|
|
DIN6885_TABLE,
|
|
draw_keyed_bore,
|
|
draw_keyway_section,
|
|
keyway_dimensions,
|
|
)
|
|
from .layers import (
|
|
ENGINEERING_LAYERS,
|
|
STANDARD_LINETYPES,
|
|
ensure_engineering_layers,
|
|
ensure_standard_linetypes,
|
|
)
|
|
from .section import apply_section_hatch, cutting_plane_line
|
|
|
|
# Agent B contributes titleblock + validator. Imports are guarded so this
|
|
# package remains usable while B is still in flight; once those modules land
|
|
# the symbols flow through transparently.
|
|
try:
|
|
from .titleblock import TitleBlockMetadata, apply_iso_a3_titleblock
|
|
except ImportError:
|
|
TitleBlockMetadata = None # type: ignore[assignment]
|
|
apply_iso_a3_titleblock = None # type: ignore[assignment]
|
|
|
|
try:
|
|
from .validator import DrawingValidator, ValidationFinding, ValidationResult
|
|
except ImportError:
|
|
DrawingValidator = None # type: ignore[assignment]
|
|
ValidationFinding = None # type: ignore[assignment]
|
|
ValidationResult = None # type: ignore[assignment]
|
|
|
|
__all__ = [
|
|
"draw_helical_gear_front_view",
|
|
"draw_spur_gear_front_view",
|
|
"draw_gear_section_aa",
|
|
"generate_full_gear_outline",
|
|
"generate_involute_flank",
|
|
"generate_tooth_profile",
|
|
"involute_xy",
|
|
"draw_keyed_bore",
|
|
"draw_keyway_section",
|
|
"keyway_dimensions",
|
|
"DIN6885_TABLE",
|
|
"cutting_plane_line",
|
|
"apply_section_hatch",
|
|
"ENGINEERING_LAYERS",
|
|
"STANDARD_LINETYPES",
|
|
"ensure_engineering_layers",
|
|
"ensure_standard_linetypes",
|
|
"apply_iso_a3_titleblock",
|
|
"TitleBlockMetadata",
|
|
"DrawingValidator",
|
|
"ValidationResult",
|
|
"ValidationFinding",
|
|
]
|