Add missing degree/radian conversion for polygon aperture rotation
This commit is contained in:
parent
2647709215
commit
8a2599f5f4
2 changed files with 4 additions and 1 deletions
|
|
@ -396,6 +396,8 @@ class PolygonAperture(Aperture):
|
|||
rotation = self.rotation % (2*math.pi / self.n_vertices)
|
||||
if math.isclose(rotation, 0, abs_tol=1e-6):
|
||||
rotation = None
|
||||
else:
|
||||
rotation = math.degrees(rotation)
|
||||
|
||||
if self.hole_dia is not None:
|
||||
return self.unit.convert_to(unit, self.diameter), self.n_vertices, rotation, self.unit.convert_to(unit, self.hole_dia)
|
||||
|
|
|
|||
|
|
@ -880,7 +880,8 @@ class GerberParser:
|
|||
|
||||
# Polygon aperture rotation is specified in degrees, but radians are easier to work with
|
||||
if match['shape'] == 'P':
|
||||
modifiers[2] = math.radians(modifiers[2])
|
||||
if len(modifiers) > 2:
|
||||
modifiers[2] = math.radians(modifiers[2])
|
||||
|
||||
new_aperture = kls(*modifiers, unit=self.file_settings.unit, attrs=tuple(self.aperture_attrs.items()),
|
||||
original_number=number)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue