From 3579080e15b40d9bc511de51c4dd658e414cb3b3 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 19 Oct 2020 13:11:30 -0300 Subject: [PATCH] Added workaround for KiCad 5.99 bug. PCB_PLOT_PARAMS.SetPlotMode argument values (SKETCH and FILLED) are missing. https://gitlab.com/kicad/code/kicad/-/issues/6070 --- kibot/out_dxf.py | 11 ++++++++++- kibot/out_hpgl.py | 11 ++++++++++- kibot/out_ps.py | 11 ++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/kibot/out_dxf.py b/kibot/out_dxf.py index 44248f5b..1221b4ef 100644 --- a/kibot/out_dxf.py +++ b/kibot/out_dxf.py @@ -3,11 +3,20 @@ # Copyright (c) 2020 Instituto Nacional de TecnologĂ­a Industrial # License: GPL-3.0 # Project: KiBot (formerly KiPlot) -from pcbnew import (PLOT_FORMAT_DXF, SKETCH, FILLED) +from pcbnew import (PLOT_FORMAT_HPGL) # , SKETCH, FILLED Bug: https://gitlab.com/kicad/code/kicad/-/issues/6070 from .out_any_layer import AnyLayer from .drill_marks import DrillMarks from .macros import macros, document, output_class # noqa: F401 +# From kicad/include/outline_mode.h KiCad 5.99 is missing: +# enum OUTLINE_MODE +# { +# SKETCH = 0, // sketch mode: draw segments outlines only +# FILLED = 1 // normal mode: solid segments +# }; +SKETCH = 0 +FILLED = 1 + class DXFOptions(DrillMarks): def __init__(self): diff --git a/kibot/out_hpgl.py b/kibot/out_hpgl.py index 0b390395..46a2960a 100644 --- a/kibot/out_hpgl.py +++ b/kibot/out_hpgl.py @@ -3,12 +3,21 @@ # Copyright (c) 2020 Instituto Nacional de TecnologĂ­a Industrial # License: GPL-3.0 # Project: KiBot (formerly KiPlot) -from pcbnew import (PLOT_FORMAT_HPGL, SKETCH, FILLED) +from pcbnew import (PLOT_FORMAT_HPGL) # , SKETCH, FILLED Bug: https://gitlab.com/kicad/code/kicad/-/issues/6070 from .misc import AUTO_SCALE from .out_any_layer import AnyLayer from .drill_marks import DrillMarks from .macros import macros, document, output_class # noqa: F401 +# From kicad/include/outline_mode.h KiCad 5.99 is missing: +# enum OUTLINE_MODE +# { +# SKETCH = 0, // sketch mode: draw segments outlines only +# FILLED = 1 // normal mode: solid segments +# }; +SKETCH = 0 +FILLED = 1 + class HPGLOptions(DrillMarks): def __init__(self): diff --git a/kibot/out_ps.py b/kibot/out_ps.py index 1e88d36b..56dabdb5 100644 --- a/kibot/out_ps.py +++ b/kibot/out_ps.py @@ -5,12 +5,21 @@ # License: GPL-3.0 # Project: KiBot (formerly KiPlot) # Adapted from: https://github.com/johnbeard/kiplot -from pcbnew import (PLOT_FORMAT_POST, SKETCH, FILLED, FromMM, ToMM) +from pcbnew import (PLOT_FORMAT_HPGL, FromMM, ToMM) # , SKETCH, FILLED Bug: https://gitlab.com/kicad/code/kicad/-/issues/6070 from .misc import AUTO_SCALE from .out_any_layer import AnyLayer from .drill_marks import DrillMarks from .macros import macros, document, output_class # noqa: F401 +# From kicad/include/outline_mode.h KiCad 5.99 is missing: +# enum OUTLINE_MODE +# { +# SKETCH = 0, // sketch mode: draw segments outlines only +# FILLED = 1 // normal mode: solid segments +# }; +SKETCH = 0 +FILLED = 1 + class PSOptions(DrillMarks): def __init__(self):