Commit Graph

209 Commits

Author SHA1 Message Date
Seth Hillbrand a6eb6d3228 Default to SMD if we have an SMD pad
SMD pads indicate that the footprint can be used in PnP more often  than
the presence of THT indicate that it cannot.

Fixes https://gitlab.com/kicad/code/kicad/issues/13387
2023-01-05 16:56:07 -08:00
Jon Evans 5eb3f5d3e7 Use correct translation macro for group names
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13277
2022-12-26 20:11:20 -05:00
jean-pierre charras ec4fd42bee Pcbnew: force courtyard area shape rebuild afret rotation/flip.
Fixes #13039
https://gitlab.com/kicad/code/kicad/issues/13039
2022-11-30 09:07:32 +01:00
Jon Evans 81ab8a0499 Properties: Move orientation to basic 2022-11-29 18:56:15 -05:00
Marek Roszko 25d5defc10 Add cli for "fp" upgrade 2022-11-28 20:48:14 -05:00
Jon Evans b2b3f5752f Properties: Add grouping and sorting by creation order 2022-11-27 22:40:23 -05:00
Jon Evans 74a2e4cad9 Properties: Add support for zone connection style 2022-11-25 18:44:02 -05:00
Jon Evans 96fe93618e Properties: Stop sorting by name
It's more useful to have properties shown in add order,
since we can group them
2022-11-25 16:29:56 -05:00
Jon Evans 220ef6fb44 Properties: Add some missing footprint properties; cleanup
Add concept of "internal" properties that will be accessible from
Python/DRC but not shown in the Properties Manager
2022-11-25 12:37:47 -05:00
Jeff Young 4aff5c7618 Keep courtyard caches alive during move.
Fixes https://gitlab.com/kicad/code/kicad/issues/12999
2022-11-25 17:20:11 +00:00
Jon Evans 11e784cf10 Properties: specialize layer setting for footprints
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12480
2022-11-24 22:11:26 -05:00
Jeff Young d6ae915616 Pay attention to layers when sorting pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/10143
2022-11-24 15:47:10 +00:00
Jeff Young 03ba14c6d3 Tighten lifecycle management of parent group pointers.
Also adds some debugging to try to catch dangling pointers.

Also adds a cache for group bounding boxes (which will be expensive
to calculate for large groups).

Fixes https://gitlab.com/kicad/code/kicad/issues/12875
2022-11-11 17:27:28 +00:00
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Jeff Young 73e1676bdb Fix const-reference property access.
Fixes https://gitlab.com/kicad/code/kicad/issues/12639
2022-10-15 20:22:38 +01:00
Jeff Young b012cc1ac3 Don't resolve footprint text variables in footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/12658
2022-10-15 16:05:22 +01:00
Jeff Young 6f9bc0980b Refactor poly outline generator to handle multiple outlines.
Note: disjoint outlines are handled in footprint courtyards, but not
for board outlines.

Fixes https://gitlab.com/kicad/code/kicad/issues/7660
2022-10-14 20:32:04 +01:00
Jeff Young adbbceacda Make footprint type check more narrow, and set default to ignore. 2022-10-02 18:19:43 +01:00
Jeff Young 503385f52e Don't use FindNamedPad for net-tie logic. It only reutrns the *first*
pad of a given number.

Also improves other DRC logic to tighten up the net-tie rules now that
we know which pads are allowed to short with which other pads.

Also removes the "Overlapping pads" DRC violation now that we know
whether or not overlapping pads in a net-tie footprint constitute a
short.

