Commit Graph

15209 Commits

Author SHA1 Message Date
Jeff Young 4da6d5ff28 Add "generate raw teardrops" option to Add Teardrops dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/14711

Fixes https://gitlab.com/kicad/code/kicad/issues/14704
2023-05-11 15:47:42 +01:00
Jeff Young daa3a1aae9 Revert addition of update-teardrops checkbox to DRC dialog. 2023-05-11 14:53:28 +01:00
Jeff Young 9481a218c7 Lazy loading of stackup UI widgets. 2023-05-11 14:37:48 +01:00
Jeff Young 3f44c811c7 Don't run onPageChanged() event handler during initialization. 2023-05-11 12:51:55 +01:00
Jeff Young 03c9b1c202 Move remainder of Board Setup to lazy loading. 2023-05-11 11:43:10 +01:00
Jeff Young ddc6ecf7be Lazy loading of Schematic Setup panels. 2023-05-11 11:43:10 +01:00
Jon Evans 932f171e96 Remove hard-coded safety margin from specctra output
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14713
2023-05-10 21:55:47 -04:00
Jeff Young 9ae8255202 Insta-prefs. 2023-05-10 18:14:14 +01:00
jean-pierre charras 31d613c746 Fix a few Coverity warnings (not initialized vars)
It also fixes a potential crash when closing Kicad.
2023-05-10 09:21:39 +02:00
Jeff Young 245c3ba6e4 CLang can't do a dynamic_cast across the KiWay.
Rely on DRC for text readability instead.

(Fixes Sentry KICAD-R4 on Mac, and the assert when opening
Preferences from a non-PCBNew-module window.)
2023-05-09 11:10:33 +01:00
Jeff Young 2dcbc10a09 Performance optimization. 2023-05-08 11:46:04 +01:00
Jeff Young 5b3798a370 Holes need a parent.
SetHole() handles all this for us.  Make sure it's called.

Fixes https://gitlab.com/kicad/code/kicad/issues/14702
2023-05-08 11:41:12 +01:00
Jeff Young f883b7fd4d Fix layout inconsistencies in Gen Footprint Pos file dialog. 2023-05-08 10:57:43 +01:00
Jon Evans b06f90335b PNS: Remove holes when removing items with holes
Related to https://gitlab.com/kicad/code/kicad/-/issues/14702
2023-05-07 22:12:11 -04:00
Jeff Young 7978941fa8 Don't allow thickness of 0 in case of an empty stackup.
Fixes https://gitlab.com/kicad/code/kicad/issues/10790
2023-05-07 22:24:40 +01:00
Jeff Young 5bf450a89f Performance. (Coverity) 2023-05-07 14:58:44 +01:00
Jeff Young 2762fa7787 ADDED: track width & via size filters in Edit Track & Via Properties
Fixes https://gitlab.com/kicad/code/kicad/issues/13315
2023-05-06 23:20:39 +01:00
Jeff Young 7bb81f7573 Expand solder mask for pads *defined* to be on copper layers.
Fixes https://gitlab.com/kicad/code/kicad/issues/14693
2023-05-06 21:39:01 +01:00
Lucas Dumont a22e6db982 Add Zone when dragging component
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14629
2023-05-06 09:32:38 +00:00
Jeff Young b41d446f58 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
2023-05-05 17:23:52 +01:00
Jeff Young cd43dccb18 Add missing property to footprint texts table.
Fixes https://gitlab.com/kicad/code/kicad/issues/14357
2023-05-03 17:57:13 +01:00
jean-pierre charras 152f6d80e5 Use operator at() instead of [] to access a std::array item
It helps debug.
2023-05-03 16:40:40 +02:00
jean-pierre charras 631dde3ed1 Pcbnew: fix crash when loading a file having vias on connected layers only.
It was due to an access out of bounds in a std::array
Fixes #14668
https://gitlab.com/kicad/code/kicad/issues/14668
2023-05-03 16:06:32 +02:00
Jeff Young 0eac5c6748 Tighten lifecycle management of CN_ANCHOR/CN_ITEM.
In particular, when a CN_ITEM is freed set all its anchor's
item pointers to NULL.  (The anchors have a separate
lifecycle due to being std::shared_ptrs.)

Hopefully fixes Sentry KICAD-KV.
2023-05-03 10:50:31 +01:00
Jeff Young b53f337938 More accurate terminology for cross-probe settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/13088
2023-05-03 10:50:31 +01:00
Jeff Young f27bc16d62 Cleanup API and use text bounding box for routing.
If someone wants to route around the text more tightly
they can now convert the text to polygons.

Fixes https://gitlab.com/kicad/code/kicad/issues/14252
2023-05-02 16:03:43 +01:00
Jeff Young 80f8cd2254 Commenting and formatting. 2023-05-02 14:16:02 +01:00
Jeff Young df7d62fdd3 Added a sort-order dropdown to lib-tree filters.
Also simplifies the scoring algorithm so that it only
differentiates between exact-match, match-at-start and
any-match.  The rest of the position-based matching
stuff is gone, as is the knowledge of the name vs the
keywords vs the description.  All that is left to the
provider of the weighted search terms array.
2023-05-01 21:26:43 +01:00
Mike Williams 04a53ea40d Picker Tools: make sure we know what tool we are
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14621
2023-05-01 12:43:09 -04:00
Mike Williams 39cc686dc4 Back Annotation: add support for DNP and Exclude from BOM attributes
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14584
2023-05-01 08:54:14 -04:00
Jeff Young c31fb435e6 Add missing setting to Dimension Properties dialog.
Also fixes a bug where during file save we were calling
GetPosition() on the PCB_TEXT but getting the DIMENSION's
version.

