Commit Graph

42036 Commits

Author SHA1 Message Date
Seth Hillbrand 55c864ec45 Fix incremental connectivity
The connectivity routine would consider symbols, overwriting unused
subgraphs for pins that were not in the change list.  This is resolved
by updating the full connectivity to only use pins in the graph since
symbols are not connected independently.

In the process of adding QA tests for this change, additional issues
with the schematic QA were discovered.  Specifically, we were not
properly setting the root sheet UUID.  This was partially masked by a
const_cast setting of the RefDes in sch_symbol when called the RefDes
getter.  This exposed the fact that our QA ERC numbers did not match the
schematic editor stand alone ERC numbers.  So the test value for one
check needed to be updated

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17528

(cherry picked from commit a9f35ba42e)
2024-04-14 14:14:38 -07:00
Seth Hillbrand 07b5fd342a Ensure that we are not calculating self-collision
Ratsnest may have connections from a zone to two different items.  This
should be avoided as we never want to draw the ratsnest line with the
same element as start and finish

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17763

(cherry picked from commit 8760519a87)
2024-04-14 13:50:44 -07:00
Seth Hillbrand 4481fcc75e Check for valid shared pointer before locking
We don't neccesarily have a valid pointer to the parent lib symbol when
checking if it is a power symbol, so fall back to the local flag if this
is the case

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17182
2024-04-11 14:42:53 -07:00
Seth Hillbrand a155dd32e8 Do not set optional defaults
In the file format, the 'mirror' tag is optional (not written unless on)
so we cannot default the new text to 'mirror' on just because the
footprint is on the back layer as it won't be turned off by the
footprint loader.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17546

(cherry picked from commit d0fe2e06aa)
2024-04-11 09:43:55 -07:00
Wayne Stambaugh c4c804edf7 Update hierarchy navigator when undoing or redoing sheet name changes.
Use new schematic commit object in the edit sheet properties dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17721

(cherry picked from commit ec310ac3ed)
2024-04-11 10:51:04 -04:00
Wayne Stambaugh b26ca0e21a Maintain hierarchy navigator expansion state between edits.
Prevent the hierarchy navigator from being rebuilt unless there are actual
sheet changes that would cause a change to the tree.

Save the tree expansion state before rebuilding the tree and then restore
the expansion state to the previous state sans edits.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16635

(cherry picked from commit 797ab998cc)
2024-04-11 10:32:40 -04:00
Alex Shvartzkop 97b15a1708 Show actual IO_ERROR message at VRML import.
https://gitlab.com/kicad/code/kicad/-/issues/17727
2024-04-11 14:36:44 +03:00
Seth Hillbrand e808ab7409 Re-add routine to remove duplicate points
The router needs to elimitate duplicate points but keep colinear
segments.  This re-creates the partial routine from the old Simplify()
function

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17582

(cherry picked from commit 59f99d9a6a)
2024-04-11 14:20:50 +03:00
Huang Rui 7dc8527022 libgit2-1.8.0 compatibility: adjusted parent pointer type
- Adjusted parent pointer type in git_commit_create call for compatibility
  with libgit2 1.8.0 and above.
- Included preprocessor checks to maintain support for versions older than
  1.8.0.
- Ensures consistent function behavior across different libgit2 versions.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17536
Signed-off-by: Huang Rui <vowstar@gmail.com>


(cherry picked from commit 1cbf6a1872)
2024-04-11 08:45:19 +00:00
afkiwers f7765ea5b9 add support to update an already existing field
(cherry picked from commit d45911f54b)
2024-04-09 23:37:52 +00:00
Marco Ciampa f1d687cfdb Updated Italian translation 2024-04-08 23:17:23 +02:00
Marek Roszko 57468c29f9 Use kicad-vcpkg fork of liblzma to fix builds
(cherry picked from commit 6ac1f39e62)
2024-04-07 14:55:55 +00:00
Jon Evans 30df673ffa Check for bus no-connects in ERC
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13285


(cherry picked from commit ce846f5c22)
2024-04-07 12:50:45 +00:00
Jon Evans 55b7852a65 Disable lazy-loading of 3D models on macOS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17198


(cherry picked from commit b36312ff24)
2024-04-07 12:21:11 +00:00
JamesJ 026685ee48 Check a SHAPE_POLY_SET outline exists before attempting to get it by index
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17687
2024-04-06 20:17:39 +02:00
Jon Evans 8b5c292397 Fix SWIG wrapper for AddPrimitive
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17676