Fixes https://gitlab.com/kicad/code/kicad/issues/12506
2022-09-25 17:38:31 +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 a8613ee80f Combine Iu2Millimeter & remove PcbMm2iu 2022-09-16 21:09:26 -04:00
Jeff Young 57f9d6cb3d ADDED text variables for pad NET_NAME, NET_CLASS and PIN_NAME.
Fixes https://gitlab.com/kicad/code/kicad/issues/6405
2022-09-12 00:55:57 +01:00
Jeff Young c0ba1b35bf Remove SMD pad side sanity check. 2022-09-05 10:41:37 +01:00
Jeff Young d5cf7828fa ADDED footprint checks for SMD pad consistency.
Fixes https://gitlab.com/kicad/code/kicad/issues/11736
2022-09-04 10:34:32 +01:00
Jeff Young b4492e0bd2 More EDA_RECE yeetage. 2022-08-31 17:19:50 +01:00
Jeff Young f17a865593 Move EDA_ITEM hitTest to BOX2I. 2022-08-31 17:18:45 +01:00
Jeff Young 2dc6300501 Move EDA_ITEM bounding boxes to BOX2I. 2022-08-31 10:16:55 +01:00
Jeff Young 5679b9dbdc Remove a few EDA_RECT instances. 2022-08-31 01:22:49 +01:00
Jeff Young 86944c4f9f Marginal performance improvements. 2022-08-26 13:22:57 +01:00
Roberto Fernandez Bautista 940a15c547 Todo: Properties system doesn't like const wxString& getters
Comment out for now
2022-08-22 21:32:33 -04:00
Maciej Suminski af71d42307 Renamed PROPERTY_TYPE enum names to avoid a conflict on MSYS2 2022-08-22 21:32:32 -04:00
Maciej Suminski 95fd58b25a Properties meta-data for pcbnew classes 2022-08-22 21:32:00 -04:00
Jeff Young 4f0136db3b Attempt to fix std::initializer_list lifetime issue. 2022-08-21 20:54:41 +01:00
Jeff Young aa2ad3b44c Move KICAD_T[] to std::initializer_list<KICAD_T>. 2022-08-20 10:28:11 +01: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 97d7ee1f30 Remove `/` from our forbidden LIB_ID list
It is still forbidden from footprint file names but that is handled
separately and it should not be forbidden in symbol files at all
2022-08-18 12:49:40 -07: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
Jeff Young 43df863df2 Fix issue with caches not being initialized when printing msg bar. 2022-08-01 13:09:51 +01:00
Marek Roszko a8505d9c76 SEARCH_RESULT -> INSPECT_RESULT
To fix the name squatting it's doing for future functionality
2022-07-29 20:01:10 -04:00
Jeff Young f41af10007 Clean up hole shapes for safety (smart pointer) and consistency. 2022-07-22 23:06:07 +01:00
Jeff Young 1ade5a8c72 Fix typo.
And clean up the code just a little to make it clearer.

Fixes https://gitlab.com/kicad/code/kicad/issues/12022
2022-07-17 17:04:04 +01:00
Mike Williams 3669cb4673 PCB Editor: Add User Background Images 2022-07-14 11:23:23 +00:00
Jeff Young 8a9bf02b7e Smarten up silk clearance & tented item handling.
The inspection tool will report whether or not the item is tented
(indicating in that case that any clearance will only be applied
to any hole).

The DRC test ignores tented items without a hole, and runs the
clearance test against the hole for items with a hole.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/11951
2022-07-08 17:27:05 -06:00
Jeff Young aad85a83da Improvements to rotation/mirroring of dimensions inside footprints.
Fixes https://gitlab.com/kicad/code/kicad/issues/11861
2022-06-20 22:25:39 +01:00
jean-pierre charras d19705ac8c FOOTPRINT::Flip(): add missing handle of dimensions. 2022-06-20 11:37:25 +02:00
Jeff Young 82ebc247b8 More performance enhancements for DRC. 2022-06-18 19:47:11 +01:00
Jeff Young dee22a31d9 Expose footprint ID, description and keywords to property system. 2022-06-01 12:47:37 +01:00
jean-pierre charras 57e59a4959 Pcbnew, on line DRC when moving footprints: add visible collisions between courtyards 2022-05-20 12:58:05 +02:00
Jeff Young 37838dffb9 Make sure physical_clearance rules are run against courtyard layers. 2022-05-10 23:02:53 +01:00
Jeff Young 3bdae40881 Remove extra layer of parens. 2022-04-24 23:44:02 +01:00
Jeff Young 4cd48cd5c9 Fix some test issues. 2022-04-23 22:15:39 +01:00
Jeff Young 4525b1f085 More consistency in DRC error messages. 2022-04-23 09:39:34 +01:00
Jeff Young ab131859f6 Bring footprint textvars in line with symbol textvars.
ADDED ${FOOTPRINT_LIBRARY} and ${FOOTPRINT_NAME} resolution.
2022-04-18 22:45:02 +01:00
jean-pierre charras 74c3ad0b3a Shadow on locked fp: do not show if LAYER_MOD_FR or LAYER_MOD_BK is not shown 2022-04-12 11:17:04 +02:00
Jeff Young 73f835437e Don't modify outer loop variable inside inner loop. 2022-03-19 19:37:01 +00:00
Jeff Young 5aa561abe1 Add overlapping pad test and share some tests between board & fp editor DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/10086
2022-03-18 19:58:42 +00:00
Seth Hillbrand 442aae19d9 Separate flashing check for connectivity
When building the connectivity database, we should not be using the
connectivity to check for shapes.

