Commit Graph

108 Commits

Author SHA1 Message Date
Marek Roszko a347aa7647 StartPlot can fail and leave a broken file handle
Related https://gitlab.com/kicad/code/kicad/-/issues/15782
2023-09-29 19:52:21 -04:00
Alex Shvartzkop 0317a1f687 Fix arcs in gerber export once again.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15559
2023-09-02 00:00:34 +03: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
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
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
Nimish Telang 51e55dd750 Convert sprintf to snprintf in most files 2023-04-17 15:39:34 +00:00
jean-pierre charras 7aace908e1 Gerber plotter: fix incorrect arcs in regions when using a plot offset.
The arc center in Gerber units was incorrectly calculated.
Fixes #14402
https://gitlab.com/kicad/code/kicad/issues/14402
2023-03-24 11:25:25 +01:00
Salvador E. Tropea a6b1a09edf Fix rounding errors in gerber files
The userToDeviceCoordinates helper returns a VECTOR2D
Converting it to VECTOR2I back and forth is a bug and generates rounding errors
Cherry picked from stable branch
2023-02-28 20:27:16 +01: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
Marek Roszko 0ff32d20cd wxS more things 2023-01-22 09:41:42 -05:00
Jeff Young 122a6d7f46 Move hypertext linking to user-page-numbers.
Also moves most navigation code to SCH_NAVIGATION_TOOL.
Also changes page number href to anchor syntax ('#foo').
Also adds hypertext processing to SCH_TEXTBOXes.
Also adds combobox with schematic pages to text properties dialog.
2022-08-27 19:17:43 +01:00
jean-pierre charras 993c446fdf Fix some warnings detected by PVS-STUDIO (most are not used vars) 2022-07-25 18:23:52 +02:00
jean-pierre charras 91dfa79a67 Plot pad outlines on Fab files: fix many issues.
Depending on plotter type and pad type, the plotted shapes were not always the outlines,
but a outline inside the pad shape (due to legacy reasons).
In many cases the plotted shape was in fact incorrect.
(only noticeable for very small pads)
Now the actual pad outlines are plotted without modification.
Fixes #11484
https://gitlab.com/kicad/code/kicad/issues/11484
2022-04-28 12:42:43 +02:00
jean-pierre charras 1a493ed9ed Gerber plotter: fix incorrect handling of arcs in polygons.
Fixes #11156
https://gitlab.com/kicad/code/kicad/issues/11156
2022-03-17 12:55:24 +01:00
Jeff Young 65185f53a1 Rotate fp zones before comparing with library versions.
Also includes some performance fixes to not copy around triangulation
data when it's not needed.

