kicad-mcp/mckicad/utils/component_layout.py
Ryan Malloy 687e14bd11 Rename project from kicad-mcp to mckicad
Rename source directory kicad_mcp/ → mckicad/, update all imports,
pyproject.toml metadata, documentation references, Makefile targets,
and .gitignore paths. All 195 tests pass.
2026-02-13 00:53:59 -07:00

36 lines
956 B
Python

"""
Component layout management for KiCad schematics.
Stub implementation to fix import issues.
"""
from dataclasses import dataclass
@dataclass
class SchematicBounds:
"""Represents the bounds of a schematic area."""
x_min: float
x_max: float
y_min: float
y_max: float
def contains_point(self, x: float, y: float) -> bool:
"""Check if a point is within the bounds."""
return self.x_min <= x <= self.x_max and self.y_min <= y <= self.y_max
class ComponentLayoutManager:
"""Manages component layout in schematic."""
def __init__(self):
self.bounds = SchematicBounds(-1000, 1000, -1000, 1000)
def get_bounds(self) -> SchematicBounds:
"""Get the schematic bounds."""
return self.bounds
def validate_placement(self, x: float, y: float) -> bool:
"""Validate if a component can be placed at the given coordinates."""
return self.bounds.contains_point(x, y)