Hi All!
I'm trying to make "kicad-cli pcb export PLOTTER" as functional as the
Python API, which IMHO is needed before moving to the inter-process API.
Two years ago I opened
https://gitlab.com/kicad/code/kicad/-/issues/13957 as a suggestion by
@craftyjon
As some functionality remains unimplemented I'm submitting patches to
fix them (PS and HPGL support already merged, scale setting waiting for
approval)
One missing functionality is the equivalent to SetSketchPadLineWidth, I
have working code that implements it, but I'm having some doubts.
Looking at the code I see it was intended to be useful, but from what I
see it never worked.
I tried it from the Python API using KiCad 6, 7, 8 and 9 without success.
The code does:
```
if( aPlotMode == SKETCH )
m_plotter->SetCurrentLineWidth( GetSketchPadLineWidth(),
&metadata );
```
https://gitlab.com/kicad/code/kicad/-/blob/master/pcbnew/plot_brditems_plotter.cpp?ref_type=heads#L279-280
This in BRDITEMS_PLOTTER::PlotPad
Then the code plots the pad calling FlashPad* but when you look at its
implementation for the PS/PDF/SVG all these functions does something
like this:
```
if( aTraceMode == FILLED )
SetCurrentLineWidth( 0 );
else
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
```
https://gitlab.com/kicad/code/kicad/-/blob/master/common/plotters/PS_plotter.cpp?ref_type=heads#L147-150
Which defeats the caller intention. IMHO the else part should be removed.
I removed them and I managed to make it work.
The GUI dialog can't set it directly, but is controlled by:
```
m_plotOpts.SetSketchPadLineWidth(
board->GetDesignSettings().GetLineThickness( F_Fab ) );
```
So I see it was intended to work, but never tested.
My questions are:
1. Should I try to fix it?
2. Should we change the drivers so USE_DEFAULT_LINE_WIDTH uses a default
that can be set from the callers? Currently this default is driver
specific and usually "the smallest possible"
3. What about other sketch modes? I.e. the plot dialog allows to set
Postscript in sketch mode ... but the BRDITEMS_PLOTTER::PlotPad code
currently assumes that SKETCH == SketchPadsOnFabLayers ... What about
Postscript and HPGL? (BTW HPGL is full of bugs, some of them really
complex to address)
Regards, Salvador
--
You received this message because you are subscribed to the Google Groups "KiCad
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to devlist+unsubscr...@kicad.org.
To view this discussion visit
https://groups.google.com/a/kicad.org/d/msgid/devlist/3db8d9c0-428b-4e34-9b0f-5904395b5478%40inti.gob.ar.