Commit Graph

97 Commits

Author SHA1 Message Date
jean-pierre charras 9dac8534c1 Pcbnew: seriously speedup calculation time when plotting large filled areas. 2019-08-27 13:32:00 +02:00
jean-pierre charras a0fec9db57 PCBNew - fix incorrect gerber generation for overlapping zones of the same net and having different draw options.
Previously, zones of the same net were merged for plotting,
regardless the fact the outline thickness can be different between the zones,
creating incorrect solid areas.

Fixes: lp:1840695
https://bugs.launchpad.net/kicad/+bug/1840695
2019-08-25 13:16:45 +02:00
jean-pierre charras 1c295d46a9 Pcbnew plot: fix missing footprint texts on solder mask layers.
Fixes: lp:1839892
https://bugs.launchpad.net/kicad/+bug/1839892
2019-08-13 09:43:36 +02:00
Seth Hillbrand e985e10eec gerber: Fracture footprint polygons before exporting
Footprint polygons can be degenerate and need
to be simplified before exporting
2019-08-06 17:00:27 -07:00
Jeff Young a3c74051c2 Allow edits to self-intersecting polygons.
1) Intermediate states might be self-intersecting, and we shouldn't
be policing our users on what order to do things in
2) The polygon might already be self-intersecting, at which point we're
preventing the user from fixing it.

Also includes better const management for SHAPE_POLY_SET API.

Fixes: lp:1833831
* https://bugs.launchpad.net/kicad/+bug/1833831
2019-07-14 18:18:48 +01:00
Jeff Young 928d6c5dff Implement preserved-corners to prevent divots when filling adjacent zones.
Fixes: lp:1460787
* https://bugs.launchpad.net/kicad/+bug/1460787
2019-07-14 18:18:48 +01:00
Jeff Young d7f3a38510 If we're plotting small drill marks then we need to plot the pad even if the hole is the same size.
Fixes: lp:1835617
* https://bugs.launchpad.net/kicad/+bug/1835617
2019-07-09 13:07:36 +01:00
jean-pierre charras 34ccd0f004 Pcbnew: prepare the new zone filling algo (filled polygons with no thickness). Work in progress. 2019-06-04 09:39:17 +02:00
Seth Hillbrand 6a45446496 pcbnew: Remove the last dlist from modules/pcbnew 2019-06-01 20:55:32 -07:00
Seth Hillbrand 9163ac543a pcbnew: Move pads to std::deque 2019-06-01 16:23:54 -07:00
Seth Hillbrand 888c01d11b pcbnew: Move tracks to std::deque 2019-06-01 09:53:23 -07:00
Seth Hillbrand d1877d7c1b Moving modules from DLIST to std::deque 2019-06-01 09:53:23 -07:00
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Jon Evans 4d8be7b2bb PcbNew: ensure Bezier points are updated before plotting 2019-05-29 00:17:34 -04:00
Seth Hillbrand 6bcf1839b7 pcbnew: Add arc approximation setting to board
This places the arc approximation setting in the kicad_pcb file and uses
it for all parts of the board rendering where arcs are converted to
segments.  This allows the user to customize their speed vs. accuracy
tradeoff.  The default setting of maximum error of 0.005mm is acceptable
for small boards on moderate systems.
2019-05-24 21:21:06 -07:00
Seth Hillbrand ac435ecd68 Moving further arc approximations down
This corrects an issue with fill segments-per-circle and moves the error
to segmetns calculation down in a number of functions to expose the
single value for approximation
2019-05-22 14:35:17 -07:00
Seth Hillbrand ddc6079ceb Move remaining hard-coded segment counts
This removes the remaining hard-coded segments counts and replaces them
with the relative error calculation where the segments per arc is
determined by the maximum error we allow (smaller arcs = fewer segments)
2019-05-16 08:49:55 -07:00
Jeff Young dae41b7460 Remove legacy segment-based zones.
Give the user the option of cancelling a file open if there are
segment zones; otherwise they're converted to polygon fills.

