7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-03-30 01:26:54 +00:00
Commit Graph

941 Commits

Author SHA1 Message Date
Seth Hillbrand
de09403b10 Fix mistake in arc circle collision
Need to test nearest point from the circle center to the arc.  Add QA to
prevent regression

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20336
2025-03-14 18:06:09 -07:00
Alex Shvartzkop
dc961d37ad Optimize SHAPE_LINE_CHAIN_BASE::EdgeContainingPoint. 2025-03-09 16:27:07 +03:00
Alex Shvartzkop
b91e005277 Pre-fetch segments in SHAPE_LINE_CHAIN::SelfIntersecting. 2025-03-09 16:27:04 +03:00
Alex Shvartzkop
a82916f4db Improve performance of SEG::Contains. 2025-03-09 16:27:01 +03:00
Alex Shvartzkop
18d836ef8b Reduce CSegment calls in SHAPE_LINE_CHAIN::SelfIntersecting. 2025-03-09 16:26:57 +03:00
Seth Hillbrand
c24832f72b Fix IsEffectiveLine calculation
We sometimes represent circles as 360° arcs.  These are approximately
colinear but are definitely not a line
2025-03-06 12:45:10 -08:00
Kreijstal
c2685ef76f Fix compilation on mingw 2025-03-03 01:56:30 +00:00
Jeff Young
3f15b0d75b ADDED: hatched fills for shapes. 2025-02-24 11:08:29 +00:00
Jeff Young
b74c2791f4 Allow context menus in footprint chooser when called from Eeschema.
Also moves several RAII utility classes (some of which
were duplicated in open code) to a common header file.
2025-02-24 11:08:29 +00:00
Jeff Young
e483c48fe6 Re-balance file sizes. 2025-02-24 11:08:28 +00:00
jean-pierre charras
dc1ecea4bc OUTSET_ROUTINE::ProcessItem(): handle an exception thrown for incorrect prm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19880
2025-02-07 19:47:48 +01:00
John Beard
43be371f83 Kimath: don't access aActual unless set
Avoids at least one test failure in qa_pcbnew
due to uninitialised access.
2025-01-24 20:26:31 +08:00
Seth Hillbrand
0281bfe05e Fix missing display pads on MacOS
The distance from any point in the negative quadrant to
std::numeric_limits::max will be larger than std::numeric_limits::max,
meaning that if we take the square of this value, we will overflow the
extended_type.  Overflows are undefined behavior when dealing with
signed integers (c.f. C99 §3.4.3/1) so while most compilers retain a
positive value, Apple, in release mode, overflows into the sign bit,
resulting in a negative number for the squared distance.

This prevented us from displaying certain shapes in the negative
quadrant on MacOS, only in release mode builds

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19424
2025-01-21 20:05:25 -08:00
jean-pierre charras
2a143a63e5 Build on MSYS2: use shobjidl.h, instead of shobjidl_core.h
shobjidl_core.h is not available on mingw
2025-01-16 09:59:12 +01:00
Marek Roszko
337ec6d862 Add a version_header depend, not ideal 2025-01-15 21:27:08 -05:00
Marek Roszko
a0b50622dd Implement AppUserModelID for windows 2025-01-15 20:36:15 -05:00
Alex Shvartzkop
3a0df97dbf Optimize SHAPE_LINE_CHAIN::Segment slightly. 2025-01-15 18:07:57 +05:00
Seth Hillbrand
5cd9e319d3 Handle more arc degeneracies 2025-01-14 13:08:45 -08:00
Seth Hillbrand
bfb3875a68 Add additional handling for arc collisions
Provides nearest point calculation for circles, segments and rects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18203
2025-01-14 13:08:45 -08:00
Seth Hillbrand
bcebc694b8 Implement MTV for arcs 2025-01-14 13:08:45 -08:00
Seth Hillbrand
b73481dd49 Update SHAPE_ARC::IntersectionPoints()
Force it to handle a number of edge cases from Arc-Arc collision test.
Unify and simplify the Collide Arc-Arc.  Add additional arc collision
QA test
2025-01-14 13:08:45 -08:00
Jeff Young
77a524fa22 Fix slicing operator.
(Also a minor performance improvement.)
2025-01-14 12:41:16 +00:00
Seth Hillbrand
3e8791b88d Fixup multiple issues with DP checks
Handle arcs properly even when not exactly concentric.  Properly check
for interfering elements that would prevent coupling.  Avoiding those
that are directly connected

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17967
2025-01-13 16:11:16 -08:00
Seth Hillbrand
8ab5d95d1b Handle GTK themes that don't use the revealer 2025-01-11 19:56:42 -08:00
Marek Roszko
06a61e773f Fix bg/fg fed to GetInfoBarColours 2025-01-11 16:26:02 -05:00
Jon Evans
4279672876 Fix incorrect signature 2025-01-10 21:59:51 -05:00
Seth Hillbrand
e8167f33d7 Grab GTK default colors for infobar
This implements the wxWidgets fix for KiCad.  We can't wait for distros
to update their wx libs so until then, we'll roll our own.

