Fix failing tests

This commit is contained in:
jaseg 2023-04-11 00:52:07 +02:00
parent b0bc7971bc
commit 138f6504e7
4 changed files with 6 additions and 6 deletions

View file

@ -452,7 +452,7 @@ class PolygonAperture(Aperture):
def _params(self, unit=None):
rotation = self.rotation % (2*math.pi / self.n_vertices)
if math.isclose(rotation, 0, abs_tol=1-e6):
if math.isclose(rotation, 0, abs_tol=1e-6):
rotation = None
if self.hole_dia is not None:

View file

@ -248,10 +248,10 @@ class Polyline:
(x0, y0), *rest = self.coords
d = f'M {float(x0):.6} {float(y0):.6} ' + ' '.join(f'L {float(x):.6} {float(y):.6}' for x, y in rest)
width = f'{self.width:.6}' if not math.isclose(self.width, 0) else '0.01mm'
width = f'{float(self.width):.6}' if not math.isclose(self.width, 0) else '0.01mm'
return tag('path', d=d,
fill='none', stroke=color,
stroke_width=f'{float(width):.6}')
fill='none', stroke=color, stroke_linecap='round', stroke_linejoin='round',
stroke_width=width)
class CamFile:

View file

@ -275,5 +275,5 @@ class Rectangle(GraphicPrimitive):
color = fg if self.polarity_dark else bg
x, y = self.x - self.w/2, self.y - self.h/2
return tag('rect', x=prec(x), y=prec(y), width=prec(self.w), height=prec(self.h),
*svg_rotation(self.rotation, self.x, self.y), fill=color)
**svg_rotation(self.rotation, self.x, self.y), fill=color)

View file

@ -267,7 +267,7 @@ class GerberFile(CamFile):
for aperture in self.apertures:
if isinstance(aperture, apertures.ApertureMacroInstance):
macro_def = am_stmt(aperture._rotated().macro)
macro_def = am_stmt(aperture.rotated().macro)
if macro_def not in processed_macros:
processed_macros.add(macro_def)
yield macro_def