(cherry picked from commit c1e7668d80)
2024-04-05 03:09:35 +00:00
Marek Roszko 941420abed Add missing gltf find in occ 7.8
(cherry picked from commit 58913a0616)
2024-04-03 01:07:18 +00:00
Jon Evans a042d1aab4 Show all library children if library name matches search 2024-04-02 18:51:19 -04:00
Jon Evans 53c2543474 Fix parsing of legacy text hide token 2024-04-02 18:26:30 -04:00
Alex Shvartzkop bac0820864 Improve moving, rendering and plotting of very small angle arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17110


(cherry picked from commit b905b4eac8)
2024-04-02 21:41:09 +00:00
Seth Hillbrand e0381f25f7 Prevent OOB access in polygon split
Check for vertex placement against original size.  Since we are
potentially adding vertices that are out of order with the original
polygon, we only want to check against the first set of vertices when
checking for polygon collision

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17664

(cherry picked from commit 8260c174e9)
2024-04-02 11:23:30 -07:00
Mike Williams ce2ea3f3ae PCB: update footprint field when changing footprints
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17598
2024-04-02 08:18:23 -04:00
Seth Hillbrand c0d38de280 Add some corrections to IPC2581 export syntax
Outline fonts need lineDesc
Padstack def need the location for the pad relative to the padstack

(cherry picked from commit 2123e2ca9c)
2024-04-01 22:59:40 -07:00
Marek Roszko 9a728c37df Use macro not function for the occ lib find
(cherry picked from commit 303bc19ce8)
2024-04-02 01:55:08 +00:00
Seth Hillbrand 6be6210b67 Recreate teardrop QA board for v8 2024-04-01 17:55:29 -07:00
Seth Hillbrand b21165722b Forward and reverse test for point in poly collisions
(cherry picked from commit 4e6cd0d293)
2024-04-01 17:55:29 -07:00
Seth Hillbrand fd5d68ca9b Remove duplicated clearanceEpsilon
We already get clearance epsilon in the clearance resolver.  Don't
subtract it twice or we end up getting DRC errors

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16879

(cherry picked from commit 10c1072479)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 9f26cbb89a Add colored tab to fileicons
Allows differentiation when Windows badges the bottom left

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17525

(cherry picked from commit e11cc322fd)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 0dc894356b Check singular arcs connection
Even if there are no other segments in the line chain, we still should
check for arc connections in cases of individual arcs on a line chain

(cherry picked from commit 6b915049d1)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 6b5acdea1f When dragging a via, we need to get all obstacles
The clearance epsilon should not be used to limit which force elements
we return in the query.  Otherwise, we can drag elements into a
DRC-violating space

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16293

(cherry picked from commit 5e850911c5)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 892c5726f5 Move logging message after vertex check
When creating the list, we may have fewer than needed vertices, which
prevents calculating the area

(cherry picked from commit 6c05f2c67c)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 6c7261a223 Utilize hash_combine to avoid hash collision
Most of our pointers will share the top 32 or more bits of their pointer
addresses, making cache collisions highly likely.  This uses a hash
combiner to mix the bits more effectively

(cherry picked from commit e4756c811e)
2024-04-01 17:55:29 -07:00
Seth Hillbrand ae11213622 Handle small holes in DRC Connection width test
If there is a small hole (smaller than the conn width), we can loop
around in a circle checking all points and not move past the mimimum
distance.

To avoid this, if we detect a loop, we exit the substantial checker.
This should return with true because a large hole will return true and
we are only checking to see if there is a minimum amount of copper
between two open areas

(cherry picked from commit c841d0df6d)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 4bf35cbed8 Remove duplicated clearanceEpsilon
We already get clearance epsilon in the clearance resolver.  Don't
subtract it twice or we end up getting DRC errors

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16879

(cherry picked from commit 10c1072479)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 7916e56963 Avoid crashing on missing tracks in CADSTAR
We can't assume that the ignored connection exists when trying to set
the junction size.  We use int_max for the default instead of 0 so that
later, we don't try to create a minor track with 0 width in loadNets()

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17523

(cherry picked from commit 00d108498f)
2024-04-01 17:55:29 -07:00
StefanBruens b9b4ff6f5e Fix triangulationValid check race for zone fill
The m_triangulationValid flag is used in several places without holding
the mutex, thus it should only ever be set when the triangulation is
guaranteed to be valid.

This can either be done by protecting both data and flag by the same
mutex, or updating the flag only after the triangulation has finished.

Also fix the case when the triangulation actually fails, the flag should
not be set in this case.

