Commit Graph

13145 Commits

Author SHA1 Message Date
jean-pierre charras 876061369b Fix some Pcbnew crashes due to null pointers 2022-02-14 13:46:05 +01:00
jean-pierre charras 0eddbe02c1 DIALOG_NETLIST_IMPORT: minor fix 2022-02-14 07:53:00 +01:00
Jeff Young d07910de06 Improve performance of checkZoneZoneConnection. 2022-02-14 01:15:06 +00:00
Tomasz Wlostowski 018f4531a5 Fixes in the SVG import polygon postprocessing:
- don't drop subsequent polys when a non-filled primitive is imported 'in between'
- fix missing holes (also related to the interleaving of stroke and filled shapes, depending on the software that wrote the SVG file)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10813
2022-02-14 00:54:31 +01:00
Graham Keeth 4442f76add update custom rule syntax help to make diff pair rule examples clearer 2022-02-13 13:47:18 -05:00
Jeff Young fe7e72538e Don't force user to be overly pedantic when writing diffpair rules. 2022-02-13 18:16:13 +00:00
Jeff Young 022e7385f9 Beautify the Rule Area Properties dialog. 2022-02-13 18:16:13 +00:00
jean-pierre charras bff97df5f9 Fix a compil warning, at least on my msys install. 2022-02-13 16:26:05 +01:00
jean-pierre charras cdd32df3a0 Import netlist: fix issues: do not read netlist before it is selected.
Now the netlist must be explicitly selected and read instead of beeing
read during dialog creation.
It also avoid a useless netlist read when closing the dialog or trying
to change the netlist filename.
2022-02-13 16:04:38 +01:00
Jeff Young b7c9a1ad55 Fix repaints getting done after the wrong dialog. 2022-02-13 13:06:35 +00:00
Jeff Young c4e133fdf7 Auto reduction and std::shared_ptr cover types reduction.
And a performance optimization or two resulting from above.  (Using
const& intead of copying std::shared_ptrs.)
2022-02-13 12:04:03 +00:00
Jeff Young 90f6edad61 Move connectivity algo to collision-based routines.
Fixes https://gitlab.com/kicad/code/kicad/issues/1800

Fixes https://gitlab.com/kicad/code/kicad/issues/1769
2022-02-13 00:35:11 +00:00
Jeff Young a2ca8cf413 Improve SNR. 2022-02-12 18:38:11 +00:00
Jeff Young 8dcc933fc3 Don't use bounding box cache during insideArea.
For starters we can't rely on it having been updated, but we also
cache the entire result so there's no huge cost-savings anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/10821
2022-02-12 18:38:11 +00:00
jean-pierre charras e742eea7ed DIALOG_NON_COPPER_ZONE and DIALOG_RULE_AREA_PROPERTIES: add option to set the pitch
of hatches around the zone outlines
2022-02-12 18:57:03 +01:00
jean-pierre charras d553d620c1 DIALOG_COPPER_ZONE: add option to set the pitch of hatches around the zone outlines
This parameter exists since the beginning, but never show in this dialog
2022-02-12 18:57:02 +01:00
Thomas Pointhuber 81b4229e12 altium: Improve test-coverage of *.PcbLib import functionality
* Add test-code for pads
* Move test-code into board_test_utils.cpp for reuse, one method per object
* Add a real (rather small) Altium footprint for testing purposes
2022-02-12 16:50:25 +01:00
Jeff Young 93c7046a77 Return nominal pad shape when a specific layer isn't specified.
Fixes https://gitlab.com/kicad/code/kicad/issues/10755
2022-02-11 22:09:22 +00:00
Jeff Young 00934fdd84 Move GUI queries in PLUGIN to a callback.
Also makes sure legacy zone fills get deleted and re-filled (since
just dropping the outline will change them).
2022-02-11 22:09:22 +00:00
Jeff Young 300ee022fa Drop unsupported fills. No reason to keep them around.
Also removes the long-dead segment fill data structures.
2022-02-11 22:09:22 +00:00
dsa-t 68655540eb Clamp cursor to limits of coordinates representation
Also improves large distance handling.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8846
2022-02-11 16:42:52 +00:00
Jeff Young 3deaf902bb Retire the V5 zone fill algorithm.
Fixes https://gitlab.com/kicad/code/kicad/issues/10578
2022-02-11 13:10:52 +00:00
Jeff Young 50a4d610a6 Be cognizant of flashed layers when generating pad shapes. 2022-02-11 13:10:52 +00:00
Jeff Young 6e063247e5 Move CN_VISITOR from HitTest() to Collide().
The former isn't sufficiently aware of layer differences (such as for
pads with some layers unflashed).
2022-02-11 13:10:52 +00:00
Jeff Young 082c6f5bd6 Make sure plotter uses default font when specified. 2022-02-10 20:33:06 +00:00
木 王 261b1df47f fix-npth 2022-02-10 10:06:59 +00:00
Thomas Pointhuber 3f36e7d725 altium: Start with a test-suite to validate that *.PcbLib footprints are correctly imported
The test simply loads every footprint of a library, and compares all elements with an equivalent
KiCad footprint. This allows us to quickly spot regressions in the altium and kicad footprint importer,
and any code in-between. This test is only a demo, as the checks are still incomplete and quite a few
tests are missing.

