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
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
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
We are not always sure of the path validity in fracture. Nominally, the
Clipper Simplify routine should remove invalid parts but in the case
where it doesn't, we need to recover gracefully, even if the output
polygon is not valid.
Fixes https://gitlab.com/kicad/code/kicad/issues/9199
- 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.
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).
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