To make this deterministic, we introduce two flags (ALWAYS_FLASH and
NEVER_FLASH) that are used with connectivity building to determine
whether a pad is flashed for connectivity or not.  ZONE <-> PAD/VIA
connectivity will be checked with ALWAYS_FLASHED and all other
connectivity will be checked with NEVER_FLASHED if they are marked for
potential annular ring removal.  If they are not marked for removal,
they will be checked ALWAYS_FLASHED.

Fixes https://gitlab.com/kicad/code/kicad/issues/11114
2022-03-16 17:30:01 -07:00
Jeff Young 65185f53a1 Rotate fp zones before comparing with library versions.
Also includes some performance fixes to not copy around triangulation
data when it's not needed.

Fixes https://gitlab.com/kicad/code/kicad/issues/10143
2022-03-14 15:53:24 +00:00
jean-pierre charras 0440aa3d83 Extend layer LAYER_LOCKED_ITEM_SHADOW to draw shadow markers on other locked items:
tracks, texts, graphics.
2022-03-09 18:50:31 +01:00
jean-pierre charras 016af235db Pcbnew: add a GAL layer (LAYER_LOCKED_ITEM_SHADOW) to draw markers on locked footprints 2022-03-09 17:54:58 +01:00
Jeff Young 0dc857b5ab Clean up pad handling in 3D viewer.
Most importantly, create F_Cu/B_Cu layers if they're otherwise empty
but we have plated pads to render on them.

Fixes https://gitlab.com/kicad/code/kicad/issues/10207
2022-03-06 13:57:12 +00:00
Jeff Young 843a56c4e4 Implement two-staged zone priority: assigned priority followed by UUID. 2022-03-01 14:53:35 +00:00
jean-pierre charras 2fddc9daf3 Pcbnew: fix missing connectivity update when adding an item.
Skipping connectivity update when adding an item is possible only when loading a file
Fixes #10879
https://gitlab.com/kicad/code/kicad/issues/10879
2022-02-18 13:24:14 +01:00
Jeff Young 2172810600 Performance: better sharing of zone fills. 2022-02-15 19:19:03 +00:00
Jeff Young 5ce559176d Overhaul the font metrics calcs for overbar, italics and bboxes. 2022-02-07 17:36:40 +00:00
Jeff Young 7ccac79192 More wxString wide literals. 2022-02-05 21:29:34 +00:00
Marek Roszko b9f1aaf029 Fix typoed test condition for TH no hole pads PVS V501 2022-02-05 11:31:56 -05:00
Jeff Young 42917874dd Add duplicated items to parent group.
Fixes https://gitlab.com/kicad/code/kicad/issues/10155
2022-02-04 14:26:57 +00:00
Jeff Young 5739505aa3 TextBoxes for PCBNew. 2022-01-31 20:00:47 +00:00
Jeff Young 4eac8d7c66 Remove unit-less angles from geometry lib APIs. 2022-01-20 21:10:04 +00:00
Jeff Young 037dfb6e01 Move FP_TEXT::KeepUpright() to EDA_ANGLE. 2022-01-14 16:08:19 +00:00
Jeff Young c9487bad18 Move BOARD_ITEM::Rotate() to EDA_ANGLE. 2022-01-14 16:08:19 +00:00
Jeff Young abd3f5bc2b Move footprints to EDA_ANGLE. 2022-01-14 16:08:18 +00:00
Jeff Young d485eb2514 Move pads to EDA_ANGLE. 2022-01-14 16:08:18 +00:00
Marek Roszko fcfe42d67c Continue the war on wxPoint 2022-01-10 19:52:26 -05:00
Marek Roszko e4dbfcd92d Swap out some wxSize for VECTOR2I 2022-01-04 20:42:27 -05:00
Marek Roszko ea613cf448 Another batch of point changes 2022-01-01 13:17:12 -05:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Jeff Young d649b288a6 Swap out autoplace rotation costs for private footprint layers.
Fixes https://gitlab.com/kicad/code/kicad/issues/2291

Fixes https://gitlab.com/kicad/code/kicad/issues/5391
2021-12-24 21:10:28 +00:00
Jeff Young fa908e1f98 Dimensions for footprints.
Fixes https://gitlab.com/kicad/code/kicad/issues/8441
2021-12-24 21:10:28 +00:00
Jeff Young ef10b36948 Add mask-to-copper clearance parameter and rename mask margin. 2021-12-24 12:36:41 +00:00
Jeff Young 32721755bf Hook up zone-pad connections to custom rules.
ADDED zone_connection constraint.
ADDED thermal_relief_gap and thermal_spoke_width constraints.