Fixes https://gitlab.com/kicad/code/kicad/issues/8447
2023-04-30 22:45:19 +01:00
Jeff Young 2f9889ff62 Add settings for plotting PDF property popups.
Fixes https://gitlab.com/kicad/code/kicad/issues/14450
2023-04-30 18:10:04 +01:00
jean-pierre charras 096af19d9a Minor fix and cosmetic change:
- SCH_SYMBOL::GetMsgPanelInfo(): slighly change the displayed lines to allow
longer strings in Description and Keywords
- panel_setup_rules_help.md: fix incorrect html link (URI), creating ERR 404
2023-04-30 17:37:30 +02:00
Jeff Young 1c6b765ba5 Formatting and cleanup. 2023-04-30 13:43:25 +01:00
Jeff Young af7753c7cd Record parent rule for DRC assertions.
(Particularly important if the rule specified a severity.)

Also fixes a bug looking up LSET layer names in the
GetStandardLayerNames array (which aren't the same).

https://forum.kicad.info/t/a-few-questions-about-custom-rules-syntax/40068/7
2023-04-30 13:01:09 +01:00
Seth Hillbrand f4b43617e7 Add COMMIT structure to Schematic and Symbol editors
Provides a single-point access for modifying the schematic and symbol
elements that allows chaining updates and reverting partial changes.
Standardizes the undo hierarchy between pcb and schematic editors

As this is another layer on the existing undo/redo structure, the
initial commit does not replace all undo/redo calls currently existing.
These will be handled in a series of follow-on commits
2023-04-28 17:05:47 -07:00
Jeff Young 251161dbeb Bring inspection reporting in line with zone filler
1) "clearance" rules don't apply to NPTH holes with no copper
2) local zone clearance applies even if other item has no copper

Fixes https://gitlab.com/kicad/code/kicad/issues/14575
2023-04-28 22:15:10 +01:00
Jeff Young 16e000f2b0 Use Net() accessor uniformly; init hole parent in VIA::Clone()
Fixes https://gitlab.com/kicad/code/kicad/issues/14603
2023-04-28 18:32:58 +01:00
Jeff Young 6807ca6f9f Allow text input to Convert to Polygon/Zone/Keepout.
Also fixes non-copper zone filler to honor fill keepouts.

Fixes https://gitlab.com/kicad/code/kicad/issues/14566
2023-04-28 17:43:08 +01:00
Lucas Dumont b1a4353c34 Update collide for hole
As hole don't keep track of the net, update the collide function to keep it working
2023-04-28 10:20:55 +00:00
Jeff Young b2a45023bc Tighten ownership model of PNS::ITEM.
In particular, ownership must be explicitly set.  It is
no longer inherited through copy/clone/etc.
2023-04-28 11:05:39 +01:00
Jeff Young 9646e3c1c0 Simplify PNS::VIA construction. 2023-04-28 00:32:49 +01:00
Lucas Dumont c781fde236 pcbnew: don't move twice
In pcbnew, if you press M to move your selection and press M again, then escape, you will trigger the https://gitlab.com/kicad/code/kicad/-/blob/master/common/tool/tools_holder.cpp#L106 assert
2023-04-26 15:37:18 +00:00
Lucas Dumont 2992d7c68b Fix typo in QueryConstraint switch 2023-04-26 13:20:32 +00:00
jean-pierre charras 2f392352b5 EDIT_TOOL::doMoveSelection(): avoid calling PushTool() and, just after,PopTool()
for the *same* event: TOOLS_HOLDER::PopTool() does not work fine in this case.
2023-04-26 13:00:50 +02:00
Seth Hillbrand f7f52d77e4 Rework Copper Sliver check
Adds QA checks to copper sliver tests.  Adds the following checks:
- Dot product between two arms (quickly avoids checks for >90°)
- Checks the sliver is convex (area test)
- Eliminates minor slivers with angles that are approximately 0 and ones
  with the opposite side width beneath a configurable level
- Updates Clipper2 to fix a couple of jagged edges on inflate
- Adds simplify during zone fill inflation to limit jaggies

Fixes https://gitlab.com/kicad/code/kicad/issues/14549
2023-04-25 10:32:46 -07:00
jean-pierre charras b9ed84b7db Fix minor compil warnings 2023-04-25 12:43:15 +02:00
Lucas Dumont e2e901de1d Don't override clearance when routing
The default `m_overrideClearance = -1` used here was changed to 1.
Reseting it to -1 to solve linked issue

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14595
2023-04-25 09:18:53 +00:00
Jeff Young 676a15df65 Don't try to keep track of a HOLE's net.
Keep track of it's parentPadVia instead.

