From 772cdf48106de837dd625a9f709669a2a53947d5 Mon Sep 17 00:00:00 2001 From: Koutaro Mukai Date: Thu, 20 Jun 2024 23:57:30 +0900 Subject: [PATCH] Fix rectangle transformation --- easyeda2kicad/easyeda/parameters_easyeda.py | 5 +++-- easyeda2kicad/kicad/export_kicad_footprint.py | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/easyeda2kicad/easyeda/parameters_easyeda.py b/easyeda2kicad/easyeda/parameters_easyeda.py index cfc5d20..8db4730 100644 --- a/easyeda2kicad/easyeda/parameters_easyeda.py +++ b/easyeda2kicad/easyeda/parameters_easyeda.py @@ -443,10 +443,10 @@ class EeFootprintRectangle(BaseModel): y: float width: float height: float - stroke_width: float - id: str layer_id: int + id: str is_locked: bool + stroke_width: float @field_validator("is_locked", mode="before") @classmethod @@ -458,6 +458,7 @@ def convert_to_mm(self): self.y = convert_to_mm(self.y) self.width = convert_to_mm(self.width) self.height = convert_to_mm(self.height) + self.stroke_width = convert_to_mm(self.stroke_width) class EeFootprintArc(BaseModel): diff --git a/easyeda2kicad/kicad/export_kicad_footprint.py b/easyeda2kicad/kicad/export_kicad_footprint.py index 96dae0f..3c957a3 100644 --- a/easyeda2kicad/kicad/export_kicad_footprint.py +++ b/easyeda2kicad/kicad/export_kicad_footprint.py @@ -367,7 +367,12 @@ def generate_kicad_footprint(self) -> None: start_x + width, start_x, ] - ki_rectangle.points_start_y = [start_y, start_y, start_y + height, start_y] + ki_rectangle.points_start_y = [ + start_y, + start_y, + start_y + height, + start_y + height, + ] ki_rectangle.points_end_x = [ start_x + width, start_x + width,