While at it, simplify the recalculation check. Only if both the
triangulation is valid, and the data hash is unchanged the recalculation
can be skipped - this is typically the case when two threads try to
update the cache concurrently, the second one will block at the mutex,
and will see the valid data after the first thread has finished.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17180

(cherry picked from commit e07b4ce8e4)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 734222bd88 Fix race condition in zone fill
When checking collisions, the SHAPE_POLY_SET::Collide() routine is not
const because it will regenerate the triangulation cache if it is out of
date (using a const_cast, grrr).  This sidesteps the issue by assigning
a mutex to the triangulation caching

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17180

(cherry picked from commit 81cb6d0c3f)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 01590385c7 Handle issue with alternate SHAPE_LINE_CHAIN
SHAPE_LINE_CHAIN_BASE can include things that are not SHAPE_LINE_CHAIN
like the triangle SHAPE_LINE primitive.  To check arcs, we need to avoid
these elements as they do not have the full SHAPE_LINE_CHAIN class
available.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17327

(cherry picked from commit 347c50b26d)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 9be4bf0d14 Fix slow selection time when calculating clearance
The clearance between two zones could be rather slow.  This was in part
to trying to do triangle-triangle collisions between zones when we only
need outline collision and in part to the shape_line_chain collision
routine.  The shape_line_chain collisions don't need to recreate
segments on each iteration and should instead create them once and using
this to check all collisions

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17327

(cherry picked from commit 3cc1617f5a)
2024-04-01 17:55:29 -07:00
Seth Hillbrand b1677d5f47 Clean and standardize cross-probing action
Between schematic and pcb editors, we want the following actions:

- Single click on ERC/DRC item should show the item in the ERC/DRC
  window.  But if the window is not visible, it should only update the
  status bar
- Double click on ERC/DRC item should show and raid the ERC/DRC window
  as well as select the line item

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17383

(cherry picked from commit 0f57d76ecd)
2024-04-01 17:55:29 -07:00
Seth Hillbrand 1e13a7640e Tidy up some remaining triangulation cases
Found and fixed a few corner cases where triangulation point removal
could reset expected points

(cherry picked from commit 553e4a25bf)
2024-04-01 17:55:29 -07:00
Marek Roszko 804283877c Fix cmake find of opencascade libraries for occt 7.8
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17654


(cherry picked from commit c8e41dcfe8)
2024-04-02 00:50:12 +00:00
jean-pierre charras 65ace8d03d 3D viewer: Allow setting colors not in board stackup, when use board stackup option is set.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17632
2024-04-01 09:38:24 +02:00
Seth Hillbrand 890376d04f Do not use cache when we modify vertices
When we add vertices to the tesselation routines, we cannot reuse these
without the original vertex points.

It may be possible to copy and modify the vertices from the hint data so
that they are properly positioned but naive attempts (moving based on
first point) did not work, so for now, we disable the hint cache when
the vertex sizes do not match as this prevents OOB access

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17621

(cherry picked from commit 06b199fd41)
2024-03-31 15:01:16 -07:00
JamesJ 18990587b9 Only delete grouped / generated BOARD_ITEMS from the root item
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17527

This is required as during an undo / redo operation, rebuilding
the previous selection can result in a group / generator being
selected as well as all of their contained items. This prunes
the contained items to remove the possibility of a double-delete.

(cherry picked from commit 6c73f1feef28925bf26fcc3669cb6333aad5f1d3)
2024-03-30 14:20:58 +00:00
James J 75ef003747 Add option to preserve custom power flag values in Update Symbols from Library dialog
(cherry picked from commit bf7896a0e1)
2024-03-30 14:15:29 +00:00
Marek Roszko b9a6f47929 Fix DRC slowdown due to UI yields
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17434


(cherry picked from commit fd501b4bc8)
2024-03-30 03:34:27 +00:00
Jeff Young 857219d70d Fix merge error. 2024-03-29 18:26:14 +00:00
Jeff Young 92275c41cc ADDED: Expose units and DeMorgan to properties system.
(Also fixes inheritance bug in LIB_PIN's properties.)

(cherry picked from commit 58df9c96f4)
2024-03-29 17:49:48 +00:00
Jeff Young 09985988e7 Fix footprint undo for new UUID caches.
The footprint's children get swapped by the parent's std::swap
call, so they need to get removed/added to their parent around
the swap.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17592

(cherry picked from commit 2c21ef1ed0)
2024-03-29 17:48:12 +00:00