Commit Graph

377 Commits

Author SHA1 Message Date
Jeff Young 53bd87d792 Performance fixes for the board from hell....
(cherry picked from commit e4b56ab7f1)
2022-03-16 15:14:51 +00:00
jean-pierre charras 70514be11f Fix CMakeLists.txt syntax error and msys2 compatibility. 2022-03-13 12:50:26 +01:00
Marek Roszko 7558dad915 Don't use the ANSI version of SetDllDirectory 2022-03-12 21:45:14 -05:00
Marek Roszko 5e9b982ddf 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:44:36 -05:00
Marek Roszko 17539a564e Two very minor win32 calls to lock down dll/exe search paths from cwd 2022-03-12 15:47:48 -05:00
Marek Roszko ae01dc8ef1 Set SetErrorMode on Debug build
(cherry picked from commit d3ca857af7)
2022-03-12 01:57:45 +00:00
Marek Roszko 2874688281 Set some error flags for win32
(cherry picked from commit afaff022d7)
2022-03-11 01:17:50 +00:00
Seth Hillbrand 9ca35cbcee 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
2022-03-10 09:14:13 -08:00
Seth Hillbrand a24cdcb3f0 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
2022-03-09 16:19:15 -08:00
Seth Hillbrand a940607524 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

(cherry picked from commit ed7222b1e7)
2022-03-08 10:34:41 -08:00
Tomasz Wlostowski 680163f8a8 Cherry-pick commits from Master and about SVG import:
*Fixes in the SVG import polygon postprocessing:
- don't drop subsequent polys when a non-filled primitive is imported 'in between'
- fix missing holes (also related to the interleaving of stroke and filled shapes, depending on the software that wrote the SVG file)

*GRAPHICS_IMPORTER_BUFFER: forgot to store the indices of the paths belonging to a compound shape

*pcbnew: GRAPHICS_IMPORTER can now recognize multi-path shapes (and postprocess polygons with holes into Kicad-compatible fractured polysets)

*SHAPE_POLY_SET: polysets can now be built from a bunch of arbitraily ordered oriented outlines.
Used by the SVG hole support

*SVG_IMPORT_PLUGIN: enable postprocessing of polygons with degeneracy and holes

*pcbnew: SVG importer support for even-odd fill rule
2022-02-21 10:50:05 +01:00
Jeff Young 9c48707c88 For Coverity. 2022-02-17 14:30:47 +00:00
Jeff Young ff21a16f7d Formatting. 2022-02-17 14:30:47 +00:00
Wayne Stambaugh 54f91a0221 Wide characterize libs and bitmap2component source. 2022-02-09 09:01:53 -05:00
Seth Hillbrand 8fc831cbc2 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
2022-02-06 17:18:04 -08:00
Alex 73d0d7796c Allow overlay scrolling on GTK, except for GAL canvases.
This prevents glitches when both scrollbars
are visible and scrolling to the end.

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

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

(cherry picked from commit 4c4089e836)
2022-01-31 15:43:31 -05:00
Seth Hillbrand 857683d372 Remove unneeded distance calc 2022-01-18 15:58:20 -08:00
Marek Roszko 1e05732f55 Add std::hash specialization for VECTOR2I
(cherry picked from commit 589a03afcd)

Fixes https://gitlab.com/kicad/code/kicad/issues/10275
2022-01-05 20:32:46 -08:00
Jeff Young 1b033d56a7 Improve clean up tracks & vias algorithm for neck-downs.
Fixes https://gitlab.com/kicad/code/kicad/issues/10098

(cherry picked from commit d5a5928e5a)
2021-12-23 17:01:39 +00:00
Roberto Fernandez Bautista 4de4347baa SHAPE_ARC::Collide( aSeg ) must check segment end points as candidates
The edge case is when the segment is completely contained inside the arc
(This partially reverts b4835c8208 and
adds the missing test cases)
2021-12-14 16:14:56 +00:00
Roberto Fernandez Bautista b4835c8208 Add test case for SHAPE_ARC::Collide( seg ) + remove unneeded candidates
Followup to commit 01068e0d41
2021-12-13 18:06:11 +00:00
Seth Hillbrand 1b1bf8a17b Better handling of escaped characters in STEP parser
Fixes https://gitlab.com/kicad/code/kicad/issues/9897
2021-12-08 15:55:42 -08:00
Tomasz Wlostowski 01068e0d41 geometry: fix SHAPE_ARC/SEG collision
The arc2segment collision should at also include the arc endpoint projections on the segment being tested. Not sure it covers all possible cases, though.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9023
2021-12-09 00:37:58 +01:00
jean-pierre charras 0dad504e91 POLY_GRID_PARTITION: detect a divide by 0, set a wxASSERT and avoid the crash. 2021-12-08 16:07:11 +01:00
Roberto Fernandez Bautista 2d1ad52212 SHAPE_LINE_CHAIN: Fix arc indices rotation after merging duplicate points
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9843
2021-12-05 15:12:09 +00:00
Roberto Fernandez Bautista c463818b57 SHAPE_LINE_CHAIN: Only fix up arc indices if last pt is part of an arc
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9843
2021-12-03 22:04:55 +00:00
Jon Evans 0570c22732 Use point collision test for zero-length segments
SEG::SquaredDistance( SEG& ) does not do the right thing
for segments with zero length at the moment.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9791
2021-11-27 09:08:34 -05:00
Jon Evans b4342d813b Fix SHAPE_LINE_CHAIN::Slice when end is an arc followed by a point
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9770
2021-11-25 10:05:33 -05:00
Tomasz Wlostowski 5d2f3257da libs/kimath: user-settable distance threshold for SEG::ApproxParallel() 2021-11-22 01:35:12 +01:00
Roberto Fernandez Bautista 1026c24c65 SHAPE_LINE_CHAIN fix rotation of indices after going through Clipper
Clipper might mess up the rotation of the indices such that an arc can be split between
the end point and wrap around to the start point. Detect if this happened and fix it as
required.