Fixes https://gitlab.com/kicad/code/kicad/issues/14603
2023-04-24 18:32:17 +01:00
jean-pierre charras d180ce7865 Pcbnew, minor fix: make Image Properties dialog re-sizable. 2023-04-24 10:21:31 +02:00
jean-pierre charras 8fc70d577f better QFNWizard. 2023-04-23 17:34:21 +02:00
jean-pierre charras c617abe8e9 SCH_BITMAP and PCB_BITMAP: rename m_image to m_bitmapBase. Add more info
in GetMsgPanelInfo() (PPI, scale).
m_image name was confusing: it is not a wxImage, but a BITMAP_BASE item,
and m_image name was already in use in BITMAP_BASE, used inside SCH_IMAGE.
Bitmap properties dialog: show PPI value and add Title to dialog.
2023-04-22 17:28:06 +02:00
jean-pierre charras 0c544f1f45 FOOTPRINT_EDIT_FRAME: do not delete settings when closing the frame.
They now are read when starting kicad, and must be not deleted.
2023-04-22 11:46:52 +02:00
Marek Roszko dbed94e4b1 Fix gerbers and drill plot not logging errors
Partial fix for https://gitlab.com/kicad/code/kicad/-/issues/14437
2023-04-20 23:39:59 -04:00
Marek Roszko 9f64c7f354 Load custom drawing sheets for pcb cli
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14171
2023-04-20 23:17:52 -04:00
Seth Hillbrand 990641d2eb Cleanup printf bits 2023-04-20 15:19:04 -07:00
Seth Hillbrand 4b91c0c8ee Handle multiple holes in footprints
Our basic logic for whether we have a hole or an outline in a footprint
checks if there is copper pads outside of the closed edge.  This misses
the case where the footprint is used to align multiple holes but has no
copper.  Since we do not support multiple outlines in a board, we can
safely assume that multiple, closed edges in a footprint represent holes
and not outlines

Fixes https://gitlab.com/kicad/code/kicad/issues/14468
2023-04-20 14:56:36 -07:00
Seth Hillbrand b56db30019 Ensure that even open paths with fills are filled
SVG paths that are "open" can still have a fill internally, so avoid
dropping fills for these non-standard polygons

Fixes https://gitlab.com/kicad/code/kicad/issues/14518
2023-04-20 12:31:04 -07:00
jean-pierre charras d4cf063e40 Fix a few more doxygen errors (no actual code change) 2023-04-19 20:24:42 +02:00
jean-pierre charras a20f757d8c undo a change (it was only a test) committed by mistake. 2023-04-19 16:57:35 +02:00
jean-pierre charras 1406341d2d Fix a few doxygen errors (no actual code change) 2023-04-19 16:20:24 +02:00
Marek Roszko ea077bc34d Banish ignore.h to core 2023-04-18 22:44:04 -04:00
Seth Hillbrand 32d17547e5 Fixup settings loading
Settings loading needs to account for potential chaining, so each
instance should be created before being Load()ed.  Additionally, add the
settings loading to QA
2023-04-18 16:00:31 -07:00
Seth Hillbrand e6ab9a88ce Remove locks from settings
Settings should be initialized on start-up.  This removes the option of
lazily loading the settings from file and instead requires all settings
needed to be loaded on KiFACE start before requesting data from the
settings object
2023-04-18 13:40:25 -07:00
Jeff Young c682d11fa0 Trim VRML export layers to board outline.
Fixes https://gitlab.com/kicad/code/kicad/issues/14557
2023-04-18 17:31:29 +01:00
jean-pierre charras ba12f00c15 Pcbnew: re-add draw umbilical line for texts in footprints.
It was lost after removing FP_TEXT in code.
2023-04-18 09:48:46 +02:00
Jeff Young 7e5fedef6a Markup fixes.
1) allow escape sequences inside markup sequences
2) keep overbar when inside nested markup
3) always place overbar at full height, not sub/superscript height

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

Fixes https://gitlab.com/kicad/code/kicad/issues/13449
2023-04-17 17:56:54 +01:00
qu1ck 9b58f50c68 Add usable PCB_GROUP::GetItems() swig wrapper 2023-04-17 15:41:49 +00:00
Nimish Telang 51e55dd750 Convert sprintf to snprintf in most files 2023-04-17 15:39:34 +00:00
jean-pierre charras d0676118c1 BOARD_NETLIST_UPDATER: better warning message (I hope...) in Report.
Fixes #14548
https://gitlab.com/kicad/code/kicad/issues/14548
2023-04-17 14:30:47 +02:00
Lucas Dumont 469fe76994 pcbnew: Fix crash with differential routing
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14537
2023-04-17 14:17:14 +12:00
jean-pierre charras 725c2fd661 footprint wizards: fix for my previous commit 50502c4 2023-04-16 17:16:54 +02:00
jean-pierre charras 50502c450f footprint wizards: fixes and enhancements 2023-04-16 17:03:32 +02:00
Jeff Young b76ef8c7e2 Multi-threading safety.
(Possible fix for KICAD-74.)
2023-04-16 15:36:21 +01:00
Jeff Young 2793bb1d68 Performance. 2023-04-16 15:36:21 +01:00
Jeff Young 26c14271f2 Formatting and warnings cleanup. (No functional changes.) 2023-04-16 15:36:21 +01:00
jean-pierre charras 7545097d7f Fix a compil issue on msys2/gcc12.2, due to changes in commit dd1c58dc 2023-04-16 15:28:34 +02:00
Marek Roszko dd1c58dcf5 Fix MSVC C4840 warning
va_start requires trivially copy able classes.