It has to be noted that mask expansion is not supported rigt now by the altium importer, thus the
reference footprint is adjusted to keep the test happy.
2022-02-09 22:34:04 +01:00
Jeff Young ca56de7816 Show DRC overflows in both tab titles and number badges.
Fixes https://gitlab.com/kicad/code/kicad/issues/10617
2022-02-09 17:04:32 +00:00
Wayne Stambaugh 06e00c7957 Fix shadow variable compile warning in text DRC provider. 2022-02-08 09:26:12 -05:00
Jeff Young 3b5474f190 Don't punt on TrueType char thickness; analyze it.
Fixes https://gitlab.com/kicad/code/kicad/issues/10740
2022-02-08 14:10:37 +00:00
Jeff Young 137edbe3f3 Add disclaimer for TrueType fonts to thickness test.
Fixes https://gitlab.com/kicad/code/kicad/issues/10740
2022-02-08 14:10:37 +00:00
Jeff Young 3c5ae6d317 Don't let zone cutout on different layer confuse us about intersections.
Fixes https://gitlab.com/kicad/code/kicad/issues/10583
2022-02-08 14:10:37 +00:00
Jeff Young 091055fa1d Don't count track as a pre-existing connection. 2022-02-08 14:10:37 +00:00
jean-pierre charras 534dc1ba8a DRC dialog: very minor enhancement: add a busy cursor during tests. 2022-02-08 07:33:01 +01:00
Seth Hillbrand 51d7b49067 Don't halt expansion on zero-length
We avoid counting endpoints for tracks that have no length
2022-02-07 13:53:42 -08:00
Jeff Young 5ce559176d Overhaul the font metrics calcs for overbar, italics and bboxes. 2022-02-07 17:36:40 +00:00
Seth Hillbrand 162545ddf0 Validate arc output when editing
Handles checking output of the arc to ensure we don't end up generating
an invalid arc.  Also keeps the limit of the arc angle to be (360,360)
excluding 0.

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

(cherry picked from commit 8fc831cbc2)
2022-02-07 08:55:53 -08:00
jean-pierre charras 2485648a54 Fix typo in a copy/paste and a minor compil warning 2022-02-07 17:32:19 +01:00
Jeff Young e59aaf05c6 Make sure that GetConnectedItems searches from the root item.
Fixes https://gitlab.com/kicad/code/kicad/issues/10583
2022-02-06 19:43:25 +00:00
Jeff Young a60aa68b3a Don't enforce a max of 4 for minimum-spoke-count.
See comments in code.

