Commit Graph

626 Commits

Author SHA1 Message Date
Jeff Young 1d7c5dce70 Don't attempt to write zone-connection-layers to footprint library.
Fixes https://gitlab.com/kicad/code/kicad/issues/12857
2022-11-08 12:13:15 +00:00
Jon Evans dd94b2d3a7 Rename PROPERTIES to STRING_UTF8_MAP for clarity
This class has nothing to do with the properties system
2022-11-06 11:51:52 -05:00
Jeff Young cef7cd8f7c Move default font to RENDER_SETTINGS.
Fixes https://gitlab.com/kicad/code/kicad/issues/12723
2022-10-22 21:32:42 +01:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Jeff Young 437d2c4589 Overhaul of remove-unconnected's zone filling and drawing strategies.
1) The highest priority zone that a via/pad collides with "owns" its
connectivity state.  Once set, lower priority zones cannot change it --
and in fact, if they would have connected to it are forced not to.

2) The connectivity state goes with the zone fill state, and therefore
must be saved in the file.

3) Display of remove-unconnected's pads is no longer done in GetViewLOD()
(which isn't called for selected items), and is instead done in PCB_PAINTER.
This allows us to draw the full pad in outline mode when a via/pad is
selected which would otherwise only show the hole.

4) Note that in some cases this will still generate DRC errors -- in
particular when a via nearly collides with a higher priority zone it
won't get "owned" by that zone and may therefore have insufficient
clearance if said zone concludes it's unconnected and a subsequent
(lower priority) zone connects to it (causing it to now become flashed).

Fixes https://gitlab.com/kicad/code/kicad/issues/11299
2022-10-18 13:05:42 +01:00
Jeff Young d1fb32f26c Formatting. 2022-10-15 19:09:25 +01:00
Jeff Young 0d7185c2ff Fix mismatch between PCB_VIA defaults and file format defaults. 2022-10-15 11:17:58 +01:00
Jeff Young 46a41e2e34 Pin 0-sized pads at 1um rather than throwing them out.
(See bug report for more commentary.)

Fixes https://gitlab.com/kicad/code/kicad/issues/12617
2022-10-13 14:47:50 +01:00
Jeff Young 64a6fc0fd4 Push UNITS_PROVIDER down into a low-level mixin.
This allows us to also construct cheap UNIT_PROVIDERs for specific
tasks when necessary.
2022-09-19 17:10:59 +01:00
Marek Roszko ece23d434b Split up Double2Str to a format function to make its use case clear 2022-09-17 00:10:22 -04:00
Marek Roszko 3d5913c825 Remove convert_to_biu.h, merge contents to base_units.h 2022-09-16 21:09:28 -04:00
Marek Roszko 66e8931405 Remove IU_PER_MM thats standalone 2022-09-16 21:09:27 -04:00
Marek Roszko e6ed275c25 Repoint IU_PER_MILS 2022-09-16 21:09:26 -04:00
Marek Roszko a8613ee80f Combine Iu2Millimeter & remove PcbMm2iu 2022-09-16 21:09:26 -04:00
Mark Roszko b00178adb3 Nuke base_units from orbit 2022-09-16 04:38:10 +00:00
Jeff Young 281b9d405a ADDED ability to specify where pad number (& net name) go on custom shaped pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/6627
2022-09-14 11:37:20 +01:00
Roberto Fernandez Bautista fa5dc23797 CADSTAR PCB: Fix regression when loading pads in footprints
Zero sized pads can be valid - e.g. a through hole pad
2022-09-04 00:59:57 +02:00
Roberto Fernandez Bautista 9abf3438b8 CADSTAR PCB: Invert logic for guessing which layer is top / bottom
Ensures correct automatic layer mapping is applied to the design in
https://gitlab.com/kicad/code/kicad/-/issues/12349
2022-09-04 00:59:57 +02:00
Roberto Fernandez Bautista c961624d43 CADSTAR PCB: Load 2-point polygons as line segments
Fixes asserts when loading design from https://gitlab.com/kicad/code/kicad/-/issues/12349
2022-09-04 00:59:57 +02:00
Roberto Fernandez Bautista 21b3753e9b CADSTAR PCB: Parse Teardrops
Todo: We need to figure out how we will load teardrops. For now
just drop them on import.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12349
2022-09-04 00:59:56 +02:00
Jeff Young 9188838e50 RIP EDA_RECT. 2022-08-31 23:57:24 +01:00
Jeff Young b4492e0bd2 More EDA_RECE yeetage. 2022-08-31 17:19:50 +01:00
Jeff Young 5679b9dbdc Remove a few EDA_RECT instances. 2022-08-31 01:22:49 +01:00
Jeff Young 0c8787cbb9 Some more wxPoint/EDA_RECT yeeting. 2022-08-31 00:44:33 +01:00
Seth Hillbrand b736460e71 Move optional access from value() to *operator
`value()` throws.  Where we check for existence, we don't need to use
the throwing version and should just use the unprotected variant
2022-08-30 13:59:39 -07:00
Marek Roszko 03aa63bd50 Move 5 helpers to EDA_UNIT_UTILS since they aren't iu specific 2022-08-29 20:11:03 -04:00
Marek Roszko bf964d8678 Commonize page_info by simply making the Iu scale a parameter on call. 2022-08-27 13:36:00 -04:00
Seth Hillbrand 146495672e Utilize our combine_hash routine for multiple hash
We should be using the one routine every time we want to build a hash
from indepedent values rather than rebuilding it differently in multiple
places
2022-08-26 08:45:13 -07:00
Seth Hillbrand f1261e71d4 Replace boost::optional with std::optional 2022-08-25 15:50:47 -07:00
Jeff Young ec51955dad Remove vestiges of old pad locking system.
We now use a session preference (Allow free pads) in the board editor,
and we never supported pad locking in the footprint editor.
2022-08-23 18:02:16 +01:00
Seth Hillbrand 4b63c7012d Silence some clang warnings 2022-08-22 12:54:00 -07:00
Wayne Stambaugh c72457482c Fix Eagle plugin footprint QA test issue.
Apparently mapping Eagle footprint layers to the KiCad Dwg_User
that were previously mapped to UNDEFINED_LAYER breaks the QA test
and causes the footprint editor to crash when opening Eagle
footprints.  This means that the potential data loss issue when
loading Eagle footprints is still in play.
2022-08-22 09:11:30 -04:00
Wayne Stambaugh 0bc1188897 Fix Eagle plugin board layer mapping issue.
The Eagle plugin layers have to be mapped differently depending on
whether a board is being imported or a footprint library is being
cached.  Footprint libraries can bypass the manual layer remapping
step that happens when importing a board.

