diff --git a/kibot/out_gerber.py b/kibot/out_gerber.py index 210abea2..932d587c 100644 --- a/kibot/out_gerber.py +++ b/kibot/out_gerber.py @@ -78,7 +78,8 @@ class GerberOptions(AnyLayerOptions): # useauxorigin self.use_aux_axis_as_origin = po.GetUseAuxOrigin() # linewidth - self.line_width = ToMM(po.GetLineWidth()) + if GS.kicad_version_n < KICAD_VERSION_5_99: + self.line_width = ToMM(po.GetLineWidth()) @output_class diff --git a/kibot/out_pdf.py b/kibot/out_pdf.py index 76e16845..56d085c2 100644 --- a/kibot/out_pdf.py +++ b/kibot/out_pdf.py @@ -19,7 +19,7 @@ class PDFOptions(DrillMarks): super().__init__() with document: self.line_width = 0.1 - """ [0.02,2] for objects without width [mm] """ + """ [0.02,2] for objects without width [mm] (KiCad 5) """ self.mirror_plot = False """ plot mirrored """ self.negative_plot = False @@ -29,13 +29,15 @@ class PDFOptions(DrillMarks): def _configure_plot_ctrl(self, po, output_dir): super()._configure_plot_ctrl(po, output_dir) po.SetMirror(self.mirror_plot) - po.SetLineWidth(FromMM(self.line_width)) + if GS.kicad_version_n < KICAD_VERSION_5_99: + po.SetLineWidth(FromMM(self.line_width)) po.SetNegative(self.negative_plot) def read_vals_from_po(self, po): super().read_vals_from_po(po) self.mirror_plot = po.GetMirror() - self.line_width = ToMM(po.GetLineWidth()) + if GS.kicad_version_n < KICAD_VERSION_5_99: + self.line_width = ToMM(po.GetLineWidth()) self.negative_plot = po.GetNegative() diff --git a/kibot/out_ps.py b/kibot/out_ps.py index f1f63179..6af6475a 100644 --- a/kibot/out_ps.py +++ b/kibot/out_ps.py @@ -26,7 +26,7 @@ class PSOptions(DrillMarks): super().__init__() with document: self.line_width = 0.15 - """ [0.02,2] for objects without width [mm] """ + """ [0.02,2] for objects without width [mm] (KiCad 5) """ self.mirror_plot = False """ plot mirrored """ self.negative_plot = False @@ -53,7 +53,8 @@ class PSOptions(DrillMarks): po.SetFineScaleAdjustX(self.scale_adjust_y) po.SetA4Output(self.a4_output) po.SetPlotMode(SKETCH if self.sketch_plot else FILLED) - po.SetLineWidth(FromMM(self.line_width)) + if GS.kicad_version_n < KICAD_VERSION_5_99: + po.SetLineWidth(FromMM(self.line_width)) po.SetNegative(self.negative_plot) po.SetMirror(self.mirror_plot) # Scaling/Autoscale @@ -71,7 +72,8 @@ class PSOptions(DrillMarks): self.scale_adjust_y = po.GetFineScaleAdjustX() self.a4_output = po.GetA4Output() self.sketch_plot = po.GetPlotMode() == SKETCH - self.line_width = ToMM(po.GetLineWidth()) + if GS.kicad_version_n < KICAD_VERSION_5_99: + self.line_width = ToMM(po.GetLineWidth()) self.negative_plot = po.GetNegative() self.mirror_plot = po.GetMirror() # scaleselection diff --git a/kibot/out_svg.py b/kibot/out_svg.py index a02f59da..f8f8b6b9 100644 --- a/kibot/out_svg.py +++ b/kibot/out_svg.py @@ -16,7 +16,7 @@ class SVGOptions(DrillMarks): super().__init__() with document: self.line_width = 0.25 - """ [0.02,2] for objects without width [mm] """ + """ [0.02,2] for objects without width [mm] (KiCad 5) """ self.mirror_plot = False """ plot mirrored """ self.negative_plot = False @@ -26,12 +26,14 @@ class SVGOptions(DrillMarks): def _configure_plot_ctrl(self, po, output_dir): super()._configure_plot_ctrl(po, output_dir) po.SetMirror(self.mirror_plot) - po.SetLineWidth(FromMM(self.line_width)) + if GS.kicad_version_n < KICAD_VERSION_5_99: + po.SetLineWidth(FromMM(self.line_width)) po.SetNegative(self.negative_plot) def read_vals_from_po(self, po): super().read_vals_from_po(po) - self.line_width = ToMM(po.GetLineWidth()) + if GS.kicad_version_n < KICAD_VERSION_5_99: + self.line_width = ToMM(po.GetLineWidth()) self.negative_plot = po.GetNegative() self.mirror_plot = po.GetMirror()