Nicely, this also implements the MacOS setting that was an ifdef
previously

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19506
2025-01-10 17:32:51 -08:00
Seth Hillbrand
452e69de85 Move thread pool into true singleton
Thread pool needs to be stored in a single location for all of KiCad
otherwise each kiface will spin up its own pool of persistent threads
2025-01-09 09:03:08 -08:00
Alex Shvartzkop
9a3d7594d9 Add pivot/pan/rotation/lights controls to PCB render dialog. 2025-01-05 11:42:58 +05:00
Seth Hillbrand
074e6df3bc Revert "Move thread pool to singleton class"
This reverts commit 361f61a023.
2025-01-03 21:22:44 -08:00
Seth Hillbrand
361f61a023 Move thread pool to singleton class
Having thread pool as its own singleton in the library meant that each
kiface had its own threadpool, leading to many multiples of the threads
being started.  Placing a singleton class in PGM_BASE ensures that all
kifaces use the same thread pool.

The singleton class can be extended to provide single instance
guarantee for any element across kifaces
2025-01-03 13:51:11 -08:00
Seth Hillbrand
9a10d2ff54 Silence SWIG warnings
Expressly state which operator will work in Python (which doesn't really
know integers anyway)
2025-01-01 19:47:13 -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
Jon Evans
a4ac22f2d6 SHAPE_POLY_SET: Fix up non-closed outlines when added 2024-12-30 20:33:51 -05:00
Ian McInerney
2ddcc7a7ad Add error handling to posix function call 2024-12-31 00:18:10 +00: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
Jon Evans
ca68ac0076 kinng: use longer lifetime for incoming message string 2024-12-30 09:32:11 -05:00
jean-pierre charras
f8ae28578f SHAPE_LINE_CHAIN() ctor: ensure arc info exists before trying to add it
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19419
2024-12-30 11:47:30 +01:00
Marek Roszko
0e1b47427c Add a windows specific hack to make backups work past max length
Since backups are most likely to encounter max path limitations compared to other things we do in kicad
2024-12-29 19:54:11 -05:00
Marek Roszko
41d7711f06 Add a function to create long paths on windows 2024-12-29 18:21:49 -05:00
Seth Hillbrand
e9bc8cfe9d Give Clipper1 a Viking funeral
Clears out the last spot where we were only using Clipper1 (how'd I
miss that?) and remove all calls to the Clipper1 structures
2024-12-23 17:12:09 -08:00
John Beard
e2136db5c2 Fabmaster: handle squares, oblongs, and regular polygons.
Fabmaster supports at least triangles, hexagons x and y, octagons
and diamonds.
2024-12-03 20:08:12 +08:00
John Beard
926ef7677b Fabmaster: never add null holes to polygons
By adding points to holes as we go, we leave ourselves open
to adding invalid (<3 point) holes to the polygons. This causes
crashes if it happens, so we should never allow it to happen.

Instead of building holes in-place, construct them externally
and only add them if they are valid.

This probably wouldn't actually happen for a valid Fabmaster
file, but if it did, it would be bad new, and we shouldn't leave
crashable pathways facing user input.
2024-12-03 20:08:12 +08:00
jean-pierre charras
d3bcc81d5d libkimath: fix a link issue on mingw/msys2 build.
Remove option "use Clipper1" (now outdated) on all platforms.
Use of advanced config created the issue, so it is just disabled on msys2.
Should not change anything on other platforms.
2024-12-01 09:38:49 +01:00
Marek Roszko
904e0cd87e Silence build warning about int to double cast 2024-11-29 10:55:21 -05:00
John Beard
df933df416 Multichannel: split out some geometric routines
Putting them somewhere in the geom utils means they
can be reused, and also tested if needed.
2024-11-08 19:48:03 +08:00
Seth Hillbrand
7916b1ddb8 Fix error in PointInside
If we are checking a point that is inline with multiple segments, we
were counting both the entry and exit as crossings, leading to points
inside a polygon being registered as outside.  Changing the conditional
to only catch one crossing as required.

Adds a QA check to ensure that this remains fixed

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18377
2024-11-07 09:09:00 -08:00
Jon Evans
420ea9da9d Add some logging to KINNG 2024-11-05 18:38:27 -05:00
Jon Evans
d0b2334ceb PNS: Support via stacks 2024-11-04 21:30:38 -05:00
Tomasz Wlostowski
f7e37bf9f2 kimath: bring back the legacy SHAPE_LINE_CHAIN::Simplify() function
It looks like the new variant (with aMaxError) behaves in a subtly different way, resulting in router hiccups.

This needs more in-depth investigation, but for the moment, the older function does the job.
2024-11-02 19:59:09 +01:00