Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Bug: kicad: transformer: round_corners is broken #22

Open
1 task done
ruben-iteng opened this issue Aug 24, 2024 · 0 comments
Open
1 task done

Bug: kicad: transformer: round_corners is broken #22

ruben-iteng opened this issue Aug 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ruben-iteng
Copy link
Collaborator

Current Behaviour

def round_corners(
self, geometry: Sequence[Geom], corner_radius_mm: float
) -> list[Geom]:
"""
Round the corners of a geometry by replacing line pairs with arcs.
"""
def _transform(geo1: Geom, geo2: Geom) -> Iterable[Geom]:
if not isinstance(geo1, Line) or not isinstance(geo2, Line):
return (geo1,)
new_line1, arc, new_line2 = self.connect_line_pair_via_radius(
geo1,
geo2,
corner_radius_mm,
)
return new_line1, new_line2, arc
return [
t_geo
for pair in pairwise(list(geometry) + [geometry[0]])
for t_geo in _transform(*pair)
]

produces unusable output:
image

Expected Behaviour

_transform function should use previous generated lines as input lines for next iteration.

lineA-lineB > _transform > lineAarced-arc-lineBarced
lineBarced-lineC > _transform ...

So the result will look like this:
image

Possible Solution

No response

Version

60856b7

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ruben-iteng ruben-iteng added the bug Something isn't working label Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant