- Implement 3D model analysis and mechanical constraints checking - Add advanced DRC rule customization for HDI, RF, and automotive applications - Create symbol library management with analysis and validation tools - Implement PCB layer stack-up analysis with impedance calculations - Fix Context parameter validation errors causing client failures - Add enhanced tool annotations with examples for better LLM compatibility - Include comprehensive test coverage improvements (22.21% coverage) - Add CLAUDE.md documentation for development guidance New Advanced Tools: • 3D model analysis: analyze_3d_models, check_mechanical_constraints • Advanced DRC: create_drc_rule_set, analyze_pcb_drc_violations • Symbol management: analyze_symbol_library, validate_symbol_library • Layer analysis: analyze_pcb_stackup, calculate_trace_impedance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
879 B
Python
29 lines
879 B
Python
"""
|
|
Coordinate conversion utilities for KiCad.
|
|
|
|
Stub implementation to fix import issues.
|
|
"""
|
|
|
|
from typing import Tuple, Union
|
|
|
|
|
|
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: Union[float, int], y: Union[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 |