Please note that when loading footprints in the footprint editor
and viewer, all layers that do not directly map to KiCad layers are
put on the Dwg_User layer so that there is data loss.  Users will
have to manually remap objects to the correct layer as required.
This is less than ideal but until the footprint library table parser
supports prompting users to remap unknown layers, it will have to do.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11839
2022-08-21 14:56:04 -04:00
Jeff Young 46df421064 ADDED defined pad groups for net-tie footprints
Each pad group is allowed to short nets with other pads in its group.

Legacy footprints with the "net tie" keyword hack will get a single
group auto-created with all the footprint's pads in it.

DRC and the router now allow a track to collide with copper graphic items
while entering a net-tie pad as long as the closest point in the collision
is within the pad.

DRC (and the footprint checker) now check for copper items in the
footprint shorting pads which are not in the same pad group.

Fixes https://gitlab.com/kicad/code/kicad/issues/2265
2022-08-19 18:54:20 +01:00
Seth Hillbrand 35ac39844f Clean up some auto usage
Don't make new copies of shared_ptr if we can use references.  Keep auto
usage down to hard-to-type-out sequences
2022-08-15 11:29:45 -07:00
Jeff Young db91bcbabf Bump file format version for allow-soldermask-bridges-in-FPs. 2022-08-15 18:03:03 +01:00
Seth Hillbrand 9828360759 Remove unused variable 2022-08-15 07:52:53 -07:00
Marek Roszko c418b25756 Centralize the parseDouble functions in the parsers and gcc specialcase 2022-08-14 18:46:19 -04:00
Jeff Young 86938aa425 Read, write and process the board-wide Allow soldermask bridges in FPs. 2022-08-14 22:56:29 +01:00
Jeff Young a9536b5de9 CHANGED netclass assignments now done via canvas or via patterns. 2022-08-14 22:56:29 +01:00
Roberto Fernandez Bautista 6b349fdb0a CADSTAR PCB: Allow remapping all non-electrical layers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12196
2022-08-14 22:24:17 +01:00
Roberto Fernandez Bautista 69d696660b cadstar: Report warning that imported text may be different
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12195
2022-08-14 22:24:16 +01:00
Marek Roszko a070959209 Switch from strtod to std::from_chars for performance 2022-08-14 16:19:24 +00:00
Seth Hillbrand 2ee65b2d83 Force removal of zero-sized pads on load.
Pads with zero width or height cause issues when rendering and
selecting.  KiCad has never allowed these elements but hasn't prevented
importing systems where they exist.  This prevents their import and
cleans existing designs where the pads are placed

