82 Commits

Author SHA1 Message Date
Bernhard Kirchen e3f049f4d9 ADDED: expand VARIANT and VARIANT_DESC in drawing sheets
* add VARIANT and VARIANT_DESC to the list of known vars in the drawing
  sheet editor.
* cache variant and variant description in respective objects.
* expand the respective text variables when building the drawing sheet.
* keep the cached variant and its description up-to-date when selecting
  a variant in the GUI.
* pass variant and its description to the plotters.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23430
2026-03-17 15:39:34 +00:00
Seth Hillbrand c0a6a139cf Add $INSUNITS header variable to DXF export
The DXF exporter was missing the $INSUNITS header variable, which tells
CAD software what physical units the drawing coordinates represent. Without
it, other programs have no reliable way to determine the coordinate scale.

Add $INSUNITS to the HEADER section alongside the existing $MEASUREMENT
variable. When exporting in millimeters, $INSUNITS is set to 4; when
exporting in inches, it is set to 1.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23181
2026-02-23 12:14:49 -08:00
Mike Williams 5d92b9ba4b pdf: don't emit scientific notation when using floating point
fmt {:g} will sometimes put in scientific notation, e.g. 1.0e6 when we
pass some sizes of numbers. PDF doesn't accept scientific notation for
numbers, so make sure we convert those. Postscript seems to accept these
just fine so limit the fix to PDF.

I don't know that we were hitting these before, but my previous fix for
the background position caused some exponentially formatted numbers.
2026-01-22 10:34:19 -05:00
Seth Hillbrand a4dd0174b9 Add symbol editor clipboard handling
Mirrors handling for schematic editor.  Outputs SVG+PNG+Kicad text to
the clipboard, applications choose which to paste
2025-12-31 14:22:31 -08:00
Seth Hillbrand 99fdf2b9be Added: DXF Multilayer plotting
DXF layers and appropriate layer colors added.  Option mimics the PDF
multilayer option

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2526
2025-12-02 11:09:35 -08:00
Jeff Young 27b45e58ab Formatting and delete dead code. 2025-10-30 17:05:38 +00:00
Jeff Young 5419839a1d Continue lineStyle patterns between arcs and segments in SHAPE_LINE_CHAIN.
This requires us not resetting PS/PDF's lineStyles
with a "move" instruction.

Also fixes DXF to handle arcs in SHAPE_LINE_CHAINs,
even if it doesn't handle lineStyles.
2025-10-24 22:30:04 +01:00
Jeff Young e6b6200de2 Improve SHAPE_LINE_CHAIN arc plotting.
It still doesn't get it quite right as it restarts
the lineStyle pattern at each segment/arc transition.
2025-10-23 17:43:30 +01:00
Marek Roszko ad7bdf5b87 ADDED: 3D PDF Export
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/4439
2025-09-17 22:45:35 -04:00
Seth Hillbrand 753afc7f37 ADDED: Plot uses the KiCad font, embedded in PDF
Creates a Type-3 representation of our stroke font, embeds it in the PDF
and then causes text to be represented in that font.