Fixes https://gitlab.com/kicad/code/kicad/issues/10583
2022-02-06 19:43:25 +00:00
Thomas Pointhuber 79f80c4cd7 altium: Fix Reference and Description parsing of footprint 2022-02-06 16:24:07 +01:00
Marek Roszko d9c04da407 Sprinkle in some make_unique 2022-02-05 21:26:36 -05:00
Marek Roszko 0a5ddb8d40 Add some vector reservations 2022-02-05 21:12:29 -05:00
Marek Roszko 41f54349a5 Replace inserts/push_backs with emplace in some spots 2022-02-05 19:53:31 -05:00
Jeff Young 34a9a165c9 More wide-string declarations. 2022-02-05 22:26:31 +00:00
Jeff Young b2e3f03222 More wide-string declarations. 2022-02-05 22:03:04 +00:00
jean-pierre charras f8ff104003 Fix a compil issue. 2022-02-05 21:29:44 +00:00
Jeff Young 7ccac79192 More wxString wide literals. 2022-02-05 21:29:34 +00:00
Jeff Young 9582457fef Be explicit about literal wide-strings. 2022-02-05 20:40:21 +00:00
Roberto Fernandez Bautista 290354e3f6 CADSTAR: Fix potential nullptr dereferencing bug
Don't assume the footprint will have the pad index that the file references.
2022-02-05 19:20:56 +00:00
Marek Roszko b9f1aaf029 Fix typoed test condition for TH no hole pads PVS V501 2022-02-05 11:31:56 -05:00
Marek Roszko 193dee11e8 Add missing null check PVS V595 2022-02-05 11:25:09 -05:00
Marek Roszko 8588bea4b2 Avoid potential divide by zero in footprint spreading PVS V609 2022-02-05 11:23:05 -05:00
Marek Roszko a7ebfc31f9 Fix some leaking objects identified by PVS Studio V773 2022-02-05 11:16:11 -05:00
Seth Hillbrand 57df1b469a Allow dialogs to force evaluation of UNIT_BINDER
When setting previous values, we don't get the "OnFocus" event, so the
evaluation would not get triggered by simply repeating (using the
keyboard)

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

(cherry picked from commit 4c81307391)
2022-02-04 10:04:54 -08: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 4cc1ced2f3 Log an undo item when filling zones.
If we wanted to put it into the parent's undo item, then the *parent*
would need to not start a new undo record.  Not starting one in the
zone filler tries to add it to the *previous* change, not to the parent
change.

Fixes https://gitlab.com/kicad/code/kicad/issues/10091
2022-02-04 13:45:32 +00:00
Jeff Young 93c3e6bd16 Clean up formatting. 2022-02-04 13:43:57 +00:00
Jeff Young 8d3e1639d0 Update text variables when they change.
Fixes https://gitlab.com/kicad/code/kicad/issues/10734
2022-02-04 12:52:46 +00:00
Marek Roszko ca7840334c Mark some limits as constexpr
gcc doesn't need it and computes during compile regardless, but experimenting in godbolt, both clang and MSVC actually do need it or else it's partially computed at runtime
2022-02-04 07:50:13 -05:00
Seth Hillbrand 917845cf00 Ensure we can version scripting properly
Adds Version() and FullVersion() calls to support reporting version to
scripts and scripting window

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

(cherry picked from commit 0a13f15a9d)
2022-02-03 15:59:10 -08:00
Jeff Young b9eb3e9b05 Be more explicit about string conversions. 2022-02-03 23:07:41 +00:00
Seth Hillbrand 6905cfb95b Update error message to match new arc dialog
We now provide arc end points and interior angle, so we cannot check for
null radius in the same fashion.  Instead, the starpoint==endpoint
indicates a zero radius

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

(cherry picked from commit ef94f31204)
2022-02-03 14:32:23 -08:00
Seth Hillbrand 168ad58eef Convert strings to wide when using wxString routines
WxString does not allocate space for wide strings needed during
conversion unless the string is explicitly wide.  This can cause buffer
over/underflow

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

(cherry picked from commit 7601a3385f)
2022-02-03 13:08:33 -08:00
Seth Hillbrand 92dc06ac9d Don't convert KIID on the fly
Converting to string on save prevent unneeded ops