Fixes https://gitlab.com/kicad/code/kicad/issues/12200
2022-08-13 19:10:48 -07:00
Marek Roszko f695ae5522 Generate const keyword_hash maps at compile time
Or else the map gets pointlessly recreated during footprint loading thousands of times
2022-08-09 00:56:49 -04:00
Jeff Young 96f01d33c8 Performance improvements.
1) Move a bunch of std::map's to std::unordered_map to get constant-time
look-ups
2) Lengthen progress-reporting intervals to spend more time doing work
and less time talking about it
3) Reverse order of SHAPE_LINE_CHAINs in thermal intersection checks to
make (much) better use of bbox caches
4) Don't re-generate bboxes we already have
5) Fix some autos that weren't by reference (and were therefore copying
large datasets)
6) Rename delta progressDelta so it's easier to search for in future
7) Get rid of a few more autos (because I don't like them)
8) Pass large items to lambdas by reference

Fixes https://gitlab.com/kicad/code/kicad/issues/12130
2022-08-03 11:59:42 +01:00
jean-pierre charras 49bf717c0e fix minor compil warnings 2022-07-17 20:29:59 +02:00
Jeff Young aa9fe58abe Don't duplicate user-defined track widths, via sizes or DP dims...
... when appending to board.

Fixes https://gitlab.com/kicad/code/kicad/issues/12014
2022-07-15 20:52:08 +01:00
Jeff Young 2de10080cd Add edge and margin clearances to message panel. 2022-07-15 16:14:32 +01:00
jean-pierre charras 50bb7c93a1 Fix bug in commit 64e1720f 2022-07-15 17:03:05 +02:00
jean-pierre charras 64e1720f12 FP_SHAPE in pads: always specify fill mode for shapes that can be filled or not.
Fixes #12012
https://gitlab.com/kicad/code/kicad/issues/12012
2022-07-15 16:50:38 +02:00
Mike Williams 99f8b21ed1 PCB: Add bitmap layer per board layer 2022-07-14 11:23:23 +00:00
Mike Williams 3669cb4673 PCB Editor: Add User Background Images 2022-07-14 11:23:23 +00:00
Seth Hillbrand a9a5136c1c Always allow blind/buried/micro vias
Removes a nanny setting that prevented the use of
blind/buried/micro-vias without a checkbox.  If the designer does not
want microvias in their board, they simply do not place microvias.
2022-07-12 19:47:31 -07:00
Wayne Stambaugh 6a74ecbffd Pcbnew: fix minor white space issue in board file.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11669
2022-07-11 11:21:45 -04:00
Seth Hillbrand 0c47a09517 Ensure rectangles are normalized
Normalize on creation and fixup rectangles previously saved with
inverted coordinates

Fixes https://gitlab.com/kicad/code/kicad/issues/11965
2022-07-07 10:40:18 -07:00
luz paz af6ba1a16e Fix typos in pcbnew sub-directory
Found via `codespell -q 3 -S *.po,./thirdparty,./Documentation/changelogs -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,ba,busses,dout,einstance,leaded,modul,ontext,ot,overide,serie,te,,tesselate,tesselator,tht`
2022-06-30 09:39:45 -04:00
jean-pierre charras c8ce01ce8e pcb_parser: fix an incorrect CHECK_MSG when parsing a dimension in a footprint.
this incorrect CHECK_MSG created a crash.
Fixes #11859
https://gitlab.com/kicad/code/kicad/issues/11859
2022-06-20 10:42:19 +02:00
jean-pierre charras f20cb0fda8 Activate teardrops: remove advanced config option and add teardrop keywords in files. (the ability to read teardrop keywords was added some time ago) 2022-06-17 19:42:27 +02:00
jean-pierre charras 9fd5ee5a2f paper min size set to 1 inch (previously 0.1 inch, very small indeed)
Avoid using magic numbers in file pcb_parser.cpp.
Fixes #11807
https://gitlab.com/kicad/code/kicad/issues/11807
2022-06-13 17:51:29 +02:00
Seth Hillbrand ac0f95683f Sort PCAD layers
Better fix for 11750.  Instead of figeting with layer values, we sort
our map based on the layer numbers in the PCAD file.  F_Cu is always
layer 1 and B_Cu is always layer 2.

