including wx.h is useless for this file, and include wx.h in a lot of other files.
Include wx.h must be made only when needed in a given file, because on Windows
it include some headers that frequently create collision with kicad declarations
Holes were correctly sorted by size, but inside the same hole size
the holes were strangely sorted.
Now holes are sorted by hole size, and (inside the same size) by position.
Fixes#6553https://gitlab.com/kicad/code/kicad/issues/6553
It shows much more detail. Removes some nag dialogs and places
hypertext links in others.
Also fixes the auto-layer-showing to correctly show Edge.Cuts or
F.CrtYd or B.CrtYd for errors relating to them.
Fixes https://gitlab.com/kicad/code/kicad/issues/6446
These objects can now be used in advanced DRC rules and
not just for keeping things out. Also remove the restriction
that at least one of the "basic" keepout rules must be set,
so that these areas can be used for more advanced rules.
1) better load-balancing for deferred zones
2) sort zones by priority before filling
3) retire BOARD::GetZoneList() which had a horrible performance profile
4) implement a zone bounding box cache
5) better checks for IsCancelled() so long fills can be exited
Fixes https://gitlab.com/kicad/code/kicad/issues/5738
If the zone fill failed, then don't add the zone to the
exported VRML because it might not be correct.
Also test that the Python command in DIALOG_SCRIPTING worked.
This dialog actually isn't used anywhere currently, so it
could in theory be removed - but it is simple enough and
it provides a decent testing dialog that it is more work to remove
it.
1) For a while now we've been using a calculated seg count from a given
maxError, and a correction factor to push the radius out so that all
the error is outside the arc/circle. However, the second calculation
(which pre-dates the first) is pretty much just the inverse of the first
(and yields nothing more than maxError back). This is particularly
sub-optimal given the cost of trig functions.
2) There are a lot of old optimizations to reduce segcounts in certain
situations, someting that our error-based calculation compensates for
anyway. (Smaller radii need fewer segments to meet the maxError
condition.) But perhaps more importantly we now surface maxError in the
UI and we don't really want to call it "Max deviation except when it's
not".
3) We were also clamping the segCount twice: once in the calculation
routine and once in most of it's callers. Furthermore, the caller
clamping was inconsistent (both in being done and in the clamping
value). We now clamp only in the calculation routine.
4) There's no reason to use the correction factors in the 3Dviewer;
it's just a visualization and whether the polygonization error is
inside or outside the shape isn't really material.
5) The arc-correction-disabling stuff (used for solder mask layer) was
somewhat fragile in that it depended on the caller to turn it back on
afterwards. It's now only exposed as a RAII object which automatically
cleans up when it goes out of scope.
6) There were also bugs in a couple of the polygonization routines where
we'd accumulate round-off error in adding up the segments and end up with
an overly long last segment (which of course would voilate the error
max). This was the cause of the linked bug and also some issues with vias
that we had fudged in the past with extra clearance.
Fixes https://gitlab.com/kicad/code/kicad/issues/5567
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.
There is still some debugging output in test code that really needs to
be moved into a unit test.
Add debugging output section to the coding policy regarding debugging
output.
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.
The previous hash was not unique for changes in integer/boolean values.
Generic hash_combine routines provide decent coverage for limited extra
cycles.
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.
ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
ADDED new rectangle graphics tool for PCBNew and Footprint Editor.
Also adds rectangle tool to both Footprint Editor and PCBNew Place
menus.
The Aux Origin tool can come back once we have multi-select toobar
buttons.
Also collapses an unnecessary level out of the auxOrigin and gridOrigin
settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/2246
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).
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.
These formats use a defined page size (currently A4), and therefore
the drill list cannot be outside the page.
When there are a lot of drill diameters it can happen.
Now the long lists are plotted on more than one column.
Plot Gerber format default values: X2 attributes enabled.
Gerber job file: use a trick to truncate floating values to 4 digits in mantissa.
It gives a much better readability and 0.1 micron is enough for
mechanical dimensions
Replace SEVERITY_ERROR by RPT_SEVERITY_ERROR to avoid collision with a system definition.
Replace other SEVERITY_XXX by RPT_SEVERITY_XX for consistency.
Fix compil warnings and some other compil issues.
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.
Remove the CACHE_WRAPPER whose sole purpose was to allow the
cache to be stored in the project, and instead just have the cache
inherit the proper class.
* 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.
Property is a pad info used mainly for fabrication or test.
Currently, supported properties are:
BGA property (variant of SMD pad)
Fiducial (global to the board or local to the footprint)
Test Point
Heat sink
Castellated.
And are used in Gerber files (copper layers and drill files)
Increment BOARD_FILE_VERSION to 20200104
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines. To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
The pin name defined in Eeschema is now available as pad info.
Useful for the board designer (the pin function is displayed in the message panel).
Needed for the Gerber P&P files.
Therefore, for some footprints, the right footprint was not associated to the component.
The hash calculation was using a XOR to combine 2 sub hash values.
This is not a strong way to combine these hash values.
They are now added. Looks better to identify similar and different footprints.
Fixes: lp:1847575
https://bugs.launchpad.net/kicad/+bug/1847575
create_vrml_shell() needed the idxSide check but create_vrml_plane only
had an extra variable that wasn't used and so shouldn't be checked.
(cherry picked from commit c9956def36)
In rare cases, the VRML triangulator may claim to work but return empty
vectors. These cases need to be caught before we dereference the vector
elements.
Fixes: lp:1838448
* https://bugs.launchpad.net/kicad/+bug/1838448
(cherry picked from commit 161dc9ce7e)
Make the data generation code separate from the dialog code.
The dialog itself does not include anymore the data generation code.
Non SMD footprints forced in list are now displayed in the dialog.
The attribute MOD_CMS is no longer silently modified (without undo command) by the dialog.
In .gbrjob file, one can specify the thickness and color of some layers.
Currently, there is no way to enter these parameters.
This commit prepare a better support of .gbrjob files.
Oblong holes (slots) use now a aperture attribute similar to round holes.
(The previous attribute "slot" is now deprecated)
However they have a specific aperture, and a comment is added in drill files for these apertures.
* Circular gal<->common dependency bites again. Add 'common'
again to the 'kicad' target's link libraries. libgal.a depends
on SHAPE_POLY_SET in common, but common depends on gal. This is
not a real fix, but it unsticks Linux compilations. Fixing the
circular dep is an existing bug: https://bugs.launchpad.net/kicad/+bug/1832229
* Missing LEGACY_HK_NAME for ACT_EndTuning: this was probably accidentally
allowed on some other platform due to different wxString constructors.
On Linux/GCC, it breaks.
* Unused include from /kicad in export_vrml.cpp. This is not findable
on Linux, as pcbnew does not include the right dirs for this to be
found. But it's not used, so just remove it.
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)
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.
Added checks to StrCmpNum() function in common/sting.cpp to prevent
iterating past the end of the sting. Also removed length of string
parameter since it did not seem to be used anywhere.
Fixes lp:1818157
https://bugs.launchpad.net/kicad/+bug/1818157
Using the normal command, oval holes are "drilled" by a route command.
Some board houses do not accept this normal command.
In this case, the drill dialog allows using an other Excellon drill command (a slotted hole).
Note also some board houses do not understand this alternate command!
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.
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.
It can be used instead of the slot (G85) command to create oval holes.
Do not yet activate it.
Oval holes frequently create issues with board houses.
Using a more usual routing (G01) command could solve some issues.
Small icons for dialog browse, refresh, and row operations.
Icons in B&W so they don't over-emphasize with respect to other
controls in the dialog.
Layout cleanup for consistency. Removal of the blank space to
left of the fields list in the Global Fields Editor, and addition
of column-sizing-to-list-width.
More even spacing for buttons in html report panel.
Honor platform conventions for action button order and layout.
Move netlist importer to update-pcb-from-schematic algorithm
(display messages and then update instead of "dry run" checkbox)
(cherry picked from commit b21e19d)
In case there are zero width oval holes on the PCB,
it is safer to not plot them at all, rather than plotting
with width arbitrarily increased to 10 mils.
This also makes Gerber outputs consistent with Excellon outputs.
m_Zone is a fully deprecated list of SEG_ZONE items (similar to TRACK), used to fill copper zones in *very old* boards.
it is even unlikely there are still boards that use them.
So it should be removed one day.
Corrected polygon export missing vertex.
Set pads to export on copper layer when not masked, keeping visual
output similar to physical.
Fixes: lp:1766634
* https://bugs.launchpad.net/kicad/+bug/1766634
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
- Display offset units in 3D preview window (inches or mm)
- Fix offset in 3D renderer
- Fix offset in Raytracing renderer
- Fix offset in STEP export
- Fix offset in VRML export
The GTK+ file dialog is case sensitive however it does support regular
expressions. Most of the file dialog wildcards are lower case so only
files with the lower case extensions will show up in the file dialog.
This code adds a method to convert file extensions of any case to the
appropriate (sch -> [sS][cC][hH]) regular expression on GTK+ builds so
all file extension case combinations will show up in the file dialog.
A note to developers: make sure to add a file extension when setting
when setting the default file argument. If you do don't set an
extension, the GTK+ file dialog will happily append the regular
expression as the file extension which is surely not what you want.
There are still a few known places (mostly gerbview) where there are
some complex wildcard code that has not been converted.
Fixes lp:1720542
https://bugs.launchpad.net/kicad/+bug/1720542
- Display offset units in 3D preview window (inches or mm)
- Fix offset in 3D renderer
- Fix offset in Raytracing renderer
- Fix offset in STEP export
- Fix offset in VRML export
Added an option to the exporter dialog allowing the user to choose
either the absolute or the auxiliary origin. Also, the ORIGIN field in
the exported file can be set to contain the information about the origin
point or set to (0, 0) for compatibility with other CAD tools.
Previously the component to shape map contained
a lot of duplicated strings. Now the map stores
the component shape hash used for getting the
name from another map.
- 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
This forces the compiler class specific features rather than borrowing
from the base class's std::string. In some cases prior to this,
wxString( std::string ) was being called rather than UTF8::operator
wxString() leading to garbled wxStrings.
Added function UTF8::wx_str() which is of great convenience also.
Implicit conversions still work as before, and hopefully more reliably.
This commit was too broad and not cognizant of the purpose of the class
UTF8.
Add MAYBE_VERIFY_UTF8() macro, which can trap non-UTF8 encoded strings in
debug builds.
Use that macro conditionally in class UTF8 to trap non-UTF8 encoded strings
being put into UTF8 instances.