163 Commits

Author SHA1 Message Date
Jeff Young
8b33b25e83 Use thermal reliefs to guarantee connection to hatched zones.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20447
2025-04-04 22:45:52 +01:00
Alex Shvartzkop
7a04389ac2 Improve pan performance when showing a large amount of TH pads.
See https://gitlab.com/kicad/code/kicad/-/issues/20506

(cherry picked from commit a1a710dfedec27514a089d2294e8ab516a1ce2d6)
2025-04-04 22:49:05 +03:00
jean-pierre charras
91dda80530 Pcbnew, printing vias: always print the via hole, even for small holes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20546
2025-04-04 16:40:53 +02:00
Jon Evans
dc9fa2e2ac More functional fix for IPC API item modifications
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20206
2025-03-28 20:27:45 -04:00
Jeff Young
07eda5d57e ADDED: report copper area for current selection.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20439
2025-03-27 10:14:30 +00:00
Jeff Young
0a4533703c Performance. 2025-03-24 10:28:41 +00:00
Jeff Young
b11b1a6f72 Ease in a bit more fmt::format(). 2025-03-11 10:08:04 +00:00
Jeff Young
727fc9bd06 Fix merge mess-up. 2025-03-07 13:23:57 +00:00
Jeff Young
877c6bce89 Printing is not zoom-specific.
(Some of these items don't currently get printed, but
there's no sense in leaving a latent bug around in case
we ever change our minds.)
2025-03-07 13:01:00 +00:00
Seth Hillbrand
7558b49afd Ensure all via layers are printed 2025-03-06 17:57:34 -08:00
Daniel Treffenstädt
3768221d9c ADDED: Support for IPC-4761 Via protection features
Fixes https://gitlab.com/kicad/code/kicad/-/work_items/18837
2025-03-01 18:02:54 +00:00
Jon Evans
41f5750be7 Fix logic in via high contrast LOD calculation
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20093
2025-02-25 20:59:26 -05:00
Jeff Young
9ca9d7120a Cleanup. 2025-02-20 17:47:40 +00:00
JamesJCode
c80a71f64a Make netclass name methods clearer, and improve doc strings
There are two netclass name methods, which previously were not
obvious in their uses. These have been renamed to now have:

GetName() : Used for internal or tooling (e.g. netlist export) usage
GetHumanReadableName() : Used for display to users (e.g. in infobars)

Fixing the previous unclear naming will result in fewer bugs
when users start using the multiple netclass functionality, as
the incorrect usage had started creeping in to new code. Also this
will help authors of new code select the correct name method.
2025-01-14 20:44:09 +00:00
John Beard
520a7cf62c GAL: ViewGetLOD should not be able to change the VIEW
Make the VIEW* parameter const. Since PCB_TEXT does a null-check,
it's not very clear if this can ever be null (and if it is,
why don't the other VIEW_ITEMs check?), so don't make them
all references too at this time.

Also dereference a few pointers a bit earlier to make non-null
promises sooner rather than later.
2025-01-02 22:59:31 +08:00
John Beard
527faddbfd GAL: provide constants for LoD HIDE/SHOW and a scale helper
Saves a mishmash of local HIDE/SHOW defs along with various literals.

Also provide a function that computes the scale at which a given
IU size becomes (notionally) a certain size on screen. While this
is a simple division, it's a bit opaque in terms of meaning.

Also it means the divide by zero case can be more universally
defended-against, which has traditionally been a bug opportunity.
2025-01-02 22:59:31 +08:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand
8724a7da09 Treat straight arcs as segments
When an arc has a very small curvature, we should not waste time with
the arc collision mode and instead just use the segment collision as it
is effectively the same result

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19422
2024-12-30 12:57:21 -08:00
John Beard
f7aded00c7 Pcbnew: draw clearance lines on their own GAL layers
This tidies up quite a performance hit on layer change
caused by repainting vias, pads and tracks for their
clearances.

Instead, on a layer change, just disable any old clearance
layer and enable the new one (if any).

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19404
2024-12-31 00:53:10 +08:00
Jon Evans
c77426cc12 Fix a few issues with via and pad rendering
The refactor of VIEW::SortLayers broke it, but this
was hard to notice until my recent changes.
2024-12-28 12:42:52 -05:00
Jon Evans
4eb68c2840 Fix pad and via opacity handling
With new rendering style, these need unique VIEW layers per copper layer
2024-12-28 10:50:58 -05:00
Jon Evans
78f83b5a39 Update PTH/Via rendering
- Add separate hole wall and net name color for vias
- Overemphasize hole wall thickness to make objects more visible
2024-12-28 10:02:11 -05:00
John Beard
37469b00b2 Pcbnew: fix track start property display
The display in the properties manager for arc tracks
was wrong. Implement a set of Get/SetStartX/Y functions
for the traces, to match the End functions.

