- allows setting a minimal seg count for circles and rounded end segments.
- When using ERROR_OUTSIDE, ensure the arc correction is the actual value
needed by the segment count, not the max value allowed
This ensures that the arc shapes remain correct after removing
a point belonging to an arc or inserting a point in the middle
of an arc.
Simplify implementation of Replace( ..., aP ). Now a Remove
operation followed by an Insert operation.
Improve QA test for SHAPE_LINE_CHAIN Append, Insert and Replace
Implement SHAPE_LINE_CHAIN::splitArc to break up an arc into two
Implement SHAPE_ARC::ConstructFromStartEndCenter and add qa test
The algorithm relied on the assumption that the points were
ordered anti-clockwise. When ordered in a clockwise fashion, the
result was correct but negative.
Refer to https://www.mathopenref.com/coordpolygonarea2.html
for more information.
m_shapes now has two possible indices. The first one is populated if
the point is associated with an arc and the second index is populated
if the point is shared between two arcs.
- Some are related to shape errors when the allowed error to approximate circle
by segment is large and arc radius small.
- fix the actual error used in ConvertToPolyline().
- Use SHAPE_ARC::DefaultAccuracyForPCB() instead of a fixed value as extra margin
in zones. It should not change something, because it is also a fixed value
(5 micrometers), but it is not a magic number.
-TransformArcToPolygon() fix some issues and add a new algo, based on the arc actual
outline shape (initial algo is still available in code, just in case).
Note also the transform is still not good: the same parameters are applied
to convert inner arc, outer arc and middle arc of a thick arc to segments.
But these parameters depend on arc radius (or circle radius) value.
The error between the "right" shape and the polygon is slightly smaller.
The approximations of the inner arc and the outer arc are better, but not perfect.
Also add (for test and debug purpose only) the code to show the polygon when
drawing a PCB_ARC (currently disabled)
Arcs with small radius can be approximated with very few segments.
However, if the thickness is large, relative to the radius, the approximation
must be based on the external radius, not the arc radius.
The difference can be significant.
This is especially noticeable for these graphic arcs in filled zones.
When running a python script is run from a console, outside Kicad, a wxWidgets
alert was always show (even in release mode)
This is due to calling wxStandardPaths::Get() with no wxApp open( i.e. wxTheApp == O)
The fix uses a dummy wxApp in this case.
Segment approximation for arcs leaves small "indents" where the rounded
edges of two segments don't quite meet.
This gives closer approximation by calculating the inner and outer joint
points based on the radius, eliminating the indents.
This was leaking windows headers and partial wx headers to 1084 compilation units......
This also means math/util.h is leaking to 1084 compilation units which seems a bit high too.
Use the connecting straight tracks even if not exactly parallel - allow
an error margin configurable in ADVANCED_CFG (default 1 degree). Also
be less strict about end point matching and use the width of the track
as the criteria to determine suitability.
Finally, delete any short lengths of track at the end of the operation
and amend the arc end points to keep connectivity.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7967
It appears as though there was an optimization to skip testing segments if
one of their endpoints (and only the A point) was inside. Unclear the reason
for this, but I'm going to assume that it was intended to optimize the case
where both points are inside (like the point case above it).
Before, it was possible for the canvas to steal the
focus if the cursor was only moved over it and not
clicked. Now, the canvas will only take the focus if
the frame is active.
Fixes https://gitlab.com/kicad/code/kicad/issues/7233
The first phase is for the environment before the OS
apps are created, and the second phase is for after
the OS app is created but before all of our processing.
Fixes https://gitlab.com/kicad/code/kicad/issues/7992
We were discarding shapes too aggressively for having a
larger area than a shape underneath.
Let's also try showing fewer disambiguation menus, in particular
always preferring items on the active layer when the candidates
include overlapping items of similar area on other layers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7949
wxWidgets seems to cause GTK to spam messages to the terminal,
and we have no control over that. So lets hide the messages
so no one complains about them. If people really want to see
them, they can add the KICAD_SHOW_GTK_MESSAGES build flag to CMake
and they can watch them scroll past.