This prevents the need for over-stroking and keeps our PDFs searchable
and accessible
2025-09-17 09:05:15 -07:00
Seth Hillbrand 8acf5c1a25 ADDED: Rounded Rectangles
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4742
2025-08-29 17:37:30 -07:00
Marek Roszko 0268ed6d28 Add 3d pdf functions to PDF_PLOTTER to reduce rebasing pain 2025-05-11 11:47:37 -04:00
Jeff Young 34139ae305 Push generalised sketch-mode support down into DXF_PLOTTER. 2025-05-10 17:31:59 +01:00
Jeff Young 3458534fd7 Cleanup plotting APIs. 2025-05-10 17:31:59 +01:00
Jeff Young 88695af364 Move sketched DNP items to plot_brditems_plotter.cpp. 2025-05-10 17:31:59 +01:00
Jeff Young c78ce373fd Move pad-outline plotting to plot_brditems_plotter.cpp. 2025-05-10 17:31:59 +01:00
Jeff Young c452fe9686 REMOVED: HPGL plotting.
Its sketch-mode greatly complicates the plotting
code and it is poorly maintained due to lack of
use.
2025-05-10 17:31:59 +01:00
Jeff Young 1f07c28999 Fix a bunch of errors involving implied line widths in plotters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20818
2025-05-01 16:37:08 +01:00
Jeff Young 151cb01795 Mirror pad numbers when appropriate.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20459
2025-03-27 23:28:30 +00:00
Marek Roszko dd4c9af265 Move HPGL_PLOTTER to fmtlib 2025-03-07 08:02:13 -05:00
Marek Roszko 237953fd55 Move SVG_PLOTTER to {fmt} to punt locale issues 2025-03-05 19:03:25 -05:00
Seth Hillbrand 4a3b33df4e Map a full hierarchy during PDF plotting
Re-create the schematic hierarchy in PDF plots to ease navigation
relative to the on screen schematic

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12154
2025-03-05 13:28:01 -08:00
jean-pierre charras eaa1e6d594 Fix a collision with a Windows define and our use of the same var name.
We use IN for INCH as units, but IN is defined in a Windows header
2025-03-02 11:34:30 +01:00
Jeff Young f951497a4f Code brevity. 2025-03-01 21:58:31 +00:00
Daniel Treffenstädt 3768221d9c ADDED: Support for IPC-4761 Via protection features
Fixes https://gitlab.com/kicad/code/kicad/-/work_items/18837
2025-03-01 18:02:54 +00:00
Wayne Stambaugh 89db935910 Housekeeping in include path sub-folders. 2025-01-04 09:21:11 -05:00
Seth Hillbrand 0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Wayne Stambaugh 43c3cd57eb Substitute variables in PDF plotter URI links and add file:// URI handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250
2024-10-24 08:06:28 -04:00
Andrzej.W b49ebaeb16 ADDED: Soldermask layer option for graphic shapes
Allows adding a soldermask opening for shapes on a copper layer.
Soldermask expansion can also be specified.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2125
2024-10-10 12:46:06 +00:00
Jeff Young b88d3b13ac ADDED: sketch-pads-on-fab-layers to CLI PDF & SVG export.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18091
2024-05-27 20:59:11 +01:00
Jeff Young e30b6398b7 ADDED: optional PDF metadata from AUTHOR and SUBJECT variables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17289
2024-03-14 17:40:04 +00:00
jean-pierre charras 821063e5b1 Pcbnew, pdf plotter: fixes and enhancements.
* To select a footprint info, Use the bbox with not text as selectable area
* Fix also incorrect position of footprint bbox when plotting with offset

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17355
2024-03-10 13:04:39 +01:00
Alex Shvartzkop 4d66a8ebdb Fix rendering/plotting of arcs with tiny angle and huge radius.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17343
2024-03-09 02:07:24 +03:00
Alex Shvartzkop 57bc443f0b Fix HPGL color mode being set. 2024-01-15 22:35:35 +03:00
Wayne Stambaugh a4b38fbb80 Coverity warning fixes. 2023-12-18 16:09:13 -05:00
Jeff Young df83e24eb7 Cleanup.
It's been a long time since line style was specific to plotting.
2023-11-25 13:12:45 +00:00
Alex Shvartzkop 10e2e4a12d Another try at fixing arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15471
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15469
2023-08-22 16:10:58 +03:00
Alex Shvartzkop 865fa10fb2 Fix pad arcs in Gerber plot when aperture macros are disabled.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15452
2023-08-19 22:49:37 +03:00
Jeff Young f43b90b15f Lazy context handling for SVG plotting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15325
2023-08-07 14:01:58 +01:00
Alex Shvartzkop 717ee350c8 Support >180 deg arcs in schematic. 2023-08-07 14:18:38 +03:00
Jeff Young 5e112ca78e ADDED: parameterize font metrics and allow customization of overbar height. 2023-08-06 20:57:41 +01:00
Alex Shvartzkop 2689037bde PDF plotting: support bitmaps with transparency.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5979
2023-07-07 23:29:46 +05:00
jean-pierre charras 88ffcec4b5 Plotters (especially DXF) add more precision when plotting arcs (and others)
- in DXF coordinates were using 6 digits for coordinate mantissa: this is not
enough for coord in inches. Now use 16 digits
- Arc( VECTOR2I& aCentre, EDA_ANGLE& aStartAngle, EDA_ANGLE& aEndAngle, ...)
was using integers for coord. This creates significant errors for start point
and end points of the arc. Now the center is given in double, and its position
is calculated from angle end points (and radius) to do not generate a position error
for these end points (previously the error could be 20 ... 50 nm)
Fixes #15056
https://gitlab.com/kicad/code/kicad/-/issues/15056
2023-07-06 18:09:38 +02:00
Alex Shvartzkop afe176abe2 Optimize PDF plot data size for property popups; fix unicode escape.
Adds a document-level action JSInit, which defines ShM function,
allowing more compact data representation. Also reduces whitespaces.
2023-07-04 08:57:29 +03:00
Nimish Telang 8ea357f04d Fix Doxygen directives in numerous headers 2023-03-24 13:02:13 +00:00
jean-pierre charras 51d46c0e73 plotters rework: add plot fct to use TEXT_ATTRIBUTES class to pass text settings
Old PLOTTER::Text is not (yet) removed, but it use negative text size
to mirrored text, which is not really compatible with some plotters (especially PDF).
Using TEXT_ATTRIBUTES is much easy and much better,
so PLOTTER::PlotText() is added.
Note: "old" PLOTTER::Text() is not removed yet.
2023-02-26 14:44:53 +01:00
jean-pierre charras ece34e1a0c Plot Gerber format: ensure all attributes are added to polygon items.
Especially, TA.AperFunction,EtchedComponent for net tie footprints using polygons.
2023-02-25 19:06:46 +01:00
jean-pierre charras 31be74b8b3 Fix a few Coverity warnings 2023-02-20 09:25:01 +01:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Marek Roszko 8f52821cd4 Add missing clear of children memory in outline node 2022-09-25 08:47:28 -04:00