There are problems internal to GTK that mean creating choice boxes with
a lot of items is a very slow process. This hack works around one of
those issues to make it faster to create and display the menu in the
choice box.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14277
This library is meant to move non-EDA items (language extensions,
library extensions, etc.) into the lowest-level of our dependency chain.
This library should never depend on anyother non-thirdparty code in the
kicad codebase.
acos(1) returns 0, so this implies infinite segements to get to 0 error.
This is not reasonable but might be encountered in bad arcs or circles
that have 0 radius. Instead of returning infinite or std::max segments,
we limit the error to be at least 1 IU
Rounded line ends when deflating leads to microscopic jags in the
outline that are not visible but add substantial computation time and
minor error when computing polygon offsets.
Instead, the chamfer deflate method prevents these jagged lines by
clipping angles < 90° by the error level. This does not impact deflate
calls where we explicitly require the angles to be maintained
Nominally, the zcode of a vertex is unique. This is not 100% true,
however, as we must interlace two 32-bit numbers into a single 32-bit
number. Sorting needs to account for the possibility that the zcode
will be the same while other elements of the vertex are different. This
commit fixes the broken boolean logic to more clearly handle these cases
Fixes https://gitlab.com/kicad/code/kicad/issues/13867
Just testing a single point to find copper that is outside the board works
until the arc->segment conversion moves the board outline just enough to
have the filled copper slightly (few IU) outside of the converted outline.
Instead, we do an expensive check of comparing the size of the
intersection between the island and the island's intersection with the
board. If the intersection is at least half as large as the original
island, we can say with certainty that the island is inside. The margin
could be much smaller than half but this preserves the intent without
picking an arbitrary number that might be violated
Fixes https://gitlab.com/kicad/code/kicad/issues/13717
The segment iterator creates segments when needed, so using it in a dual
loop creates NlgN more copies than we need. This shifts to a single
copy algorithm that then uses a sorting to preemptively abort the search
once the segments are outside of the search bounding box
Fixes https://gitlab.com/kicad/code/kicad/issues/13191