wxString is not trivial. The correct thing to do is to use wxChar*
2023-04-16 07:36:41 -04:00
Jeff Young 299c88cfec Allow setting 0 to min width, min track width, min via annular width, etc.
Fixes https://gitlab.com/kicad/code/kicad/issues/13822
2023-04-15 13:20:34 +01:00
Jeff Young 2d15067453 ADDED allow update of teardrops before running DRC.
Fixes https://gitlab.com/kicad/code/kicad/issues/14264
2023-04-15 12:18:41 +01:00
Jeff Young 521aa5b5ae Update DRC exclusions model to match terminology.
DRC exclusions were originally written following the C++
pragma model (ie: allow this violation here).  However, the
"exclusion" terminology we used in the GUI suggests a model
model where the exclusions go away when the violation no
longer exists.

Fixes https://gitlab.com/kicad/code/kicad/issues/14351
2023-04-15 12:18:41 +01:00
jean-pierre charras 27ebba6b33 Python and footprint wizard: fix issues and update to be compatible
with recent changes in Kicad code.
2023-04-15 10:30:33 +02:00
Jeff Young 4a3f77cd9d Clear board soldermask when undoing/redoing items that affect it.
Fixes https://gitlab.com/kicad/code/kicad/issues/13446
2023-04-15 00:06:58 +01:00
Jeff Young d01c023d5a Retire the lib-tree scoring algorithm.
It appears to cause more confusion than help.

Fixes https://gitlab.com/kicad/code/kicad/issues/13905
2023-04-14 23:35:27 +01:00
Salvador E. Tropea d5c0bf3d0e Load the global fp-lib-table before running the Python DRC
Without this we get parity errors for all the KiCad footprints