ADDED angle override for thermal relief spokes in Pad Properties.

Fixes https://gitlab.com/kicad/code/kicad/issues/4067
2021-12-23 22:30:26 +00:00
Jeff Young 0a609dd48d Add footprint library checking to DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/6821
2021-12-23 19:18:45 +00:00
Jeff Young 3af65936c1 Don't consider heatsink, castellated or fiducial pads for THT vs SMD.
Also fixes a bug where the Footprint Checker's marker list wasn't cleared
correctly from the last run.

Fixes https://gitlab.com/kicad/code/kicad/issues/9821
2021-11-29 16:45:42 +00:00
david-beinder fd6a75b779 Do not call TransformToPoly for negative sized PADs 2021-11-12 15:40:08 +00:00
Jeff Young 22ba640c2b Remove locking from footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/9496
2021-10-31 16:33:03 +00:00
Wayne Stambaugh 1f7fd436a2 Move board object polygon code into the object source files.
Having the board object polygon code all defined in a separate file made
finding the polygon code for an object difficult to find.
2021-10-25 17:42:11 -04:00
Jeff Young fecb53b64f Clean up removal of separate front & back footprint text visibility.
Fixes https://gitlab.com/kicad/code/kicad/issues/9441
2021-10-22 21:14:15 +01:00
jean-pierre charras 40e6a9a926 Fp editor: add DRC test for through hole pads without hole. 2021-10-19 14:47:29 +02:00
Jeff Young a41944020d Push most of PCB_SHAPE impl down in to EDA_SHAPE. 2021-10-15 12:45:43 +01:00
jean-pierre charras 593324bbaa Do not use non ASCII7 chars in English strings.
Fix UTF8 to unicode conversion issue.
Fixes #9356
https://gitlab.com/kicad/code/kicad/issues/9356
Fixes #9355
https://gitlab.com/kicad/code/kicad/issues/9355
2021-10-10 10:32:31 +02:00
Jon Evans e2368b733c Allow selection of NPTH pads with zero copper size
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9249
2021-09-26 18:17:50 -04:00
Seth Hillbrand 3e7310a219 Move FP type check to FP DRC
Checks for validity are better centrally located where they don't
interrupt user actions
2021-09-25 08:56:27 -07:00
Seth Hillbrand 963a8ee42d Warn users when creating footprints about mismatch
Checks to see if the footprint attribute matches the type of pads
contained in the footprint.  Can prevent issues during fabrication if
users forget to adjust them during creation.

Fixes https://gitlab.com/kicad/code/kicad/issues/9215
2021-09-24 13:48:01 -07:00
jean-pierre charras 1cf1a23250 footprint.cpp: seriously speedup CoverageRatio() and GetCoverageArea().
Previoulsy, they calculated the area of polygons after using Simplify() and Fracture().
But polygon areas can be easily calculated without these transforms.
So they are just removed (they are really time consummig).
2021-09-13 13:41:36 +02:00
Jeff Young e6ca9837a2 Clear numbers from non-numberable pads and don't run DRC on them.
This was also the last straw on the misnamed PAD::GetName() and
PAD::SetName(), which are now PAD::GetNumber() and PAD::SetNumber().

Fixes https://gitlab.com/kicad/code/kicad/issues/9017
2021-08-24 01:03:06 +01:00
jean-pierre charras 82849eda42 Fp editor: fix some crashes when trying to duplicate referece or value texts.
Fixes #8990
https://gitlab.com/kicad/code/kicad/issues/8990
2021-08-18 15:34:32 +02:00
jean-pierre charras ca42f31bb5 Pcbnew, update footprint: fix loss of net info in some cases.
When pads having a similar name but some were not on a copper layer
(aperture pads) the net info update from old footprint to the new footprint
was incorrectly transferred. Now, only pads on copper layers are considered.
Fixes #8979
https://gitlab.com/kicad/code/kicad/issues/8979
2021-08-16 20:52:49 +02:00
Jeff Young 1a252b4f96 Add a compile error for ill-defined rules, and more performance.
Also adds const-safety to GetBoard().
2021-08-16 12:14:17 +01:00
Jeff Young 98d0ce00ee Defensive coding.
Fixes https://gitlab.com/kicad/code/kicad/issues/8790
2021-08-12 21:35:05 +01:00