Commit Graph

378 Commits

Author SHA1 Message Date
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
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
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
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
Jeff Young 98b9c6e2a1 Better progress reporting and a slight performance boost on commit. 2022-02-15 12:20:34 +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
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
Mike Williams a5e8575091 Eeschema: Implement orthogonal dragging
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1956
2022-02-10 18:38:40 +00:00
Wayne Stambaugh e93b7b05ec Wide characterize libs and bitmap2component source.
(cherry picked from commit 54f91a0221)
2022-02-09 11:49:58 -05: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
Marek Roszko 41f54349a5 Replace inserts/push_backs with emplace in some spots 2022-02-05 19:53:31 -05:00
Jeff Young 3f8cada334 Fix some issues with new polygonization of arcs and arc collision test.
Test should not be testing against the polygonization error; if done
correctly that should all be on the correct side of the shape.  Use an
epsilon instead (I chose polygonization error / 10, but the value isn't
terribly important).

Fixes https://gitlab.com/kicad/code/kicad/issues/10724
2022-02-03 19:53:42 +00:00
Jeff Young 08ee2671cc A better arc-to-polygon algorithm when error is outside.
The existing algorithm nicely handled the error being on the inside (where
the segment ends are error-free), but not when it was on the outside (where
the segment midpoints are error-free).

In any case, we want error-free points at each end of the arc so we don't
get ears or divots.
2022-02-02 23:40:24 +00:00
Seth Hillbrand 82ceaf0d9b Try not to Simplify lines to a single point 2022-01-31 16:13:27 -08:00
jean-pierre charras 0bc5cb33ed Fix a few issues in plotting code. Fix bug in EDA_ANGLE::IsCardinal()
Fixes #10547
https://gitlab.com/kicad/code/kicad/issues/10547
2022-01-21 12:35:58 +01:00
Jeff Young c8a50d9b50 Remove unit-less angles from VECTOR2I/D APIs. 2022-01-20 23:58:20 +00:00
Jeff Young 14006495d5 Angle cleanup. 2022-01-20 22:35:41 +00:00
Jeff Young 4eac8d7c66 Remove unit-less angles from geometry lib APIs. 2022-01-20 21:10:04 +00:00
Jeff Young 854987f663 Remove unit-less angles from geometry manager APIs. 2022-01-20 21:10:04 +00:00
Jeff Young fbab335128 Retire DPOINT and DSIZE. 2022-01-20 21:10:04 +00:00
Jeff Young af20d46d06 Fix converting angles from tenths of a degree.
(Conversion was upside-down.)

Also fixes bugs with rotation angle increment not getting units
set and with a 0 footprint editor value overwriting a non-zero
pcb editor value (or vice versa).
2022-01-19 19:55:50 +00:00
Jeff Young 9298da4ebc ArcToSegmentCount calcs need to use abs value of angle. 2022-01-19 16:01:23 +00:00
Ola Rinta-Koski ef721f051a copyright note removed 2022-01-19 15:30:06 +02:00
Jeff Young 2a60017ffa Fix error in trigo.
Fixes https://gitlab.com/kicad/code/kicad/issues/10495
2022-01-19 00:10:32 +00:00
Seth Hillbrand 57afdf153d Remove unneeded distance calc
(cherry picked from commit 857683d372)
2022-01-18 15:59:16 -08:00
Jeff Young 4e493e2cbc Clean up some more deci-degrees. 2022-01-18 14:08:47 +00:00
Jeff Young f310a5b986 Excise deci-degrees from trigo. 2022-01-18 11:44:55 +00:00
Jeff Young 92dae4646e Yeet dec-degrees from covert_basic_shapes_to_polygon. 2022-01-18 10:14:52 +00:00
Jeff Young b828355206 A bit more angle cleanup. 2022-01-18 09:48:24 +00:00
Jeff Young e37ca2f757 Remove dead code. 2022-01-18 01:40:03 +00:00
Jeff Young 8c246a761d Move EDA_ANGLE from int to double. 2022-01-17 20:57:54 +00:00