Rename source directory kicad_mcp/ → mckicad/, update all imports, pyproject.toml metadata, documentation references, Makefile targets, and .gitignore paths. All 195 tests pass.
29 lines
824 B
Python
29 lines
824 B
Python
"""
|
|
Coordinate conversion utilities for KiCad.
|
|
|
|
Stub implementation to fix import issues.
|
|
"""
|
|
|
|
|
|
|
|
class CoordinateConverter:
|
|
"""Converts between different coordinate systems in KiCad."""
|
|
|
|
def __init__(self):
|
|
self.scale_factor = 1.0
|
|
|
|
def to_kicad_units(self, mm: float) -> float:
|
|
"""Convert millimeters to KiCad internal units."""
|
|
return mm * 1e6 # KiCad uses nanometers internally
|
|
|
|
def from_kicad_units(self, units: float) -> float:
|
|
"""Convert KiCad internal units to millimeters."""
|
|
return units / 1e6
|
|
|
|
|
|
def validate_position(x: float | int, y: float | int) -> bool:
|
|
"""Validate if a position is within reasonable bounds."""
|
|
# Basic validation - positions should be reasonable
|
|
max_coord = 1000 # mm
|
|
return abs(x) <= max_coord and abs(y) <= max_coord
|