Commit Graph

79 Commits

Author SHA1 Message Date
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
Marek Roszko f59551d6ad Remove painter.h from eda_text.h 2020-10-14 19:18:38 -04:00
Marek Roszko 12d21e34e2 Remove trigo.h from eda_text.h 2020-10-13 23:37:48 -04:00
Marek Roszko b2e9f6987d Split base_struct into eda_item and eda_rect 2020-10-13 21:24:50 -04:00
Jeff Young 1703729269 Require explicit decl of maxError and errorLocations.
This should reduce both performance issues and clearance issues.
2020-10-13 13:49:07 +01:00
jean-pierre charras 380534807b Plotters: better support of filled circles having a thickness set to 0.
Setting a line thickness = 0 for graphic objects (circle, rect, line) is
allowed but creates issues for circles that were plotted a non filled shapes
but having a outline thickness = 0.
2020-10-12 11:30:43 +02:00
jean-pierre charras 34f47b3806 Add support of AP macro for chamfered round rect pads. 2020-10-11 12:53:45 +02:00
jean-pierre charras 213a74cbe6 Gerber, Dialog plot: add option to disable Aperture Macro use.
Some broken Gerber readers cannot handle Aperture Macros without errors
although this feature exists since the beginning of RS274X format.
2020-10-10 16:42:21 +02:00
jean-pierre charras f60954c232 Gerber export: add support for flashed chamfered rect (with no rounded corner) pads 2020-10-09 16:47:34 +02:00
jean-pierre charras 2aa357c872 Gerber export: fix incorrect size or orient of flashed oval and round Rect
shapes when they are not horizontal or vertical.
2020-10-08 14:48:34 +02:00
jean-pierre charras 00fea5006e Gerber plotter: fix a bug in a aperture macro calculation 2020-10-08 13:24:28 +02:00
jean-pierre charras 61f1f7d948 Gerber, aperture macros: use different apertures primitives in macro defs.
To avoid issues with broken Gerber readers use aperture macros with shapes
without rotation when more than one primitive is required.
In many gerber readers, rotation of a set of primitives is broken
(do not follow Gerber requirements)
2020-10-06 11:08:07 +02:00
jean-pierre charras 12ecccd0f3 Gerber output: disable use of aperture macros until some issues are fixed. 2020-10-05 10:54:38 +02:00
jean-pierre charras e76736b7bf Fix a few Coverity warnings 2020-10-03 12:47:41 +02:00
jean-pierre charras 0cca2a0ad2 Rect, Round Rect, Oval, Trapezoid (rotated) pads now use flashed apertures.
Complex shapes are plot using regions.

The old code is still available, just in case...
2020-10-02 10:19:45 +02:00
jean-pierre charras 6b958ff4e0 Move specialized plotter classes from plotter.h to specific plotter_xx.h
plotter.h contains now only a header common to all plotters.
The code does not actually change, but it allows modifying a specific plotter
without recompiling most of kicad files.
2020-09-27 09:54:39 +02:00
Marek Roszko de7a1b647c Use a local tmp file for plotting
Fix #5238
2020-08-20 16:23:51 +00:00
jean-pierre charras 1973153368 Gerber plotter: ensure the gerber region for a round rect pad is always closed.
Due to rounding issues, sometimes (especially for rotated pads) the region
(4 segments+4 arcs) was incorrectly closed (1 unit (nanometer) mismatch between
start point and end point.
Although it does not create bad shape, its breaks the round rect pad identification
in CAM tools.
start point and end point are now the same.
2020-06-12 10:22:19 +02:00
Jeff Young bcea2019d4 Unify support for line width magic cookies.
They were added for the Gerber plotter but once there there's the
expectation by others that they'll work.
2020-05-13 17:56:47 +01:00
Jeff Young 10614a9ebc Implement changes for Sketch Pads to Fab Layers.
Includes adding Fab Layers to default text & graphic settings.

Fixes https://gitlab.com/kicad/code/kicad/issues/1885

Fixes https://gitlab.com/kicad/code/kicad/issues/2274
2020-05-01 18:49:42 +01:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
Seth Hillbrand 819f28daf5 Revert part of 9c8941e04
This accidentally changed gerber plotting behavior, resulting in invalid
aperture sizes

Fixes https://gitlab.com/kicad/code/kicad/issues/4232
2020-04-20 15:42:23 -07:00
Jeff Young 2b6089240a Change super/subscript syntax to ^{foo} and _{foo}. 2020-04-18 21:04:41 +01:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
jean-pierre charras de7154e8e9 Gerber plotter: Non horiz or vertical oval pads: better plot output:
These pads were plotted as a segment. This is not the right way.
Pads must be flashed or plotted as regions, not painted.
They are now plotted as Gerber regions round rectangle pads.
These regions are similar to flashed pads.
2020-03-27 10:34:41 +01:00
jean-pierre charras 9cb3333d05 Gerber plotter: plot round rectangle pads using a region with arcs.
Previously, the region was a usual polygon with arc approximated by segment.
Using a region with arcs is a better way because it allows CAM tools to
identify this region as a round-rect pad.

A side effect is a better shape and smaller files, however not really noticeable in fact.
2020-03-20 19:45:05 +01:00
jean-pierre charras 08f0e8d6e8 Pcbnew, Gerber output: always generates Aperture Attributes.
Previously, for historical reasons, they were added only if
Include Netlist Attributes option was on.

But Aperture Attributes have nothing to do with Netlist Attributes, and good
Gerber files must include them.
2020-03-12 16:57:13 +01:00
jean-pierre charras 465ffff162 Gerber plots: Add initial G01 command to the header,
to ensure linear interpolation mode.
To avoid issues, an interpolation mode must be set before first D01 command.
2020-02-03 17:55:19 +01:00
Ian McInerney f896043067 Fix comments for switch statement fall throughs
This cleans up all GCC warnings (-Wimplicit-fallthrough=2) about
implicitly falling through switch cases.
2020-01-11 19:16:32 +00:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00