From b4aac13386da5957cd64b5f01385219034705068 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Fri, 4 Oct 2024 22:41:21 -0600 Subject: [PATCH] [SVG Export][Added] Flag for using aux origin * Add the same flag from the PDF export for using the aux origin for the export. --- kibot/out_svg.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kibot/out_svg.py b/kibot/out_svg.py index 4e8958fb..1b8df8ec 100644 --- a/kibot/out_svg.py +++ b/kibot/out_svg.py @@ -33,6 +33,8 @@ def __init__(self): """ [0,6] Scale factor used to represent 1 mm in the SVG (KiCad 6). The value is how much zeros has the multiplier (1 mm = 10 power `svg_precision` units). Note that for an A4 paper Firefox 91 and Chrome 105 can't handle more than 5 """ + self.use_aux_axis_as_origin = False + """ Use the auxiliary axis as origin for coordinates """ self.limit_viewbox = False """ When enabled the view box is limited to a selected area. This option can't be enabled when using a scale """ @@ -54,6 +56,7 @@ def _configure_plot_ctrl(self, po, output_dir): po.SetMirror(self.mirror_plot) if GS.ki5: po.SetLineWidth(FromMM(self.line_width)) + po.SetUseAuxOrigin(self.use_aux_axis_as_origin) po.SetNegative(self.negative_plot) GS.SetSvgPrecision(po, self.svg_precision) @@ -61,6 +64,7 @@ def read_vals_from_po(self, po): super().read_vals_from_po(po) if GS.ki5: self.line_width = ToMM(po.GetLineWidth()) + self.use_aux_axis_as_origin = po.GetUseAuxOrigin() self.negative_plot = po.GetNegative() self.mirror_plot = po.GetMirror()