Files
autocad-mcp-pro/backends/contracts/dimensions.py
T
grigory 2e2a2b96a9 ours: наш оверлей к апстриму 1.5.1 (дельта для переноса в 1.6.0)
10 изменённых файлов + 2 новых (engineering/gost_titleblock.py, _fonts/isocpeur.ttf).
Ветка-донор для трёхстороннего переноса в ours-1.6.
2026-10-05 18:04:55 +03:00

95 lines
2.3 KiB
Python

"""ISO 129 dimensions.
Split out of the single 1854-line ``AutoCADBackend`` ABC in v1.5.0 (M7).
``AutoCADBackend`` composes every contract in this package, so importing
``backends.base.AutoCADBackend`` is unchanged for callers.
"""
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from backends.base import EntityInfo
class DimensionContract(ABC):
@abstractmethod
async def dimension_linear(
self,
x1: float,
y1: float,
x2: float,
y2: float,
dim_x: float,
dim_y: float,
rotation: float = 0.0,
layer: str | None = None,
tol_upper: float | None = None,
tol_lower: float | None = None,
tol_mode: str = "none",
text_override: str | None = None,
layout: str | None = None,
) -> EntityInfo: ...
@abstractmethod
async def dimension_aligned(
self,
x1: float,
y1: float,
x2: float,
y2: float,
dim_x: float,
dim_y: float,
layer: str | None = None,
layout: str | None = None,
) -> EntityInfo: ...
@abstractmethod
async def dimension_angular(
self,
vx: float,
vy: float,
x1: float,
y1: float,
x2: float,
y2: float,
tx: float,
ty: float,
layer: str | None = None,
layout: str | None = None,
) -> EntityInfo: ...
@abstractmethod
async def dimension_radius(
self,
cx: float,
cy: float,
chord_x: float,
chord_y: float,
leader_length: float = 10.0,
layer: str | None = None,
tol_upper: float | None = None,
tol_lower: float | None = None,
tol_mode: str = "none",
text_override: str | None = None,
layout: str | None = None,
) -> EntityInfo: ...
@abstractmethod
async def dimension_diameter(
self,
x1: float,
y1: float,
x2: float,
y2: float,
leader_length: float = 10.0,
layer: str | None = None,
tol_upper: float | None = None,
tol_lower: float | None = None,
tol_mode: str = "none",
text_override: str | None = None,
layout: str | None = None,
) -> EntityInfo: ...