Fixes: lp:1823087
* https://bugs.launchpad.net/kicad/+bug/1823087
2019-04-12 20:19:23 +01:00
jean-pierre charras 7170720f3c Allow hatch pattern in filled zones
the filled areas can use a hatch pattern (crossing lines) using square holes.
The zone filler removes too small holes (truncated holes) from hatch pattern.
It avoid to create small holes when a hole pattern is truncated by the filled area base shape.
2019-03-31 08:21:40 +02:00
jean-pierre charras d259459a14 Pcbnew: add a new primitive pad shape: chamfered round rect pad.
Allows 0 to 4 chamfered corners, not only one.

A custom shape allow this kind of shape. However because it is a primitive,
it is easier to edit and it support thermal reliefs.
2019-03-11 10:26:15 +01:00
Seth Hillbrand 37741048ce plot: Correct a couple SVG output errors
Plotting to closed lines for polygons in SVG.  Also correct the filled
polygon line width for non-copper zones.

Fixes: lp:1813964
* https://bugs.launchpad.net/kicad/+bug/1813964
2019-01-30 15:41:36 -08:00
Seth Hillbrand ec93fb3171 pcbnew: Fracture polygons before plotting
While not technically allowed, overlapping polygons can be drawn in
pcbnew.  Gerber polygons are strictly simple, however, so we need to
fracture prior to exporting to avoid invalid gerbers.
2018-12-20 17:07:47 -08:00
jean-pierre charras 754837f947 Pcbnew: DRAWSEGMENT polygonal shape: fix drawings in Legacy mode. Add IsPolygonFilled() to know if the polygon is filled or not.
IsPolygonFilled() replaces the hard coded comparisob with Edge_Cut in code.
For now the polygon is not filled only on Edge_Cut layer.

But in the future, it could be an option for other layers.
2018-12-05 09:57:59 +01:00
Seth Hillbrand 2e0887d49f pcbnew: correctly display edgecut polygons in modules
Commit 1858b7dca corrected the handling of polygons on the edge cut
layer for board items.  This adjusts for the possibility of polygons
in modules on the edge cut layer by applying the module offset/rotation
to the polygon elements.
2018-12-04 15:08:04 -08:00
Seth Hillbrand 1858b7dca7 pcbnew: Allow closed polygons as board edges
Like circles, polygons are self-closed elements that define an outline.
This allows them to be used as such for board outlines and cutouts.

Fixes: lp:1795563
* https://bugs.launchpad.net/kicad/+bug/1795563
2018-12-04 12:32:47 -08:00
Seth Hillbrand 3ce8a4856a Remove ToLayer_ID calls from color checks
Colors are assigned to virtual layers while the ToLayer_ID returns a
physical layer enum.  The GetLayerColor/SetLayerColor take LAYER_NUM
(int) values that can be larger than the physical layer count.
2018-05-30 13:51:20 -07:00
Jeff Young d90d4ff682 Fix bugs in Export to SVG.
We were trying to handle aOnlyOneFile at two different levels
which was preventing the Silk layer from going through the
right routine (and preventing board outlines from getting
drawn if selected).

We were also overwriting the references color local variable
before using it, meaning the reference was always rendered in
the value's color.

