Commit Graph

472 Commits

Author SHA1 Message Date
Alex c107abe247 math: Use intrinsic functions for 64-bit rescale on MSVC. 2022-07-16 17:37:50 +00:00
Seth Hillbrand eccbb374a0 Add debug message to VECTOR3 check 2022-07-16 17:28:40 +00:00
Marco Langer 1606bfc9f8 fixed a runtime divide by zero crash for integral type template instanciations and made the class trivial copyable to increase performance 2022-07-16 17:28:40 +00:00
Alex 27869b1a37 Don't recalculate constants at every call in isqrt. 2022-07-16 14:53:18 +00:00
Jeff Young 0953395c87 LIB_SHAPE slightly abuses SHAPE_POLY_SET by using it for line chains.
Fixes https://gitlab.com/kicad/code/kicad/issues/11956
2022-07-08 21:35:40 -06:00
Seth Hillbrand 6fef054c51 Handle basic rounding error in schematic import
The fractional part of Altium schematic units is an integer number of
1/10000 mil segments, which is 2.54 nm.  The internal unit of eeschema
is 10 nm, so each fractional unit in Altium is 0.254 base eeschema
units.  To be consistent with
cf33cfcad1
we round to the nearest 10nm for each element

Fixes https://gitlab.com/kicad/code/kicad/issues/11742
2022-07-07 11:13:11 -07:00
Seth Hillbrand a8c6488358 Remove warning 2022-06-24 13:55:05 -07:00
Seth Hillbrand a118f20464 Hide cursor while warping on Wayland
Based on https://gitlab.freedesktop.org/xorg/xserver/-/issues/734 we
hide the window cursor prior to warping, which allows XWayland to
reposition the cursor.  This is only performed when Wayland is detected;
all other configurations call the standard warp routine

Fixes https://gitlab.com/kicad/code/kicad/issues/9785
2022-06-24 09:56:43 -07:00
Jeff Young 82ebc247b8 More performance enhancements for DRC. 2022-06-18 19:47:11 +01:00
Tomasz Wlostowski 3aed13278d geometry: more robust colinearity test in SHAPE_LINE_CHAIN::Simplify()
We now test the midpoint (B) of the 3 consecutive polyline points (A, B, C), since (assuming the angle between AB and BC is > 90 degrees) AC is always longer than
AB or BC. This minimizes the distance computation rounding error (in the previous algorithm, taking the point C for colineraity test) if AB is short and BC is very long, the test would
often fail due to rouding error in projection/line distance computation
2022-06-03 23:28:41 +02:00
Tomasz Wlostowski e6ebc2b9b9 geometry: use dedicated 64-bit integer square root for distance computations
Guarantees 1 LSB error, while the C++ double type has 55 mantissa bits (meaning for sqrt(X) >~ 2^22.5) the error is not guaranteed.
2022-06-03 23:28:41 +02:00
jean-pierre charras 046045f9de CalcArcCenter(): fix broken calculation of the arc center.
This function is used in the graphic items properties dialog, and each
arc edition from this dialog breaks the arc center position
Fixes #11703
https://gitlab.com/kicad/code/kicad/issues/11703
2022-05-31 10:48:54 +02:00
Tomasz Wlostowski 42e53ee8e9 kimath: fix regression in BuildInitialTrace()/CalcArcCenter causing incorrect arcs in routed traces 2022-05-27 17:41:05 +02:00
Mike Williams 9d90699358 Shape Assertions: print the correct type names
It still asserts, but at least for the right reason.
2022-05-26 15:32:45 -04:00
Seth Hillbrand 2a9d7314ca Initialize area check
Ensure that the max_poly set is zero before using
2022-05-26 08:19:16 -07:00
Seth Hillbrand 7dd0c67afd Handle hand-drawn holes in unfracture
We can't know that all holes will be ccw when entering unfracture.
Instead, we set the largest polyline to be the outline and the others to
be the holes.

(cherry picked from commit 1fe956c069)
2022-05-25 13:21:04 -07:00
jean-pierre charras 9108404efe Gerbview: seriously speed up the calculation time to draw polygons on OpenGL.
Mainly CacheTriangulation() was creating triangles using partition mode.
But this mode is optimized for Pcbnew and Gerbview and different internal units.
Now CacheTriangulation() is used in no partition, much faster in GERBVIEW_PAINTER.
Fixes #11549
https://gitlab.com/kicad/code/kicad/issues/11549
2022-05-13 18:20:35 +02:00
Jeff Young 728777da7c While icons aren't often used in Mac menus, they *are* supported. 2022-04-24 14:39:00 +01:00
Marek Roszko c64ea07d0b Check HKCU before HKLM for registry policies 2022-04-12 21:42:20 -04:00
Marek Roszko 392ed5fecd Add policy to enable/disable pcm 2022-04-12 10:08:34 -04:00
Roberto Fernandez Bautista 4defc946ef Fix rounding errors in SHAPE_ARC::Collide + fix qa tests
Use CIRCLE::NearestPoint to ensure consistency
2022-04-11 13:46:36 +01:00
Marek Roszko b3c5054d6c Add initial system policy checking for turning off data collection 2022-04-09 14:05:28 -04:00
Jeff Young 007906cd16 Fix a degeneracy bug in arc collisions.
This also fixes a failure to use the correct effective width for
shapes (which might, for instance, inherit their widths from schematic
defaults, netclasses, etc.).

