Skip to content

Commit

Permalink
Introduce v7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqwsx committed Dec 22, 2022
1 parent 942566e commit 0aaf08e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pcbdraw/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def remove_inkscape_annotation(tree: etree.Element) -> None:
@dataclass
class Hole:
position: Tuple[int, int]
orientation: int
orientation: pcbnew.EDA_ANGLE
drillsize: Tuple[int, int]

def get_svg_path_d(self, ki2svg: Callable[[int], float]) -> str:
Expand Down Expand Up @@ -588,7 +588,7 @@ def collect_holes(board: pcbnew.BOARD) -> List[Hole]:
pos = track.GetPosition()
holes.append(Hole(
position=(pos[0], pos[1]),
orientation=0,
orientation=pcbnew.EDA_ANGLE(0, pcbnew.DEGREES_T),
drillsize=(track.GetDrillValue(), track.GetDrillValue())
))
return holes
Expand Down Expand Up @@ -678,7 +678,7 @@ def _process_outline(self, name: str, source_filename: str) -> None:
el = etree.SubElement(layer, "path")
el.attrib["d"] = hole.get_svg_path_d(self._plotter.ki2svg)
el.attrib["transform"] = "translate({} {}) rotate({})".format(
position[0], position[1], -hole.orientation / 10)
position[0], position[1], -hole.orientation.AsDegrees())

def _process_baselayer(self, name: str, source_filename: str) -> None:
clipPath = self._plotter.get_def_slot(tag_name="clipPath", id="cut-off")
Expand Down Expand Up @@ -749,7 +749,7 @@ def _build_hole_mask(self) -> None:
el.attrib["stroke-width"] = str(stroke)
el.attrib["points"] = points
el.attrib["transform"] = "translate({} {}) rotate({})".format(
position[0], position[1], -hole.orientation / 10)
position[0], position[1], -hole.orientation.AsDegrees())

@dataclass
class PlacedComponentInfo:
Expand Down Expand Up @@ -1068,7 +1068,7 @@ def walk_components(self, invert_side: bool,
value = footprint.GetValue().strip()
ref = footprint.GetReference().strip()
center = footprint.GetPosition()
orient = math.radians(footprint.GetOrientation() / 10)
orient = math.radians(footprint.GetOrientation().AsDegrees())
pos = (center.x, center.y, orient)
callback(lib, name, ref, value, pos)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"pybars3",
"pyyaml",
"svgpathtools==1.4.1",
"pcbnewTransition>=0.2",
"pcbnewTransition==0.3.0",
"LnkParse3; platform_system=='Windows'",
"pyVirtualDisplay~=3.0; platform_system!='Windows'",
"Pillow~=9.0",
Expand Down

0 comments on commit 0aaf08e

Please sign in to comment.