Fixes: lp:1774171
* https://bugs.launchpad.net/kicad/+bug/1774171
2018-05-30 20:49:05 +01:00
jean-pierre charras 93e75af388 Rename plot_auxiliary_data.h file to gbr_metadata.h, according to the class names defined by this file 2018-05-17 08:07:29 +02:00
Jeff Young f60c251c12 Fix regression in plotting %R and %V text. 2018-02-21 18:02:06 -05:00
Jeff Young 2b0f789b85 Treat %R and %V texts like Reference and Value for plotting.
Fixes: lp:1677321
* https://bugs.launchpad.net/kicad/+bug/1677321
2018-02-11 12:27:22 -05:00
Jeff Young b0d1e49319 Fix plotting of 360 degree arcs and printing of mirrored arcs.
The second issue is OSX-only; the first is universal.
2018-02-05 07:53:51 +01:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
jean-pierre charras 4c5bd01887 Rename a few files 2018-01-28 22:02:31 +01:00
jean-pierre charras e499d337d8 rename files: update filenames in sources 2018-01-28 19:12:26 +01:00
jean-pierre charras 270a63daac DRAWSEGMENT, S_POLYGON shape: remove useless copies or conversion to std::vector<wxPoint> of SHPE_POLY_SET polygon shape.
Rename GetPolyPoint() to BuildPolyPointsList(), because GetPolyPoint() looks like an accessor, but it is not an accessor.
(Using it as accessor can creates a *very long calculation time* for very basic access to polygon vertices)

Fixes: lp:1745050
https://bugs.launchpad.net/kicad/+bug/1745050
2018-01-24 14:22:43 +01:00
Tomasz Włostowski f34b86d39e pcbnew: made zone filling algorithm thread-safe.
- moved zone filling algo outside ZONE_CONTAINER class
- const'ified methods that don't need to modify zone's properties
- cleanup: m_FillMode -> enum
2017-12-05 14:54:57 +01:00
jean-pierre charras bdc6a5950b rename plot_common.h to class_plotter.h, a better name, consistent with other class definitions. 2017-11-16 15:53:30 +01:00
jean-pierre charras 2ec3a46984 Add support of DRAWSEGMENT S_POLYGON shape to plot functions.
Fixes: lp:1732570
https://bugs.launchpad.net/kicad/+bug/1732570
2017-11-16 12:09:24 +01:00
Tomasz Włostowski b945d2a708 cleanup: replace CLASS_MIRE with CLASS_PCB_TARGET for naming clarity 2017-11-03 20:02:06 +01:00
jean-pierre charras 246f8cae24 Fix missing initialization of colors settings of a board, when created by a python script.
A pointer was not initialized, therefore plots from a python script sometimes crash.

Fixes: lp:1721166
https://bugs.launchpad.net/kicad/+bug/1721166
2017-10-08 16:21:27 +02:00
jean-pierre charras a43f3ab1fe replace "BasicShape" by "Primitive" in code, a better name 2017-09-20 12:51:10 +02:00
Maciej Suminski cca63801bf Renamed D_PAD::{Set,Get}PadName() to D_PAD::{Set,Get}Name() 2017-09-19 18:23:50 +02:00
jean-pierre charras e2d3fcec02 Add support for custom pad shape. Full support in DRC and PnS.
add option to use shape or convex hull as clearance area in zones.
simplify code to handle clearance area
2017-09-19 09:02:53 +02:00
Tomasz Włostowski 32185ddcd3 Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting
    - removed several global config settings (such as g_Drc_On)
    - wrapped most of global config settings in PCB_GENERAL_SETTINGS class
    - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas
    - new GAL feature for legacy users: double-click (or E) to change track width available as an option.

Fixes: lp:1530543
* https://bugs.launchpad.net/kicad/+bug/1530543

Fixes: lp:1707145
* https://bugs.launchpad.net/kicad/+bug/1707145
2017-08-04 16:06:57 +02:00
jean-pierre charras 816307e500 Pcbnew plot: fix a few minor issues:
- SVG export: fix color of PCB texts.
- Avoid marking board as modified after plotting layers, when options not saved in board are modified.
2017-07-31 20:05:32 +02:00
Maciej Suminski f3fbce9560 Code formatting and clean-up 2017-06-23 15:43:13 +02:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 08314082db Hide DLISTs behind iterators, first step towards refactoring the storage model 2017-06-23 11:12:36 +02:00
jean-pierre charras 4f2ed1b05f Plot gerber: fix a minor issue: an aperture attribute was incorrectly set on non copper layers when drawing some pads. 2017-05-04 08:55:17 +02:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00