Fixes https://gitlab.com/kicad/code/kicad/issues/11358
2022-04-08 16:15:58 +01:00
Seth Hillbrand 0625e20fc0 Cleanup spacemouse plugin
Sets std:: convention and unifies the defined/non-defined interface
2022-04-01 15:14:41 -07:00
markus-bonk 1a9ef4bd0f Add support for using a SpaceMouse to pan & zoom in the schematic editor. 2022-03-31 19:03:41 +00:00
Wayne Stambaugh 7b2d9dfc0c Fix some Coverity uninitialized scalar variable issues. 2022-03-24 13:17:07 -04:00
Seth Hillbrand 363ea99157 Avoid duplicate points in trapezoid pads
Duplicate points can be either positive-facing or negative facing, so
test absolutes

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

(cherry picked from commit 207820e112)
2022-03-22 13:30:45 -07:00
Jeff Young 65185f53a1 Rotate fp zones before comparing with library versions.
Also includes some performance fixes to not copy around triangulation
data when it's not needed.

Fixes https://gitlab.com/kicad/code/kicad/issues/10143
2022-03-14 15:53:24 +00:00
Marek Roszko 1890a1aa06 Don't use the ANSI version of SetDllDirectory 2022-03-12 21:40:47 -05:00
Marek Roszko d6c1f52b55 Plant the ability to verify code signing signatures when trying to load kifaces
Off by default and intended for use in released builds only
2022-03-12 21:40:47 -05:00
Marek Roszko 5ef6e97a9e Two very minor win32 calls to lock down dll/exe search paths from cwd 2022-03-12 12:57:15 -05:00
Marek Roszko d3ca857af7 Set SetErrorMode on Debug build 2022-03-11 20:51:01 -05:00
Jeff Young ae307e1b34 Parallelize DRC triangulation, keepout processing, and sliver checking.
Also fixes issue with adding fractured polygons in sliver checking which
slowed the board from hell down to less than a crawl.
2022-03-11 20:52:11 +00:00
jean-pierre charras 263faf2870 Fix compil issue (not defined items) on msys2 2022-03-11 09:35:38 +01:00
Marek Roszko afaff022d7 Set some error flags for win32 2022-03-10 20:17:01 -05:00
Seth Hillbrand e278e77314 Rework of a24cdcb3f0
Inflate with linked holes needs to account for fractured polygons,
otherwise inflating with positive value will create rounded divots where
overlapping fracture lines meet and inflating with negative value will
create spaces between fracture lines.

Calling Simplify before Inflate takes an inordinate amount of time as
the Clipper healing routine is rather slow.  Our own Unfracture is meant
to heal the results of our Fracture routine and works much more quickly.
After healing, we still call the Simplify routine

(cherry picked from commit 9ca35cbcee)
2022-03-10 09:15:50 -08:00
Seth Hillbrand e8d6d03247 Always return simplified polygons
Clipper can handle complex input polygons but we will sometimes struggle
dealing with outputs from the inflate routine that have degenerate or
overlapping points.  Calling Simplify after the inflate keeps our
polygons easier to handle

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

(cherry picked from commit a24cdcb3f0)
2022-03-09 16:19:44 -08:00
Jeff Young e4b56ab7f1 Performance fixes for the board from hell.... 2022-03-08 23:54:34 +00:00
Roberto Fernandez Bautista d39127cac7 Don't convert arcs with infinite radius - treat them as a line instead 2022-03-07 21:28:43 +00:00
jean-pierre charras 3bee9d3c59 Fix typo 2022-03-07 08:03:48 +01:00
jean-pierre charras dbfdd3fb56 Fix some Coverity warnings. 2022-03-06 09:48:33 +01:00
Seth Hillbrand 1a7d4f30d9 Fix proper rounding when generating arcs
We should allow for KiROUND to find the proper end point of the mid/end
elements when generating an arc from center/start/angle form
2022-03-04 13:14:19 -08:00
Seth Hillbrand ed7222b1e7 Adds uncertainty propagation to center point calc
Since we use center points to move back and forth for angle and
adjustments, we want to ensure that our center point is stable.

Rounding using integers introduces a 0.5 int uncertainty in each
measurement.  These are combined together multiple times to calculate
the center point, which combines the uncertainty.  Propagating the
uncertainty to the final calculation allows us to assign a range of true
values and pick the value that is most likely the correct value.

Fixes https://gitlab.com/kicad/code/kicad/issues/10739
2022-03-04 11:37:49 -08:00
Seth Hillbrand 3c2eb9311f Minor optimization for collision checking
Prevents extra center point calculations
2022-03-04 11:37:49 -08:00
Tomasz Wlostowski 2746be30c1 geometry: constructor for SHAPE_RECT from a BOX2 2022-03-03 01:02:00 +01:00
Jeff Young b9a834e600 For Coverity. 2022-02-17 16:23:52 +00:00
Jeff Young c89bb8d0cf Formatting. 2022-02-17 16:23:52 +00:00
Jeff Young b1bd8421e0 Performance: remove associated triangle sets when removing outline.
This saves us having to re-triangulate at the end of zone filling.
2022-02-16 17:00:54 +00:00
Jeff Young d8c4f2cb09 Performance improvements for zone filler. 2022-02-15 19:19:02 +00:00
Jeff Young 5c9e718407 Performance enhancements for connectivity.
1) Generate SHAPE_POLY_SET triangulation by outline so they can be
shared between connectivity system and other clients.
2) Don't add items to connectivity when reading board; we're going
to do a total rebuild anyway.
3) Use multithreading when caching triangulation.
2022-02-15 12:20:34 +00:00