1) Make sure that layer dependencies don't prevent us from drawing
drill marks.
2) Don't draw pad shapes when their particular layer isn't enabled
(a side effect from the above)
3) Allow the printout painter to set a different hole colour (the
special case for through-hole pads was handled twice anyway -- once
in LoadColors() and once in draw( D_PAD ).
4) Replace the call to getDrillSize() which handles swapping in the
small mark size if set.
Fixes https://gitlab.com/kicad/code/kicad/issues/4847
Correctly hide netnames in high contrast mode
Correct highlighting for blind/buried/micro via drills
Repaint vias when needed to support stacked microvias
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2593
ADDED memberOf() function for DRC rule expressions.
Also fixes a bug in several of the pickers where the event wasn't
being correctly passed.
Fixes https://gitlab.com/kicad/code/kicad/issues/5647
ViewGetLOD() returns the minimal value of a zoom to show an item.
However a zoom is a double, and using int as minimal value does not
allows setting a correct value in some cases.
This is a board file format change to account for the new properties.
Also, we now only store the critical information about the dimension's
geometry in the board, rather than storing every drawn line.
The DIMENSION object is now an abstract base, and ALIGNED_DIMENSION
is the implementation that exists today (we will add more dimension
types in the future)
... instead of modifying the argument.
This will make the method usable in python API and will not incur
permormance penalty because named return value optimization (NRVO)
is a thing since C++11.
But even if copy is not elided vector is moved instead of copied.
https://en.cppreference.com/w/cpp/language/copy_elision
This introduces layer handling to a lot of the geometry routines.
Many of them don't do much with it now, but it does help multi-layer
zones and will help when padstacks are implemented.
This option removes copper layers from pads and vias where they are not
connected to other board elements. This allows the inner layers to be
more closely routed if the via landing pad is not needed.
Fixes https://gitlab.com/kicad/code/kicad/issues/1835
List of hidden nets stored in project local settings
Hide/Show actions in context menu only for now, will
add them to some more GUI places soon.
Ref https://gitlab.com/kicad/code/kicad/-/issues/1951
LoadProjectSettings changed to take place after the board
has been loaded so that board-specific project settings can
be applied (such as net visibility and color overrides)
Remove extraneous use of FLAG0 from tracks cleaner (it was checked but
never set).
Fix issue in expand connections where two parts of it couldn't agree
on the same flag (BUSY vs SKIP_STRUCT), and where the second part was
clearing the flag instead of setting it.
Remove obsolete HIGHLIGHT infrastructure (we now use selection).
Remove extraneous use of BUSY flag in several places (it was never
set).
There were a lot of plotters, exporters, etc. that were rolling their
own implementations.
This also introduces a lazily-built set of SHAPE objects for doing
collision detection and some forms of rendering (and later DRC).
instead of convert shapes to polygons.
For small pad sizes (< 0.5mm) the polygonal shape is really ugly.
Moreover, circles and oblong shapes are native in gal and give a much better look.
It's currently only supported in the Footprint Editor. It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
Note: this is a basic implementation but it could be
improved once we include bus information in the netlist
and pcbnew can natively keep track of buses and nets
instead of just nets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4158
LAYER_VIAS needs to get set for them to print at all, and GetLOD
needs too look at the view layer visibiilties, not the board layer
visibilities.
Also implements a more pad-like strategy for printing blind/buried
vias when printing one layer per page (where the top/bottom arcs
don't make sense).
Fixes https://gitlab.com/kicad/code/kicad/issues/1938
the parameter margin percent was badly handled for rectangular/oval pads,
giving an incorrect solder paste shape for non 0.0 values
now it is is correctly handled.
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme
Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
In high contrast mode, the holes of buried vias and microvias were no darkened when not on the active layer.
In high contrast mode, the outer circle of buried vias and microvias were alway darkened.
In high contrast mode, when the selected layer is non visible through-vias are now darkend.
Fixes: lp:1844982
* https://bugs.launchpad.net/kicad/+bug/1844982
The pointer passing for display options is deprecated. This removes the
excess casting as the EDA_FRAME didn't need the base call with no value.
All requests for display options are now returned const and are updated
with a Set() routine after modification.
In Gerbview, this resolves an issue where the display options were not
stored because it was receiving the NULL from EDA_FRAME.
This removes unused static function in page layout editor, unused
variable in pcb_painter and restors the gcc unitialized fix for
pcbnew's drawing_tool.
This assumes maximum registration errors are a vector, rather than
an amount in both x and y axes. Lots more disucssion in the bug
report and on the forum (link in the bug report).
Also makes large changes to the painting of pads, but they now use
the same code as plotting, so if there are any changes then they
were errors before since plotting represents "truth".
Fixes: lp:1563744
* https://bugs.launchpad.net/kicad/+bug/1563744
This mixes the de-emphasized layers into the background color rather
than merely a black color. This also keeps some of the original layer
color.
Fixes: lp:1831316
* https://bugs.launchpad.net/kicad/+bug/1831316
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.
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
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)
This is mainly the solder paste layer that shows this issue.
This is due to the fact SHAPE_POLY_SET::Inflate does not work fine with polygons with linked holes.
SHAPE_POLY_SET::InflateWithLinkedHoles it added to fix this issue.
Fixes: lp:1828287
https://bugs.launchpad.net/kicad/+bug/1828287
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
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.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL
Cleanup of pixel alignment patches
gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends
GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing
Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use). Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.
gal: further cleanup
gal: removed unused shader parameter
the stroke mode was always activated, even in fill mode. creating incorrect size shape for null length track segments.
Fixes: lp:1812532
https://bugs.launchpad.net/kicad/+bug/1812532
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time. Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
Use TesselatePolygon() to draw polygons in Gerbview instead of GLU tesselation, much slower.
Add helper methods in GAL to know if the current GAL engine is Cairo, OpenGL or something else,
useful to optimize drawing code.
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.
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
In DRAWSEGMENT polygonal shape: the commit tried to use triangulation (CacheTriangulation) to draw the shape (similar to zones).
It was much faster than using GLU tesselator (one order of magnitude).
Unfortunately, CacheTriangulation() works only with simple polygons, not with any polygon.
And simplifying a polygon with a lot of vertexes is very time consuming.
So using CacheTriangulation() is now removed and GLU tesselator is used as previously.
Fixes: lp:1806411
https://bugs.launchpad.net/kicad/+bug/1806411
SEGZONE types were confusingly named PCB_ZONE_T. Zones in pcbnew are
now _only_ PCB_ZONE_AREA_T, so we name segzone types PCB_SEGZONE_T to be
clear.
This also removes processing of the SEGZONEs from connectivity
calculations.
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
Zones: it turned out that for every zone point, the set of hatch lines
has been drawn, resulting in numerous redundant lines. Now the set is
drawn only once per zone.
Custom shape pads: as GAL supports SHAPE_POLY_SETs, there is no need to
create a temporary vector to copy there a list of points to be drawn.
Changed the drawing calls to use SHAPE_POLY_SETs directly.
Thanks to Andreas Buhr patch, code for drawing filled polygons and their
outlines has been unified. Previously it was done by changing the
drawing method (GAL::DrawPolygon() vs GAL::DrawPolyline()), now it is
done by modifying attributes (stroke/fill).
LAYER_NON_PLATED to LAYER_NON_PLATEDHOLES
LAYER_PADS_HOLES to LAYER_PADS_PLATEDHOLES
LAYER_PADS to LAYER_PADS_TH
and add comments and fix a render issue in gal mode for non plated holes.
SHAPE_POLY_SET: fix crash in VertexCount when it is a empty poly set, or when params are incorrect.
minor other fixes:
warning in degug mode in dialog_dxf_import_base.cpp
pcb_painter.cpp: remove a useless debug line.
- pad names are stored as wxString instead of a char[4] & integer union
- removed pad name to string conversion functions
- fixed pad & pin properties dialog restrictions regarding the name
length
- 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
If there was a board with no copper layers checked as visible, the
initial GAL cache contained an empty entry for them. In such case,
toggling layers visibility have not changed anything.
The visibility condition check has been moved to ViewGetLOD() method
which serves better the purpose of dynamic visibility checks.
Fixes: lp:1639974
* https://bugs.launchpad.net/kicad/+bug/1639974
Removes the need of using the legacy code in polygon/PolyLine.{h,cpp},
refactoring all CPolyLine instances with SHAPE_POLY_SET instances.
The remaining legacy methods have been ported to SHAPE_POLY_SET;
mainly: Chamfer, Fillet, {,Un}Hatch.
The iteration over the polygon vertices have been simplified using the
family of ITERATOR classes.
This just uses the same hatch lines that are built into the zone as
legacy.
They are always drawn, even when there is a fill, as if the fill
doesn't reach the corners, the hatches can be seen.
Fixes: lp:1487043
* https://bugs.launchpad.net/kicad/+bug/1487043
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas. When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
If a line has zero thickness, use the outline thickness to draw it.
This avoids having invisible items on the PCB that could still end up in
outputs, or "losing" an item by setting thickness to 0.
This only affects GAL drawing routines, the PCB data structures are not
affected, so any outputs will be the same.
Fixes: lp:1501749
* https://bugs.launchpad.net/kicad/+bug/1501749