Also, handle arcs at the last segment of the chain correctly, meaning we can have arcs
towards the end of the chain that finish at the starting point of the chain.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9670
2021-11-20 16:47:08 +00:00
Roberto Fernandez Bautista d47bd3a04d Rewrite broken collision routine SHAPE_ARC::Collide( SEG& aSeg ) 2021-11-15 14:04:37 +00:00
Roberto Fernandez Bautista cb7e57fb43 CIRCLE::IntersectLine fix incorrect algorithm documentation comments 2021-11-15 14:04:37 +00:00
Roberto Fernandez Bautista 0c3da0f072 Implement true arc collisions for arcs inside a SHAPE_LINE_CHAIN 2021-11-15 14:04:37 +00:00
Marek Roszko f5fc9fa11f Another auto proxy tweak 2021-11-13 21:23:32 -05:00
Marek Roszko 73f40b11ee Some more cleanup 2021-11-11 23:58:34 -05:00
Marek Roszko 009bb7f033 Add missing WinHttpOpen to resolve pac proxies 2021-11-11 22:56:45 -05:00
Marek Roszko b20317ca84 Some minor cleanup of the proxy detect 2021-11-11 22:47:21 -05:00
Marek Roszko e2926f69a5 Add support to fetch windows proxy config for use with curl
Fix https://gitlab.com/kicad/code/kicad/-/issues/9594
2021-11-11 09:30:10 -05:00
Jeff Young d66487c383 Make sure RTree bounding box is at least as big as hole.
Fixes https://gitlab.com/kicad/code/kicad/issues/9526
2021-11-05 14:29:10 +00:00
Johannes Pfister 64f77b3596 PNS: Add support for 90-degree corner modes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6902
2021-11-03 02:14:23 +00:00
jean-pierre charras 29c3601061 SHAPE_POLY_SET: add FullPointCount(), mainly for statistics and debug. 2021-10-24 15:06:24 +02:00
Jeff Young 9b9e379aa0 Overhaul arc internal model to not over-specify information. 2021-10-15 12:45:43 +01:00
Roberto Fernandez Bautista 9e557d84c6 Ensure appended arcs are valid arcs (start, mid, end cannot be collinear)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9380
2021-10-13 18:58:21 +01:00
Roberto Fernandez Bautista 4b8ca18bf7 Remove unfinished code for handling arcs in SHAPE_POLY_SET::booleanOp
Boolean Ops on polygons with arcs are not supported (the only exception
is Simplify)

Also fix a bug in SHAPE_LINE_CHAIN::splitArc that resulted in an
exception

Partially fixes https://gitlab.com/kicad/code/kicad/-/issues/9380
2021-10-13 18:29:32 +01:00
Seth Hillbrand c1e6fdfb47 Polygon triangulation: Check for broken remainders
If the last three points of a tesselation are concave, we will never be
able to triangulate them.  They were likely formed from a bad polygon,
so we will drop the triangle and return completed

Fixes https://gitlab.com/kicad/code/kicad/issues/9380
2021-10-12 12:14:42 -07:00
Seth Hillbrand 52bbfb9109 Remove dependency of dot size on linear mils
Changes a dot to be a square pixel (linewidth x linewidth).  This allows
the removal of IU dependencies and ensures that a dot is always visible
on screen.  Also makes sure that cairo is setting the current linewidth
during its stroke routines

Fixes https://gitlab.com/kicad/code/kicad/issues/9362
2021-10-10 09:40:26 -07:00
Jeff Young f606679164 Proper numeric sorting for intersheet refs.
Also expunges the horrifically named std::remove and std::remove_if
(neither of which remove anything).
2021-10-01 18:29:21 +01:00
Jon Evans e2368b733c Allow selection of NPTH pads with zero copper size
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9249
2021-09-26 18:17:50 -04:00
Roberto Fernandez Bautista 4abee7c2eb Fix SHAPE_LINE_CHAIN::Split when inserting a point on an arc
Ensure the arc is split into two at the point specified.

Partly fixes https://gitlab.com/kicad/code/kicad/-/issues/9023
Additional work required to ensure that the shove state is preserved.
2021-09-26 15:15:51 +01:00
Jeff Young 46949abe4a Don't scroll to highlight an object already visible. 2021-09-25 15:31:52 +01:00