Fixes https://gitlab.com/kicad/code/kicad/issues/10143
2022-03-14 15:53:24 +00:00
jean-pierre charras aa0787f2b4 Gerber plotter: fix broken plot of SHAPE_LINE_CHAIN with arcs.
Also simplify SHAPE_T::POLY plot.
Fixes #10989
https://gitlab.com/kicad/code/kicad/issues/10989
2022-02-28 18:10:16 +01:00
jean-pierre charras d2cf68bcdd Plotters: add plot Arcs using EDA_SHAPE or center, start point and end point.
It avoid trying to calculate arc angles (start, end or arc angle) that
frequently create issues due to reverse Y axis, plot mirrored and/or
angle normalization with different criteria.
Fixes #10914
https://gitlab.com/kicad/code/kicad/issues/10914
2022-02-20 17:17:20 +01:00
Marek Roszko 0a5ddb8d40 Add some vector reservations 2022-02-05 21:12:29 -05:00
jean-pierre charras 4ffea8aae4 code cleaning. 2022-01-21 14:10:26 +01:00
jean-pierre charras 0bc5cb33ed Fix a few issues in plotting code. Fix bug in EDA_ANGLE::IsCardinal()
Fixes #10547
https://gitlab.com/kicad/code/kicad/issues/10547
2022-01-21 12:35:58 +01:00
Jeff Young fbab335128 Retire DPOINT and DSIZE. 2022-01-20 21:10:04 +00:00
Jeff Young e61144d45a Finish with EDA_ANGLE. 2022-01-16 21:15:40 +00:00
Jeff Young 9b661aea10 EDA_ANGLE for plotters.
Also fixes a compile error in the PNS Playground.
2022-01-16 01:19:45 +00:00
Jeff Young 1539fa5af2 Move SHAPE_ARC to EDA_ANGLE. 2022-01-16 01:19:45 +00:00
Mark Roszko 44dc602d6b Yeet wxPoint/wxSize out of PLOTTER 2021-12-29 19:02:50 +00:00
Jeff Young ccb94fd1a7 APIs for passing KIFONT::FONT pointers around.
Also some clean-up and bug fixes.
2021-12-29 17:32:19 +00:00
Jeff Young 86cb57f4a7 Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont 2021-12-28 22:15:20 +00:00
Jeff Young b52529521e Replace individual LIB_* shapes with LIB_SHAPE (based on EDA_SHAPE).
Also moves to more capable FILL_T model that can be shared.
2021-10-15 12:45:43 +01:00
Wayne Stambaugh 46b959c3e3 Move plotter headers into include folder. 2021-08-18 16:38:31 -04:00
Wayne Stambaugh 6427197962 Remove duplicate headers in plot and associated code. 2021-08-17 15:41:25 -04:00
jean-pierre charras 5f84071cfa Gerber plotter, GERBER_PLOTTER::plotArc( SHAPE_ARC& aArc ): fix missing G75 command 2021-08-06 17:45:57 +02:00
Jeff Young 6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
david-beinder 8b3ccab0a3 Implement explicit polygon construction for most pad shapes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8650
2021-07-13 14:51:58 +00:00
Wayne Stambaugh 08e8b17029 Minor plotter code improvements. 2021-06-07 14:32:27 -04:00
Seth Hillbrand cccdaddd50 Adding SHAPE_ARC direct plotting 2021-06-03 17:12:56 -07:00
Seth Hillbrand 3d4ce0796e Add Gerber plot for SHAPE_ARC and SHAPE_LINE_CHAIN 2021-06-03 17:12:56 -07:00
Marek Roszko 4df3cb912d Remove another leaky wx/log.h header 2021-06-03 08:11:15 -04:00
Ian McInerney ecd9bf696e Be consistent about using nullptr instead of 0
0 can be too easily overloaded into an int, so ensure we use nullptr
when we mean pointers.
2021-04-22 22:20:34 +01:00
Jonathan Haas 55679be2e3 Fix some typos across the codebase 2021-04-05 16:15:25 +02:00
jean-pierre charras fabafe719d Use aperture macro for custom pads. Optimize aperture macros for free polygons.
These aperture macros were previously used but only for chamfered round rect.
They are now also used for custom pads (previously drawn as regions).
They are also optimized, i.e. only one aperture macro is created for a given shape.
(previously, one aperture macro was created for each chamfered round rect pad.)

So now all pads are flashed.
2021-01-30 18:14:58 +01:00
jean-pierre charras 15cc368918 Gerber plotter: prepare optimization of aperture macros type free polygons.
They are used for chamfered round rect pads, and can be used for custom shaped pads.
No actual change currently, but the shape rotation of custom pads and chamfered rr pads
can be now used in gerber plots.
2021-01-23 21:15:27 +01:00
jean-pierre charras 048715ab91 Gerber output: fix incorrect creation of trapezoid apertures.
When creating 4 corners (trapezoid) apertures, the rotation parameter was
not tested, therefore shapes actually used could have incorrect rotation.

Fixes #6432
https://gitlab.com/kicad/code/kicad/issues/6432
2020-11-19 09:16:56 +01:00
Jeff Young 7933935b4a Naming conventions. 2020-11-16 00:04:55 +00:00
Marek Roszko e928b2d8fd Split EDA_UNITS out from common. 2020-10-25 00:02:52 -04:00
Marek Roszko b9f1601418 Rename PLOT_MODE to OUTLINE_MODE 2020-10-15 19:33:18 -04:00
Marek Roszko eb33c33f15 Rename EDA_DRAW_MODE_T to PLOT_MODE 2020-10-15 19:30:07 -04:00
Marek Roszko 1538d737e7 Split out FILL_T to its own header to avoid spreading eda_item everywhere 2020-10-14 21:51:23 -04:00