Fixes https://gitlab.com/kicad/code/kicad/issues/11750
2022-06-09 11:10:34 -07:00
Seth Hillbrand e857622dd4 Handle B_Cu ordering
Stopgap until we introduce multi-layer mapping widget

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

(cherry picked from commit 32aabaf010)
2022-06-08 17:19:37 -07:00
Seth Hillbrand 124bdb6673 Check for older tags in pcad import
The pourOutline/planeOutline do not include support for fillets

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

(cherry picked from commit 72b7f9fe10)
2022-06-08 16:27:17 -07:00
Seth Hillbrand 6c0856c384 Fix PCAD silk layer for solder-side fp
The layer should be flipped based on the footprint mirror value rather
than the text mirror value (which is independent)

Fixes https://gitlab.com/kicad/code/kicad/issues/11652
2022-05-31 13:03:32 -07:00
Jeff Young 155620cc9a Move H/V/45 mode from zone properties to toolbar.
Fixes https://gitlab.com/kicad/code/kicad/issues/8587
2022-05-29 21:30:15 +01:00
Seth Hillbrand 35b79c2ec9 Make PCAD import case-insensitive
According to the PCAD specification, all tags are case insensitive.
Most exporters honor the defaults but there is always an outlier or two

Fixes https://gitlab.com/kicad/code/kicad/issues/11652
2022-05-27 10:09:40 -07:00
Jeff Young 4afca58ce7 Eagle octagonal pads are regular (~29% chamfered).
Also cleans up setting of KeepTopBottom (which is ignored unless
we're doing optional flahing -- which we're not for Eagle imports).

Fixes https://gitlab.com/kicad/code/kicad/issues/11664
2022-05-23 10:43:34 +01:00
Marek Roszko 88c7322a0d EDA_TEXT Get/SetTextSize should use VECTOR2I 2022-05-14 08:16:15 -04:00
jean-pierre charras 5c7a79e287 (WIP) Teardrop: use a specific attribute in .kicad_pcb file to identify teardrops
the new attribute is:
"(attr (teardrop type padvia)))" or "(attr (teardrop (type track_end)))"
However (Work in Progress) writing this attribute in file is temporarily disabled.
2022-05-14 09:50:00 +02:00
Jeff Young 37aa42d1e3 Don't allow Edge_Cuts or Margin in footprint private layers.
Fixes https://gitlab.com/kicad/code/kicad/issues/11431
2022-04-27 17:14:33 +01:00
jean-pierre charras 1e80f3a65a pcad importer: fix a truncation when converting mils to IU. The value in mils is a double, but the function to convert in IU uses int. Fixes #11380 https://gitlab.com/kicad/code/kicad/issues/11380 2022-04-21 10:01:59 +02:00
Jeff Young 9b087a3c25 Add automatic precision choices for dimensions.
Fixes https://gitlab.com/kicad/code/kicad/issues/6690
2022-04-17 20:02:58 +01:00
jean-pierre charras e9da8c3a00 Ensure net_code is not used by non copper zones when saving the board file.
For some obscure reason, non copper zones inside footprints can have non 0 netcode.
Fixes #11395
https://gitlab.com/kicad/code/kicad/issues/11395
2022-04-15 13:19:35 +02:00
Jeff Young a33e23e25a Import radial dimensions from Eagle.
Fixes https://gitlab.com/kicad/code/kicad/issues/10763
2022-04-12 15:47:39 +01:00
Jeff Young 739f4d0a1e Improvements to Eagle dimension importing.
1) Import leaders
2) Drop radius and angle dimensions
3) Import dimension text sizes
4) Correctly interpret which side dimension offset is on
5) Correclty handle offsets for non-cardinal dimensions

Fixes https://gitlab.com/kicad/code/kicad/issues/10763
2022-04-12 15:47:39 +01:00
Jeff Young 2663ad5340 Implement Eagle text variables.
Also fixes two bugs:
1) subsequent text items that are marked >NAME or >VALUE will now get
imported as text items with ${REFERENCE} or ${VALUE} (instead of overwriting
the previous text item)

2) we no longer (accidentally) capitalize all text items.

Fixes https://gitlab.com/kicad/code/kicad/issues/11321
2022-04-10 17:29:47 +01:00
Jeff Young a23399a1af Formatting. 2022-04-10 17:29:47 +01:00
jean-pierre charras 5e52539939 eagle importer: fix incorrect conversion UTF8/wxString.
When importing a eagle board file using wxXmlDocument, the strings in eagle BOARD
(UTF8 encoded) are correctly converted to wxString (using unicode wide chars)
So trying to reconvert these strings using FROM_UTF8( <wxString>.c_str() )
is incorrect and can break initial string if non ASCII7 chars are found
2022-04-09 15:33:01 +02:00
Wayne Stambaugh 0bdbfe1446 Pcbnew: add plot on all layers feature.
ADDED: Any addition board layers can be plotted on all selected board layer
when plotting.