(cherry picked from commit e5087ca3db)
2023-04-14 12:09:48 -04:00
Jeff Young 26609bbf05 Fix PNS_KICAD_IFACE_BASE::IsFlashedOnLayer() to be able to handle multi-layer queries. 2023-04-14 12:02:36 +01:00
jean-pierre charras b2bf3229e6 BOARD::Move(): o not move twice PCB_SHAPES in footprints. Altium importer:
fix incorrect position of imported PCB_TEXTs in footprints.
2023-04-14 10:42:02 +02:00
jean-pierre charras 97a4e535dc ConvertOutlineToPolygon(): fix handling of polygons living in footprints.
Due to recent changes in PCB_SHAPE items, the polygon coordinates are now
in board coordinates, not in coord relatives to the parent footprint.
Fixes #14530
https://gitlab.com/kicad/code/kicad/issues/14530
2023-04-13 17:22:03 +02:00
Mike Williams 33b2b5b09d STEP Export: Update options to reflect DNP and Unspecified filtering
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14125
2023-04-13 10:33:03 -04:00
Jeff Young 8e29a054f3 Performance improvement for GetShownColumns.
(This needs to be fast as it's called from OnUpdateUI events.)
2023-04-13 13:45:22 +01:00
Ian McInerney 871f7e05a5 Remove use of wxGRIDTABLE_REQUEST_VIEW_GET_VALUES from the appearance panel
That even was removed by upstream wxWidgets in
81570ae070
which is included in all versions after 3.1.1, so our 3.2 versions
definitely aren't doing anything when we pass this event. The actual
identifier has also been guarded behind a 3.0 compatibility define in wx
as of 3.3.
2023-04-12 18:57:12 +01:00
Ian McInerney 8f3bbf36f8 Replace __WXGTK20__ with __WXGTK__
We no longer care about a GTK2 vs 3 difference, we only support GTK 3.
2023-04-12 18:57:12 +01:00
Ian McInerney 5d0b5e16ff Remove python-based board_item duplicate method
This method shadows the C++ method, and doesn't properly handle updating
the duplicated object's KIID to be unique.

Also add tests to ensure the KIIDs are unique after duplication.

Fixes https://gitlab.com/kicad/code/kicad/issues/14460
2023-04-12 16:05:56 +01:00
Jeff Young e1c9e0e6fc ADDED memberOfFootprint() to DRC custom rules functions.
Also added memberOfGroup(), and deprecated memberOf().
2023-04-12 14:06:09 +01:00
Jeff Young 6059e895d7 Fix a typo.
Fixes https://gitlab.com/kicad/code/kicad/issues/14515
2023-04-12 10:45:24 +01:00
Marek Roszko 37eaa29679 Fix crash due to extra right parens in pcad files
Fixes sentry KICAD-TA
2023-04-11 21:52:39 -04:00
Marek Roszko ed94bc4bf9 Don't crash on empty pcad polygons
Fixes sentry KICAD-103
2023-04-11 21:38:59 -04:00
Jeff Young eef3492fc0 Make symbol/footprint trees sensitive to language change. 2023-04-11 23:51:58 +01:00
qu1ck 0c049eccc7 Fix a bunch of compiler warnings 2023-04-11 17:01:30 +00:00
Jeff Young 6fb30398ca Don't steal an existing via's hole. 2023-04-11 17:48:27 +01:00
Jeff Young ab0dbeb523 Post-holes-work cleanup. 2023-04-11 15:51:00 +01:00
Jeff Young 2f198bdcb2 Further simplify PNS::ITEM::collideSimple().
Also brings text_pns_basic's mocks into line with their "real"
counterparts.
2023-04-11 15:51:00 +01:00
Jeff Young 6f0d963683 Add PNS::ITEM::BoardItem() call.
About 1/3 of callers to Parent() don't care if they get the immediate
parent or not, about 1/3 want only the immediate parent, and about 1/3
want the hole parent's Parent().

I had earlier changed PNS::ITEM::HOLE to override Parent() and return
the hole parent's Parent(), but since the callers are pretty evenly
split I've reverted that and added BoardItem() for callers who want the
eventual BOARD_ITEM (whether a direct parent or a grandparent).

(Also removes a dead routine so I didn't have to figure out which of
the two it wanted....)
2023-04-11 15:51:00 +01:00
Jeff Young 8a0c225efa Unify most special-case processing to the clearance if-then-else.
This also allows us to support hole-to-hole clearance when dragging
a via near another via on the same net.

Fixes https://gitlab.com/kicad/code/kicad/issues/12781
2023-04-11 15:51:00 +01:00
Jeff Young b18bf09208 Don't return holes that have a parent pad or via.
(While we don't currently have holes without a parent pad or via, you
could imagine using HOLEs in the future to represent a hole in a first-class
board outline, so better not to build this assumption in.)
2023-04-11 15:51:00 +01:00
Jeff Young 4cc289c6fb Post-merge cleanup of holes-as-first-class-citizens. 2023-04-11 15:51:00 +01:00
Tomasz Wlostowski 1532a83330 router: hole as first-class-object, initial version of rewritten collision check routine
Rebased and modified by Jeff Young <jeff@rokeby.ie> 6 April 2023
2023-04-11 15:51:00 +01:00
Tomasz Wlostowski d961cdce3f router: further changes to the ownership model
- LINEs now own their vias optionally (depending whether a LINE with its VIA belongs to a node)
- get rid of unique_ptr on the internal NODE::Add API (and also made it private)
- make sure stack pointers are not added to the node
- use rvalue reference for NODE::Add/NODE::Replace

Manually rebased by Jeff Young <jeff@rokeby.ie> 5 April 2023
2023-04-11 15:51:00 +01:00
Tomasz Wlostowski bfbda978b8 router: hole as first class objects, wip
Rebased by Jeff Young <jeff@rokeby.ie> 5 April 2023

(Also includes a bug-fix for highlighting collisions with edge-cut
items.)
2023-04-11 15:51:00 +01:00
Jeff Young 507a25f150 Don't call BuildInitialTrace() for entry gateways.
We're going to call it to connect the entry and target gateways
anyway, so all we need are gateways at 22.5 degrees to setup entry
at +/- 45 degrees from the current direction.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/12459
2023-04-11 15:34:55 +01:00
Jeff Young 11995c1350 Improve readability. 2023-04-11 15:26:39 +01:00
Mike Williams 32eb1ef77e Sch->PCB: propagate DNP from symbols to footprints attributes
Also add a 3D viewer toggle.
2023-04-10 13:11:21 -04:00
Jeff Young adc213a04d Add Keep Upright to properties inspector.
Fixes https://gitlab.com/kicad/code/kicad/issues/14421
2023-04-10 00:00:54 +01:00
Jeff Young d040690f60 Ease acquisition of a target item.
pickSingleItem() had a two-attempt algorithm, but the second attempt
was never made because we'd check for no hits before throwing out the
aAvoidItems.

The second attempt would fail anyway because QueryHoverItems() ignored
the aUseClearance flag when not idle, and didn't factor in the actual
clearance.
2023-04-09 22:05:17 +00:00
Jeff Young 1d19672054 Handle more pad shapes when building diffpair gateways.
Fixes https://gitlab.com/kicad/code/kicad/issues/1883
2023-04-09 22:05:17 +00:00
Jeff Young 374d3d52ef Rollback wxChoice -> wxComboBox changes for now.
wxComboBox still has serious issues on macOS.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/14413
2023-04-09 23:00:33 +01:00
Jeff Young e522e73e0e Improve readability. 2023-04-08 15:06:49 +01:00
Jeff Young 3b63d70d01 Centralize NPTH has-annulus processing.
Fixes https://gitlab.com/kicad/code/kicad/issues/13437
2023-04-08 15:06:49 +01:00
Seth Hillbrand 2cd854af14 Move Spacemouse to advanced config
The spacemouse driver, particularly on Mac, is extremely unstable and
causes crashes even when not being used.  This places the interface
behind an advanced config flag to ensure that users can affirmatively
opt-in to the potential for crashes
2023-04-07 10:08:43 -07:00
jean-pierre charras ca0e57f036 Plot gerber: fix two issues:
- ensure the metadata GBR_NETINFO_CMP is added to all PCB_SHAPE living in a footprint
- fix a too zealous plot of negative objects on the silkscreen layers, when
merging layers to silkscreen layers.
2023-04-07 11:23:24 +02:00
Ian McInerney 18ea3be3f2 Revert "Reintroduce constexpr to COLOR4D"
This reverts commit 33da9b2327 and the
following commit dc08c48f33.

C++17 changed the behavior of static class member variables that are
constexpr defined. Previously this definition/declaration split was
valid for constexpr members, but after C++17 the static constexpr member
variables are automatically inlined, so the declaration is no longer
exported in some compilers (GCC 9/10/11 seem to have problems).

An alternate way of constexpr member variables is putting the
initialization in the class definition, but we can't init a COLOR4D
object when defining the COLOR4D class.

For now, revert this change until we can figure out the proper way of
architecting these colors.
2023-04-06 20:18:31 +01:00
Ian McInerney dc08c48f33 Try to fix linking after constexpr change
Somehow, GCC 10 and 11 were unable to locate the prebuild colors when
they were constexpr in gal, so give them on the link line again.
2023-04-06 15:20:16 +01:00
Ian McInerney 311d5d5e26 Remove unused container header 2023-04-06 15:01:18 +01:00
Ian McInerney ea62b145ff Introduce core interface library
This library is meant to move non-EDA items (language extensions,
library extensions, etc.) into the lowest-level of our dependency chain.
This library should never depend on anyother non-thirdparty code in the
kicad codebase.
2023-04-06 15:01:18 +01:00
jean-pierre charras 4d05bd62da drc_test_provider_library_parity: fix false positive.
After last changes in PCB_SHAPES, there were issues when comparing coordinates
of shapes.
Use now a footprint not flipped, not rotated and at position 0,0 for comparisons.
Fixes #14496
https://gitlab.com/kicad/code/kicad/issues/14496
2023-04-05 18:25:19 +02:00
Tomasz Wlostowski 1283c4713f router: rework ITEM ownership model.
- prerequisite for holes as first class objects code
- introduced the OWNABLE_ITEM interface that defines the owning container (NODE/other ITEM/ITEM_SET)
- simplified the ITEM_SET interface
- constified a lot of APIs (ownership/JOINT management) as a side effect

Rebased and cleaned up by Jeff Young <jeff@rokeby.ie> 5 April 2023
- some STL cover types removed
2023-04-05 11:21:31 +01:00
Tomasz Wlostowski eed05191a9 router: pass collision query options in a structure
Selectively cherry-picked by Jeff Young <jeff@rokeby.ie> 4 April 2023
- Jon's user-clearance-epsilon algo kept intact
- Jeff's castellated-pad code kept intact
2023-04-05 11:21:31 +01:00
Jeff Young a9b2234f4e Use a softer Reset for grid settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/14458
2023-04-04 17:05:21 +01:00
Jeff Young 13e79af8a0 Eagle template footprints don't actually belong to board.
Set their parent to nullptr before deleting (as the board may have
already been deleted).

Likely fix for Sentry KICAD-79.
2023-04-04 14:18:49 +01:00
Jeff Young bd60f38569 Possible protection from acessing deleted window data.
(Long shot for Sentry KICAD-MM.)
2023-04-03 23:44:40 +01:00
Jeff Young a4e8fa96d4 Nullptr safety.
(This is a long shot for Sentry KICAD-MV, but you never know....)
2023-04-03 23:44:40 +01:00
Jeff Young 9b4627e782 Don't pass a FRAME-based UNITS_PROVIDER to a modeless dialog.
(The dialog may outlive said frame.)
Should fix Sentry KICAD-3A.
2023-04-03 17:18:33 +01:00
Jeff Young 7a24672120 Improve naming. No functional changes. 2023-04-03 14:32:23 +01:00
Jeff Young d9b0577ddd Fix pad flipping. 2023-04-03 14:32:23 +01:00
Jeff Young 7286555529 Fix some issues editing pads via Pad Properties dialog.
The offsets and orientations were being incorrectly handled.
2023-04-03 13:17:52 +01:00
Jeff Young fd07f50c44 Report collisions of items with nets as SHORTING, not CLEARANCE.
Fixes https://gitlab.com/kicad/code/kicad/issues/14312
2023-04-02 21:07:52 +01:00
Jeff Young 77639a540b Add messages for clearance reports on footprints.
Fixes https://gitlab.com/kicad/code/kicad/issues/13874
2023-04-02 19:12:19 +01:00
Jeff Young 28028c941e Retire Local/Draw coords distinction from PAD (the last object to have it). 2023-04-02 18:02:41 +01:00
Jeff Young 7252c7471c Use enums for column ids.
(The nickname, in particular, is no longer column 1.)

Fixes https://gitlab.com/kicad/code/kicad/issues/14291
2023-04-02 15:10:06 +01:00
Jeff Young b78e0a55b1 Naming conventions. (No functional changes.) 2023-04-02 11:48:23 +01:00
jean-pierre charras 054de5687c Pcbnew: fix crash when trying to delete a PCB_TEXT. 2023-04-02 12:15:18 +02:00
jean-pierre charras 31354a2d91 PCB_TEXT::TransformTextToPolySet(): fix some issues:
- incorrect rotation for texts with option "Keep Upright"
- missing code for knockout texts.
Fixes #14473
https://gitlab.com/kicad/code/kicad/issues/14473
2023-04-02 09:54:53 +02:00
jean-pierre charras 52315e4f02 specctra_export: fix unit conv PCB iu -> DSN 2023-04-01 17:28:50 +02:00
Jeff Young bf9a42d7e1 Naming conventions and nullptr usage. No functional changes. 2023-04-01 15:41:59 +01:00
Jeff Young 4fbb85aa4f Naming conventions. 2023-04-01 15:40:50 +01:00
Jeff Young a8faa0e615 Add hole clearance to moutning hole keepouts for SPECCTRA.
Fixes https://gitlab.com/kicad/code/kicad/issues/14439
2023-04-01 15:40:43 +01:00
Jeff Young 04cdca837e Remove GUI dialogs from PCB plugin. 2023-04-01 11:37:34 +01:00
Jeff Young b80a9014ff Fix gcc warning. 2023-03-31 23:53:11 +01:00
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Seth Hillbrand 7695d510d6 Prevent PCB Editor from opening multiple board_setup
ShowBoardSetup can be called multiple times from multiple locations,
resulting in duplicate board setup dialog boxes.  This is confusing and
should be prevented.  We use the established patter from the symbol
picker to ensure that only one copy of the dialog is ever opened at a
time
2023-03-30 15:34:23 -07:00
jean-pierre charras 061e423b1f Pcbnew: fix incorrect position of cached text shapes when moving a footprint.
when moving a footprint, the position of texts living in FP_TEXT_BOX was
not updated when the text shape was cached (non Kicad fonts).
Fixes #14452
https://gitlab.com/kicad/code/kicad/issues/14452
2023-03-30 17:25:25 +02:00
Roberto Fernandez Bautista d5bc223ff2 CADSTAR PCB Importer: Ignore construction layers on outer surfaces
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14443
2023-03-29 23:46:22 +02:00
Roberto Fernandez Bautista aaeb8ca739 CADSTAR PCB importer: Fix loading of rounded rectangle pads
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14445
2023-03-29 20:53:14 +02:00
Roberto Fernandez Bautista 89441d807d CADSTAR PCB importer: Fix incorrect position of overridden pads 2023-03-29 20:53:14 +02:00
Wayne Stambaugh 28776f5745 Text attributes object improvements.
* Add compare method to COLOR4D object.
* Add unit test to validate COLOR4D comparison method.
* Add missing color test in text attribute comparison method.
* Add unit test for text attribute object.
* Remove unnecessary headers from text attribute header.
* Move text attribute code into separate source file.
2023-03-29 12:53:45 -04:00
jean-pierre charras 683a327200 Footprint editor: always export the currently loaded footprint.
Previously, it was not always the edited footprint, but a footprint
selected from the library tree.
It was especially annoying when the footprint was loaded from the board editor:
The footprint was not the loaded footprint, but its copy from library.
2023-03-29 18:47:39 +02:00
jean-pierre charras 0bd83d3096 Footprint viewer: ensure the footprint is updated after new library selection
Previously, if the first fp of the new lib has the same name as the old
displayed fp, the old fp was not replace by the new fp.
2023-03-29 16:53:49 +02:00
Seth Hillbrand f93fde15b7 Locked shadow needs to be in shadow color
Otherwise, text shadow is stroked by text color
2023-03-28 13:01:08 -07:00
Jeff Young 0f9a4ef7b7 Update local coords after changing footprint item properties.
Fixes https://gitlab.com/kicad/code/kicad/issues/14348
2023-03-27 16:44:00 +01:00
Jon Evans 3f42e6b702 Properties: Hide Net Class from GUI
It is confusing users who want to change the netclass of a net.
2023-03-26 19:46:00 -04:00
Jon Evans 65193487a6 Properties: Rename methods to better reflect their purposes 2023-03-26 19:43:16 -04:00
Jeff Young a214ac0310 Better reporting of copper <--> keepout area clearances.
(Keepout areas can keep-out copper, but they don't have a clearance
to copper.)

Fixes https://gitlab.com/kicad/code/kicad/issues/14375
2023-03-26 20:57:59 +01:00
Jeff Young 9976b9ce8c Only report on clearances where there was one defined.
If it's 0, it's just a straight-up collision.
2023-03-26 20:46:59 +01:00
Jeff Young 0266d03f79 Run SILK_CLEARANCE rules on mask layer when testing silk-to-mask clearance.
This allows custom rules to be authored without firing the auto-generated
rule from Board Setup > Silk Item Clearance (which should be only for silk-
to-silk clearances).

Fixes https://gitlab.com/kicad/code/kicad/issues/14417
2023-03-26 20:42:41 +01:00
Jeff Young 2443bc6e29 Update allow-solder-mask-bridges when updating footprint from library.
Fixes https://gitlab.com/kicad/code/kicad/issues/14422
2023-03-26 16:27:09 +01:00
Jeff Young 04f6f04bed Test silk/mask collisions on the correct layer.
Fixes https://gitlab.com/kicad/code/kicad/issues/14417
2023-03-26 16:27:05 +01:00
Marek Roszko 604a7d69db Move up a layer validity check to prevent crash
Fixes sentry crash KICAD-RF
2023-03-25 17:12:22 -04:00
Jeff Young c5e66361db Allow solder mask bridges between net-tie-group pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/14412
2023-03-25 16:11:07 +00:00
Jeff Young d6dd58fff9 Keep track of single-pad-islands so we can discount spokes to them. 2023-03-25 10:44:46 +00:00
Marek Roszko eb90448247 Fix typo 2023-03-24 19:54:41 -04:00
Marek Roszko 8a8589b9db Fix cli crash due to dialogs buried in the pcb parser...
Fixes sentry KICAD-Q2
2023-03-24 19:52:48 -04:00
Seth Hillbrand 19d0aceda3 Remove superfluous m_status variable
This used to be used to store information for the item similar to
m_state but it has been deprecated and no uses remained
2023-03-24 09:38:39 -07:00
Wayne Stambaugh 244c37298f Fix Doxygen commenting issues. 2023-03-24 11:57:52 -04:00
jean-pierre charras 2e2cbb0594 Pcbnew, APPEARANCE_CONTROLS: do not change objects visibility, when changing
layers visibility using Preset layers widget.
Fixes #13381
https://gitlab.com/kicad/code/kicad/issues/13381
2023-03-24 14:07:29 +01:00
Nimish Telang 8ea357f04d Fix Doxygen directives in numerous headers 2023-03-24 13:02:13 +00:00
Nimish Telang f7bf3011fb Use bundled Find{CURL,ZLIB}.cmake 2023-03-24 12:54:52 +00:00
qu1ck a86aa6fc3e Don't disable reload button in action plugins preferences 2023-03-24 12:49:43 +00:00
jean-pierre charras ac71227e75 Fix compil warnings. 2023-03-23 18:36:59 +01:00
Marek Roszko d49562a7aa Fix crash editing footprint editor defaults
Missing one level of GetParent()....use a dynamic_cast to sanity check it in debug

Fixes sentry crash KICAD-R4
2023-03-22 18:39:17 -04:00
Seth Hillbrand 2e2da951a5 Don't double-expand NPTH checks
When filling the zone for the NPTH, the hole should not be considered as
a copper element in terms of clearance.  This prevents close but
different knockout elements from being formed
2023-03-22 15:07:58 -07:00
Seth Hillbrand 914b5a4d21 Simplify test for substantial nubs
Substantial elements following a divot should be at least as far in each
cardinal direction from the origin point in order to be considered
substantial.  This catches cases where the "substantial" element is
actually a straight segment away from the divot

Fixes https://gitlab.com/kicad/code/kicad/issues/14130
2023-03-22 13:01:50 -07:00
jean-pierre charras 65eb84265b Fix a compil warning issue (mingw specific)
also avoid to include wx/wx.h in kicad_cli.cpp, it is compil time consuming.
2023-03-22 08:49:26 +01:00
David Holdeman 79fbde0894 Add option to use drill/place file origin for kicad-cli gerber export 2023-03-21 12:18:14 +00:00
jean-pierre charras 0c26014eaa step exporter: fix missing initialization of a member (m_pcbName)
in EXPORTER_STEP rename m_pcbName to m_pcbBaseName, to avoid using
the same name used also in STEP_PCB_MODEL.
2023-03-21 09:30:11 +01:00
Marek Roszko edf6828cf1 Put the project name back into the step pcb label.
Software like Solidworks and other CAD treat STEP labels as unique entries.
When you import multi STEP files into the same project, it'll start deduplicating your design by those name.
So two completely unrelated PCBs with the same "PCB" name will result in one being replaced by another.
2023-03-20 21:11:28 -04:00
Jeff Young bb2a0f825a Orthogonal dimension are always cardinal, even when their start points are not.
Fixes https://gitlab.com/kicad/code/kicad/issues/13728
2023-03-20 21:22:11 +00:00
Martin Thierer 45b94a4b3e Pcbnew: Fix rotating bitmaps
Fixes rotating bitmaps with "rotate counterclockwise",
"rotate clockwise" and "move exactly" commands.

Only rotation by 0, 90, 180 and 270 degrees is supported
for bitmaps. Other values are rounded to the nearest 90
degree multiple.

There is a different bug that this commit doesn't address,
which is that BITMAP_BASE::Rotate() got its CW/CCW logic
reversed ("m_image->Rotate( false )" should rotate CW, but
does not).

Fixes https://gitlab.com/kicad/code/kicad/issues/14197
2023-03-20 12:36:19 +00:00
Jeff Young 5d55fc41ae Adds Teardrops as separate type in Global Deletions dialog.
Also removes the nag dialog as undo has worked for Global Deletions for
some time now.
2023-03-19 20:43:18 +00:00
Jeff Young 897984aa22 Filter Selected Items... is inclusive, not exclusive.
Fixes https://gitlab.com/kicad/code/kicad/issues/14273
2023-03-19 20:43:18 +00:00
Jeff Young 129ccb891e Use standard paradigm for macro scope limiting. 2023-03-19 20:43:18 +00:00
Alex 10c4b948cb Support canceling initial global library table setup. 2023-03-19 14:30:53 +03:00
jean-pierre charras 5461dc6cd1 BOARD_NETLIST_UPDATER: add missing count of warnings
Fixes #14290
https://gitlab.com/kicad/code/kicad/issues/14290
2023-03-18 17:54:03 +01:00
Jeff Young ad5d3d4eba Clean up items which weren't pasted from clipboard.
Fixes https://gitlab.com/kicad/code/kicad/issues/14335
2023-03-17 23:17:15 +00:00
Jeff Young ee1d9c561c Improve zone & rule area reporting.
Also removes a bunch of "wxEmptyString" where it was degrading readability.

Also fixes a bug where footprint zones were getting sorted incorrectly
due to rotation of coordinates.

Fixes https://gitlab.com/kicad/code/kicad/issues/14322
2023-03-17 13:28:29 +00:00
Jeff Young 967ee2c85b Improved macro protection. 2023-03-17 11:04:58 +00:00
Roberto Fernandez Bautista 55a379f61b Fix build: Add missing header include 2023-03-16 22:07:04 +01:00
Roberto Fernandez Bautista 3d661585dd Fix build errors and warnings from CADSTAR 2023-03-16 21:17:40 +01:00
Roberto Fernandez Bautista 5efec4cd51 CADSTAR PCB: Ensure pads have correct position and footprints at 0,0
Fixes a display issue in the footprint preview where all the pads
were displayed at 0,0
2023-03-16 21:07:09 +01:00
Roberto Fernandez Bautista 2cefabc99a CADSTAR PCB: Fix loading of filled circles (load as polygon for now)
todo: need to detect if what we are drawing is a circle.
2023-03-16 21:07:09 +01:00
Roberto Fernandez Bautista 6f5321c481 ADDED: CADSTAR .cpa footprint libraries 2023-03-16 21:07:08 +01:00