When simplifying, a small difference in successive points would allow a
larger difference than aMaxError to be removed. This change checks the
intermediate points during removal to ensure we don't get overzelous
If you uncheck in the old IE options "Use the same proxy server for all protocols", then it returns an annoying string
like http=blah:1232;https=blah:1232;ftp=blah:2321 which we have to parse.
- Changes BOX2 size to extended coordinates.
- Adds BOX2ISafe to construct a BOX2I that will fit in int32.
- Adds more checks.
- Safer computations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17670
Ignore bus member connection subgraphs. They do not have a valid net
name nor do they contain schematic items. This prevents empty nodes
from being added to the tree. They can be reintroduced in the future
if someone wants to pursue it.
Freeze the wxTreeCtrl while populating it and thaw when done to prevent
any unnecessary repainting.
Add profiling to test how long it takes to rebuild the net navigator.
The recently added populate the navigator with all nets when no net
is highlighted has exposed some potential performances issues with some
versions of wxWidgets on certain platforms. Namely wxWidgets 3.2.4 on
Linux GTK.
Fix an issue where a sheet name change would not update the highlighted
net navigator resulting in a stale human readable sheet path.
Prevent the highlighted net navigator from being rebuilt twice when
loading a schematic. SCH_EDIT_FRAME::RefreshNetNavigator() was being
called from both SCH_EDIT_FRAME::UpdateHierarchyNavigator() and
SCH_EDIT_FRAME::RecalculateConnectivity().
Add a new trace helper "KICAD_UI_PROFILE" to show trace output when
profiling user interface performance. It's used in the net navigator
profiling mentioned above.
Reuse PROF_TIMER::Show() to generate string for PROF_TIMER::to_string().
The router needs to elimitate duplicate points but keep colinear
segments. This re-creates the partial routine from the old Simplify()
function
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17582
Check for vertex placement against original size. Since we are
potentially adding vertices that are out of order with the original
polygon, we only want to check against the first set of vertices when
checking for polygon collision
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17664
When we add vertices to the tesselation routines, we cannot reuse these
without the original vertex points.
It may be possible to copy and modify the vertices from the hint data so
that they are properly positioned but naive attempts (moving based on
first point) did not work, so for now, we disable the hint cache when
the vertex sizes do not match as this prevents OOB access
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17621
Polygon intersections happen against the original outline, not against
the currently remaining polygon. This avoids pathalogical cases
Adds new simplification system to avoid duplicated points
Adds new edge-splitting algorithm to provide additional fall-back
Verifies that polygon cuts do not swap holes for outlines (negative
area)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17559
Refactors `SHAPE_POLY_SET::fractureSingle()` to be more efficient, while
not changing the actual algorithm:
* increase cache locality by using contiguous arrays instead of what was
effectively a linked list
* reduce latency and jitter by replacing per-edge allocator calls with
ahead-of-time std::vector reserves
* increase cache efficiency by making the vertex struct smaller
* replace O(n^2) leftmost edge search with O(n log n) std::sort
* sort the polygons instead of the edges
* cut iteration count in half in the remaining O(polygons * edges) part
The minor triangles cost the same amount of compute time as larger ones
but do not have a material effect on the zone display. This skips these
minor triangles when earcutting
Logging is useful when we find an area that cannot be triangulated.
This will be used to generated test cases.
Skipping minor untesselated areas means that the polygon will still be
considered fully tesselated (and not sent back again and again) even if
the tesselation misses an area less than the configured limit.
Currently, this is 31^2nm.
The m_triangulationValid flag is used in several places without holding
the mutex, thus it should only ever be set when the triangulation is
guaranteed to be valid.
This can either be done by protecting both data and flag by the same
mutex, or updating the flag only after the triangulation has finished.
Also fix the case when the triangulation actually fails, the flag should
not be set in this case.
While at it, simplify the recalculation check. Only if both the
triangulation is valid, and the data hash is unchanged the recalculation
can be skipped - this is typically the case when two threads try to
update the cache concurrently, the second one will block at the mutex,
and will see the valid data after the first thread has finished.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17180
When checking collisions, the SHAPE_POLY_SET::Collide() routine is not
const because it will regenerate the triangulation cache if it is out of
date (using a const_cast, grrr). This sidesteps the issue by assigning
a mutex to the triangulation caching
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17180
SHAPE_LINE_CHAIN_BASE can include things that are not SHAPE_LINE_CHAIN
like the triangle SHAPE_LINE primitive. To check arcs, we need to avoid
these elements as they do not have the full SHAPE_LINE_CHAIN class
available.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17327
The clearance between two zones could be rather slow. This was in part
to trying to do triangle-triangle collisions between zones when we only
need outline collision and in part to the shape_line_chain collision
routine. The shape_line_chain collisions don't need to recreate
segments on each iteration and should instead create them once and using
this to check all collisions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17327
Also fixes length preview when hovering over joints.
Also prevents asserts when hovering over arcs.
Also prevents adding a tuning pattern on other tuning pattern.
(cherry picked from commit 711c6141a8)
Allow for overlapping points in input polygon. This is relatively
common on a grid and should be used as potential split points to shave
additional ears
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16933
Failed triangulation can have multiple causes but we don't have another
approach, so skipping the cache just causes the same issue to be raised
again and again
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16946
Setting the environment variable KICAD_ENABLE_WXTRACE now enables wx
trace logging on all platforms. MSW still requires its original
environment variables to be set to get the console displayed.
This maintains the primary goal of ensuring that bad splits do not allow
the triangulation process to continue. Instead, we boot this back up to
the top-level where we will simplify the polygon before triangulating
again.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16624
- Avoid double-splitting a single point
- Check for mid-line intersections
- Avoid splitting zero-area polygons
- Keep full z-list for intersection checks
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16241
It happens when the segment (aStart, aMid) is horizontal
Probably also when the segment (aEnd, aMid) is horizontal
Slopes with value 0.0 are set to double:: epsilon(), but it was a too small values
generating broken calculations.
Now set to 1e-10 (it seems working).
Fixes#16089https://gitlab.com/kicad/code/kicad/-/issues/16089