(cherry picked from commit 901685f01b)
2022-02-03 10:35:31 -08:00
jean-pierre charras a970acd0bc Fix some issues related to new textboxes and python:
- Fix duplicate class names returned by GetClass().
- replace MTEXT name (in GetClass) by better name (FP_TEXT, FP_TEXTBOX...)
- Add missing Cast_to_PCB_TEXTBOX and Cast_to_FP_TEXTBOX
2022-02-03 13:55:37 +01:00
Seth Hillbrand a2f845a41c Handle invalid pads more gracefully
Pads generated outside of KiCad may have self-intersecting polygons that
simplify to multiple sets.  We handle this by adding multiple primitives
for such polygons and limiting our fracture calls to only polygons that
have holes

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

(cherry picked from commit 6d84acfacd)
2022-02-02 13:40:07 -08:00
Jeff Young c8d14ade65 Only run starved-thermals checks when pad is actually connected to zone.
Fixes https://gitlab.com/kicad/code/kicad/issues/10583
2022-02-02 13:09:27 +00:00
jean-pierre charras 27c25debea teardrops: fix a not very good shape for not round targets after code change. 2022-02-02 13:31:29 +01:00
Steffen Mauch 61b2b0ff0c EAGLE plugin: use specified RATIO value for text size calculation 2022-02-01 17:58:09 +00:00
jean-pierre charras e560e765e6 PCB_TEXT::Rotate(): ensure the final orientation is -180 ... +180 deg 2022-02-01 18:07:14 +01:00
Jeff Young bebfbce9b2 Move pcb file rep of text_boxes to strokes. 2022-02-01 16:29:59 +00:00
Jeff Young 0faf3a8bf5 Get rid of FP_TEXTBOX::ViewBBox(). We want to inherit FP_SHAPE's. 2022-02-01 12:49:28 +00:00
Jeff Young 63a3b1e20a Estimate outline font thickness for DRC readability checks. 2022-02-01 12:01:04 +00:00
Jeff Young 1f8c29c395 Coverity fixup. 2022-02-01 12:01:04 +00:00
Seth Hillbrand 56d204c4c9 Revise transferDataToPad to return False on failure
When the data doesn't allow the pad to be drawn, we return false and
skip the redraw/update steps.  This allows updating with invalid values
while typing

Fixes https://gitlab.com/kicad/code/kicad/issues/10684
2022-01-31 17:02:10 -08:00
Seth Hillbrand 803675195d Be more diligent in preventing drag line errors
They can happen even when there are no collisions, so we need to reset
the 'ok' flag before using the line again.

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

(cherry picked from commit 833ce19221)
2022-01-31 16:13:53 -08:00
Seth Hillbrand 098e8f7d9b Revert "cmake: adding KICAD_MACOSX_APP_BUNDLE option"
This reverts commit ea9f960cc1.