This is needed because PCB_ARC overrides GetPosition
to return the arc center, not the start position (whereas
PCB_TRACK does return the start for GetPosition)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/19215
2024-11-28 05:56:40 +08:00
Jon Evans
10bd1b5c2a API: Fix via layerset handling
PCB_VIA doesn't use its padstack's layerset,
Make the serialization consistent and ensure that the
padstack layerset is always empty.
2024-11-21 21:06:20 -05:00
Jon Evans
d90f2842c8 API: Add layerset to via padstack serialization 2024-11-21 19:20:29 -05:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
Jon Evans
bc45f1b352 REMOVED: separate color for via net names
Vias can now use track net name color
2024-11-16 11:27:20 -05:00
Jon Evans
91db6e8aab Align API for padstacks with the actual implementation 2024-11-06 23:42:02 -05:00
Jon Evans
07bd497d9c Silence override warnings on recent GCC 2024-11-06 22:29:54 -05:00
Jon Evans
edfa57909b Vias: prevent assertion in GetEffectiveShape 2024-10-20 15:08:24 -04:00
Jon Evans
17e9a55cc8 Fix via bounding box calculation 2024-10-19 11:19:28 -04:00
Jon Evans
a0707285a1 Gate track soldermask properties to outer layers 2024-10-07 23:12:55 -04:00
Andrzej Wolski
537d3ac81a ADDED: Soldermask layer option for tracks
Allows adding a soldermask opening for individual tracks.
Soldermask expansion can also be specified.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2125
2024-10-08 02:48:33 +00:00
Jon Evans
473f19e8fb Remove some no-longer-necessary ifdefs 2024-10-06 21:19:05 -04:00
Jon Evans
2a605e4a4e Infrastructure and file format for via stacks 2024-10-06 18:45:25 -04:00
Jon Evans
ed0a265aa6 Prevent setting negative pad sizes 2024-10-02 21:18:10 -04:00
Jon Evans
37a656fae7 Patch a few blind/buried via rendering issues 2024-10-01 20:59:25 -04:00
Jon Evans
468ebc3174 CHANGED: Render vias using copper layer colors
Update microvia and blind/buried via rendering to remove
dedicated layer colors and only use copper layer colors
2024-10-01 19:55:05 -04:00
Jon Evans
56e0811516 Phase 2 of padstack support
CHANGED: PCB file format now supports saving/loading complex padstacks

CHANGED: PTH pads are now rendered per copper layer in the copper color;
         the PTH pad color is no longer used.

ADDED: support for importing complex pad stacks from Altium PCBs

Enforce padstack-aware access to pad properties across KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8182
2024-10-01 19:55:03 -04:00
John Beard
215533f31a Unify flip direction handling
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
2024-09-27 17:13:13 +01:00
jean-pierre charras
1db63ef36f Pcbnew: copy/paste vias: fix some issues:
- better fix for PCB_VIA::SetLayerSet() than commit 0c959075.
- Ensure saved via from a board and pasted to another board have a layer pair
compatible with this board copper layer count (if not, skip it)
- workaround in PCB_VIA::GetLayerSet() that hang when a LAYER_RANGE has start
and end layers id not compatible with the copper layer count (bug in LAYER_RANGE?)
2024-09-23 17:35:11 +02:00
jean-pierre charras
0c95907532 PCB_VIA::SetLayerSet(): fix incorrect calculation of top and bottom layer pair.
Vias use a top/bottom layer pair.
A layer set is used only to calculate this pair.
Recent changes in layer renumbering broke this calculation.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18759
2024-09-23 10:10:13 +02:00
Alex Shvartzkop
05b4aace38 Fix an issue causing "zbot < ztop" assert in 3D viewer on multilayer boards. 2024-09-19 10:07:32 +05:00
jean-pierre charras
2f0077eb00 Pcbnew, PCB_VIA::IsOnLayer() fix an issue for mask layers in blind/buried vias
Such vias not on a external copper layer cannot be on the corresponding mask layer,
regardless the tented options.
2024-09-16 10:07:46 +02:00
jean-pierre charras
d2cb868829 Pcb editor and 3d viewer: fix some issues:
- Fix incorrect values of displayed layers of blind/buried vias
- Fix possible incorrect layer order in PCB_VIA::SanitizeLayers()
- fix some display issues in 3D viewer.
- fix issue in LAYER_RANGE::Contains(): sometimes the test was incorrect.
2024-09-14 15:57:56 +02:00
jean-pierre charras
c8279dd458 PCB_VIA::IsOnLayer(): fix issue after layer numbering changes
PCB_VIA::IsOnLayer() returned incorrect result.
2024-09-12 19:01:20 +02:00
John Beard
a3a3f7648e Break ERROR_LOC out to its own header
Having this in geometry_utils.h means that touching
that header affects nearly every file, as this type is used
in EDA_SHAPE, BOARD_ITEM and SHAPE.
2024-09-11 22:08:36 +01:00
Seth Hillbrand
5e0abadb23 Reorganize layer numbering
F_Cu = 0
B_Cu = 2
Remaining internal copper layers are even and incrementing

Non-copper layers are odd and incrementing.

This means that we can no longer do things like:
for( PCB_LAYER_ID layer = F_Cu; layer <= B_Cu; ++layer)
Instead, we have the class LAYER_RANGE:
for( PCB_LAYER_ID layer : LAYER_RANGE( F_Cu, B_Cu) )

Similarly, gt/lt tests should not refer to the integer value of the
layer.  We have functions such as IsCopperLayer to test whether a layer
is copper or not.

When using the connectivity RTree, the third dimension is layer, so we
provide B_Cu with the special INT_MAX value, ensuring that elements
between F_Cu and B_Cu will be identified.  There is a new, special
function GetBoardLayer() for interfacing with CN_ITEMS

Similarly, PNS layers remain unchanged and sequential.  A set of
interface functions is provided to map PNS layers to Board layers and
back.  This allows the PNS_LAYER_RANGE to function as expected
2024-09-06 23:07:58 +00:00
Seth Hillbrand
b6c1a3ba63 Move SetLayerSet to const reference
Avoids potential performance inefficiencies
2024-08-17 07:56:30 -07:00
Jeff Young
cbfd6ec9ea CHANGED: remove single layer restriction for uvias.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18501
2024-08-15 16:42:57 -06:00