diff --git a/CHANGELOG.md b/CHANGELOG.md index e07e3ec3..d96998ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - PcbDraw: - BMP output format - Image margin + - Outline width ### Changed - Diff: diff --git a/README.md b/README.md index be7d7a1e..30222bab 100644 --- a/README.md +++ b/README.md @@ -2573,7 +2573,7 @@ Notes: - **`pads`**: [string='#8b898c'] Color for the exposed pads (metal finish). - **`silk`**: [string='#d5dce4'] Color for the silk screen. - `highlight_on_top`: [boolean=false] Highlight over the component (not under). - - `highlight_padding`: [number=1.5] [0,1000] how much the highlight extends around the component [mm]. + - `highlight_padding`: [number=1.5] [0,1000] How much the highlight extends around the component [mm]. - `highlight_style`: [string='stroke:none;fill:#ff0000;opacity:0.5;'] SVG code for the highlight style. - `vcut`: [string='#bf2600'] Color for the V-CUTS. - `dnf_filter`: [string|list(string)='_none'] Name of the filter to mark components as not fitted. @@ -2581,8 +2581,10 @@ Notes: - `dpi`: [number=300] [10,1200] Dots per inch (resolution) of the generated image. - `highlight`: [list(string)=[]] List of components to highlight. - `libs`: [list(string)=[]] List of libraries. - - `margin`: [number=0] [0,100] Margin around the generated image in millimeters. + - `margin`: [number=0] [0,100] Margin around the generated image [mm]. - `no_drillholes`: [boolean=false] Do not make holes transparent. + - `outline_width`: [number=0.15] [0,10] Width of the trace to draw the PCB border [mm]. + Note this also affects the drill holes. - `placeholder`: [boolean=false] Show placeholder for missing components. - `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. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index b504a0b5..8c4341f5 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -1362,12 +1362,15 @@ outputs: highlight: [] # [list(string)=[]] List of libraries libs: [] - # [number=0] [0,100] Margin around the generated image in millimeters + # [number=0] [0,100] Margin around the generated image [mm] margin: 0 # [boolean=false] Mirror the board mirror: false # [boolean=false] Do not make holes transparent no_drillholes: false + # [number=0.15] [0,10] Width of the trace to draw the PCB border [mm]. + # Note this also affects the drill holes + outline_width: 0.15 # [string='%f-%i%I%v.%x'] Name for the generated file. Affected by global options output: '%f-%i%I%v.%x' # [boolean=false] Show placeholder for missing components @@ -1390,7 +1393,7 @@ outputs: copper: '#285e3a' # [boolean=false] Highlight over the component (not under) highlight_on_top: false - # [number=1.5] [0,1000] how much the highlight extends around the component [mm] + # [number=1.5] [0,1000] How much the highlight extends around the component [mm] highlight_padding: 1.5 # [string='stroke:none;fill:#ff0000;opacity:0.5;'] SVG code for the highlight style highlight_style: 'stroke:none;fill:#ff0000;opacity:0.5;' diff --git a/kibot/out_pcbdraw.py b/kibot/out_pcbdraw.py index 4ffcd668..808ce9d0 100644 --- a/kibot/out_pcbdraw.py +++ b/kibot/out_pcbdraw.py @@ -78,7 +78,7 @@ class PcbDrawStyle(Optionable): self.highlight_style = "stroke:none;fill:#ff0000;opacity:0.5;" """ SVG code for the highlight style """ self.highlight_padding = 1.5 - """ [0,1000] how much the highlight extends around the component [mm] """ + """ [0,1000] How much the highlight extends around the component [mm] """ def config(self, parent): # Apply global defaults @@ -162,7 +162,10 @@ class PcbDrawOptions(VariantOptions): self.output = GS.def_global_output """ *Name for the generated file """ self.margin = 0 - """ [0,100] Margin around the generated image in millimeters """ + """ [0,100] Margin around the generated image [mm] """ + self.outline_width = 0.15 + """ [0,10] Width of the trace to draw the PCB border [mm]. + Note this also affects the drill holes """ super().__init__() def config(self, parent): @@ -318,8 +321,7 @@ class PcbDrawOptions(VariantOptions): else: tmp_style = self._create_style() plotter.resolve_style(tmp_style) - # TODO: Make aoutline_width configurable - plotter.plot_plan = [PlotSubstrate(drill_holes=not self.no_drillholes, outline_width=mm2ki(0.15))] + plotter.plot_plan = [PlotSubstrate(drill_holes=not self.no_drillholes, outline_width=mm2ki(self.outline_width))] # TODO: Make paste optional plotter.plot_plan.append(PlotPaste()) if self.vcuts: diff --git a/tests/yaml_samples/pcbdraw.kibot.yaml b/tests/yaml_samples/pcbdraw.kibot.yaml index 850ca73a..e500a451 100644 --- a/tests/yaml_samples/pcbdraw.kibot.yaml +++ b/tests/yaml_samples/pcbdraw.kibot.yaml @@ -47,6 +47,7 @@ outputs: warnings: visible dpi: 600 # margin: 2 + # outline_width: 3 - name: PcbDraw2 comment: "PcbDraw test bottom"