diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f5a15fb..29a9b349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Resistor remap and flip - A `remap_components` option with better type checks - Better support for variants +- SVG: + - Option to control the *SVG precision* (units scale) ### Changed - Diff: @@ -25,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - QR lib update: Problems when moving the footprint to the bottom for KiCad 5. +- SVG: Problems to display the outputs using Chrome and Firefox. ## [1.4.0] - 2022-10-12 diff --git a/README.md b/README.md index 51a112a1..d012ffad 100644 --- a/README.md +++ b/README.md @@ -3229,6 +3229,9 @@ Notes: - `plot_footprint_values`: [boolean=true] Include the footprint values. - `pre_transform`: [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill. + - `svg_precision`: [number=4] [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. - `tent_vias`: [boolean=true] Cover the vias. - `uppercase_extensions`: [boolean=false] Use uppercase names for the extensions. - `variant`: [string=''] Board variant to apply. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 86500416..4ff66c92 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -2002,6 +2002,10 @@ outputs: # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. # A short-cut to use for simple cases where a variant is an overkill pre_transform: '_none' + # [number=4] [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 + svg_precision: 4 # [boolean=true] Cover the vias tent_vias: true # [boolean=false] Use uppercase names for the extensions diff --git a/kibot/out_svg.py b/kibot/out_svg.py index be90168e..c6f505c7 100644 --- a/kibot/out_svg.py +++ b/kibot/out_svg.py @@ -22,6 +22,10 @@ class SVGOptions(DrillMarks): """ Plot mirrored """ self.negative_plot = False """ Invert black and white """ + self.svg_precision = 4 + """ [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._plot_format = PLOT_FORMAT_SVG def _configure_plot_ctrl(self, po, output_dir): @@ -30,6 +34,8 @@ class SVGOptions(DrillMarks): if GS.ki5: po.SetLineWidth(FromMM(self.line_width)) po.SetNegative(self.negative_plot) + if GS.ki6: + po.SetSvgPrecision(self.svg_precision, False) def read_vals_from_po(self, po): super().read_vals_from_po(po)