Reverted for updates as this currently breaks kicad-mac-builder
2022-01-31 15:57:56 -08:00
Jeff Young f3cd36d1d7 Bring EEschema textboxes in line with PCBNew's.
Also adds Border checkboxes and fixes a bunch of bugs.
2022-01-31 21:46:40 +00:00
Jeff Young 5739505aa3 TextBoxes for PCBNew. 2022-01-31 20:00:47 +00:00
Jeff Young 60bcfd1bf1 Bug fixes in arc & textbox printing.
Also removal of the no-longer-used clipping code from GR*.
2022-01-31 20:00:47 +00:00
jean-pierre charras c494274b2e export D356 netlist: fix incorrect id for pads type connectors.
these pads are similar to SMD pads and should have the same id.
Fixes #10694
https://gitlab.com/kicad/code/kicad/issues/10694
2022-01-31 19:53:02 +01:00
Jonathan Haas 7b01530eca EDA_ANGLE: use existing Normalize180 function here 2022-01-31 18:16:49 +00:00
jean-pierre charras f846f6f704 PCB_CONTROL::unfilledZoneCheck(): skip rule areas: they are not filled by definition.
Fixes #10691
https://gitlab.com/kicad/code/kicad/issues/10691
2022-01-31 17:01:52 +01:00
markus-bonk a8486c5296 Fix warning: declaration shadows a previous local [-Wshadow]. 2022-01-31 10:41:51 +00:00
Alex e9ffea83fd Cross-probing: Do not center/zoom on empty BBox 2022-01-31 10:17:59 +03:00
jean-pierre charras 419010ec46 teardrop: add filtering to skip teardrops when pad/vias and tracks have similar sizes 2022-01-30 15:39:28 +01:00
jean-pierre charras 3a66f33d96 TEARDROP_MANAGER: add option to add teardrops on pads in zones. 2022-01-30 15:39:27 +01:00
jean-pierre charras cc2a897e2b very minor fix 2022-01-30 09:08:21 +01:00
jean-pierre charras aef665b1e2 PCB_TARGET: add missing TransformShapeWithClearanceToPolygon() method.
Fixes #10653
https://gitlab.com/kicad/code/kicad/issues/10653
2022-01-29 18:19:22 +01:00
Seth Hillbrand ad84b62b63 Prevent multiple single-point line solutions
Suggested by @rivimey, we test the case where both lines return singular
point lines and prevent them leaking into our drag solution

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

(cherry picked from commit 38a4894d92)
2022-01-29 07:07:29 -08:00
jean-pierre charras 43f5a7c746 DIALOG_PLOT: use a short living quasimodal dialog instead of a long living window.
In this case, a quasimodal dialog is the right way.
Fixes #10650
https://gitlab.com/kicad/code/kicad/issues/10650
2022-01-29 13:14:22 +01:00
Seth Hillbrand c01e2dcfec Fix large memory leak in DRC
All elements get effective shapes, many of which get triangulated.  This
memory needs to be freed when destroying the tree

(cherry picked from commit c2707f3cc0)
2022-01-28 17:08:33 -08:00
Seth Hillbrand 16e802aff4 Don't count zero-length as duplicate
We were checking for duplicate tracks by looking to see if the two
tracks had two shared points.  A null track always matched this case,
which removed the valid track.  We solve this by avoiding null tracks in
the duplicate checker.  They are removed separately in the null track
stage.

This also fixes a GTK-specific tree issue where we require the
BeforeReset()/AfterReset() calls instead of Cleared() to prevent GTK
from dereferencing a parent after freeing

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

(cherry picked from commit 8753051db6)
2022-01-28 16:34:34 -08:00
Davide Gerhard ea9f960cc1 cmake: adding KICAD_MACOSX_APP_BUNDLE option
ADDED: with cmake KICAD_MACOSX_APP_BUNDLE option the user can disable
the macOS app bundle creation when compiling on macOS. This permit to
use/install KiCad like any other *nix platform (/usr/bin, /usr/share,
ecc.). By default, cmake build the app bundle.
2022-01-28 15:49:37 -08:00
Seth Hillbrand 7277fd6218 Don't allow degenerate lines in dragger
If walkaround returns an invalid line, don't consider it for a track

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

(cherry picked from commit 8ae304dcca)
2022-01-28 15:19:06 -08:00
Jeff Young 0036f44e37 Support (and save/recall) zoom in/out in Custom Rules editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/5796
2022-01-28 21:38:15 +00:00
jean-pierre charras 5b8eb8f9ec SVG plotter rework: use mm as units in file. Remove useless inch option.
Use 4 digits in mantissa as default and when exporting SVG.
Allow 0 as line width: this is the right value to draw filled shapes with no outline thickness.
2022-01-28 19:33:51 +01:00
jean-pierre charras 901a9387e9 Fix python fp wizards according to last kicad code changes, especially EDA_ANGLE 2022-01-28 19:33:51 +01:00
Seth Hillbrand d32a72ddde Fix PCAD arc import 2022-01-28 10:20:18 -08:00