CHANGED: The new plot to all layers feature made the plot edge cuts option
obsolete.  Users must now select the edge cuts layer from the list of
plot to all layer selections to include edge cuts on all layers when
plotting.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2449
2022-04-02 14:33:40 -04:00
Thomas Pointhuber bd18e340f4 eagle: introduce *.lbr footprint import test
Bugs found but not fixed yet:
* Reference and Value are not converted correctly yet
  * HOTFIX: test commented out
* GP3906-TLP and UBLOX_ZOE_M8-0-10 are not able to import the description again
  * HOTFIX: description removed from gold file
2022-04-02 20:07:16 +02:00
Thomas Pointhuber 406c528ab7 altium: Create region for items on the KEEP_OUT_LAYER and use new Track unit-tests 2022-04-02 18:17:19 +02:00
Jeff Young a2d4351b97 Correct initialization of justification.
Fixes https://gitlab.com/kicad/code/kicad/issues/11248
2022-03-28 17:11:20 +01:00
Wayne Stambaugh 7da7864f5e Fix some Coverity issues. 2022-03-25 15:51:05 -04:00
Wayne Stambaugh 7b2d9dfc0c Fix some Coverity uninitialized scalar variable issues. 2022-03-24 13:17:07 -04:00
Jeff Young 1d66925f5f Enable bb and/or uvias when encountering them on Altium import.
Fixes https://gitlab.com/kicad/code/kicad/issues/10044
2022-03-22 22:33:51 +00:00
Jeff Young 118a37f19f Fix issues with importing NPTH pads from CircuitStudio.
Fixes https://gitlab.com/kicad/code/kicad/issues/10493
2022-03-22 18:08:05 +00:00
Jeff Young 3271b43d4b Formatting. 2022-03-22 18:08:05 +00:00
Thomas Pointhuber 79aafd1bd3 altium: support keepout restrictions in Arcs, Fills and Regions 2022-03-11 19:15:58 +01:00
jean-pierre charras 878c70c1ab Pcbnew: fix erroneous IslandRemovalMode default mode in board files.
The default is ISLAND_REMOVAL_MODE::ALWAYS in *.kicad_pcb files
2022-03-09 13:17:18 +01:00
jean-pierre charras b6aa5bd1ed Pcbnew: PCB_TEXT: save the Locked flag in file.
Previously, one could lock a graphic text on a board, but the lock state was not saved.
2022-03-08 17:35:26 +01:00
Jeff Young 293021c58c ADDED: knockout pcb and fp text.
Fixes https://gitlab.com/kicad/code/kicad/issues/7055
2022-03-08 13:22:20 +00:00
Thomas Pointhuber a9ebb42ecd altium: Parse keepout restrictions of tracks 2022-03-07 19:58:43 +01:00
Jeff Young 843a56c4e4 Implement two-staged zone priority: assigned priority followed by UUID. 2022-03-01 14:53:35 +00:00
Seth Hillbrand fab78af176 Remove TEDIT
This marker is not used in KiCad and creates merge conflicts when two
different users edit the same file
2022-03-01 00:25:44 +00:00
Steffen Mauch 78620347c8 Fixing Eagle refs that do not work with KiCad
KiCad has stricter requirements for what consititutes an annotated
symbol.  This checks for and corrects annotations that begin with '#',
do not begin with a non-numeric character or do not end with a number
2022-02-25 23:42:47 +00:00
Thomas Pointhuber 52a2d52bf0 altium: Parse solder and paste mask settings of tracks and arcs 2022-02-20 20:18:40 +01:00
Thomas Pointhuber 8ef7252330 altium: Don't use string concatenation for paths pointing in the compound file
* std::vector do not need to be split apart again
* supports backslash in footprint names
2022-02-19 16:46:20 +01:00
Thomas Pointhuber 86c025eb30 altium: Fix parsing of zones which use the KEEP_OUT_LAYER 2022-02-19 14:37:05 +01:00
Jeff Young 1ee3ce45e8 Don't ask for layer of multi-layer objects. 2022-02-18 14:19:13 +00:00
Jeff Young 89907a18ce Don't ask for layer of multi-layer object. 2022-02-18 13:30:40 +00:00