Seth Hillbrand
28bd734313
Prevent invalid paths in fracture
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
4 years ago
Jeff Young
7a993c0211
Add support mode for dark mode to SCINTILLA_TRICKS.
Also removes the return value from the BITMAP_STORE's themeChanged
method as it will provide the wrong answer for the second frame it's
called on.
Also hooked up ACTION_TOOLBAR, the app launcher, and the project tree
to the wx event for system color changes so they change on the fly.
Fixes https://gitlab.com/kicad/code/kicad/issues/6026
4 years ago
Jeff Young
f64abcba36
Restore BBoxCache usage for zone fill performance.
4 years ago
Marek Roszko
3b7f5a3db7
Remove the native cursor for moving on Windows to avoid visual conflicts
Fix #8801
4 years ago
Roberto Fernandez Bautista
ed39b33d74
Fix edge case in CIRCLE::Intersect that caused a divide-by-zero crash
Also add some additional test cases.
4 years ago
Jon Evans
80355f04a9
Fix SHAPE_LINE_CHAIN::Replace at end of chain
4 years ago
Roberto Fernandez Bautista
d9cf939ba1
SHAPE_LINE_CHAIN::Replace Don't call front() or back() if empty
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8949
4 years ago
Roberto Fernandez Bautista
ab3564f12d
Fix formatting in prior commit
4 years ago
Roberto Fernandez Bautista
22df01183d
Fix edge cases in CIRCLE::Intersect that were causing KiROUND overflow
4 years ago
Roberto Fernandez Bautista
11fc74920c
Fix infinite loop in SHAPE_LINE_CHAIN::Slice
Was resulting in infinite loop due to wrong calculation
in NextShape.
4 years ago
Roberto Fernandez Bautista
ae87dc686a
Fix SHAPE_LINE_CHAIN::NearestPoint when aAllowInternalShapePoints=false
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8770
4 years ago
Roberto Fernandez Bautista
1edb96cc5b
Fix SHAPE_LINE_CHAIN::Slice(), splitting arcs when required
4 years ago
Roberto Fernandez Bautista
eaf8eb284a
Add true arc-to-polyline collisions
4 years ago
Roberto Fernandez Bautista
dd65ce9523
Simplify & move new arc collision code into Kimath library
Don't need to check intersections with the circle, just fix the
calculated "projected" point from the end points.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8234
4 years ago
Roberto Fernandez Bautista
b6be10f05c
Fix CIRCLE::Intersect( const SEG& aSeg ) and add unit tests
4 years ago
Roberto Fernandez Bautista
318435aedb
Add more test cases: simulate zone fill around arc + diff pair meander
4 years ago
jean-pierre charras
b6664eecf2
arc: fix incorrect arc center calculation for angle < 0 or > 180 deg
4 years ago
Jeff Young
c00f4ed5d2
Add regression tests for track cleaner.
4 years ago
david-beinder
3a833debea
ShapeToPolygon: implement negative inflation
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8859
4 years ago
Wayne Stambaugh
369d813a32
Pass std::string by reference instead of on the stack where applicable.
4 years ago
Wayne Stambaugh
78e5e98ea0
Pass VECTOR2I objects by reference instead of on the stack.
4 years ago
Wayne Stambaugh
8fd83cbb95
Pass wxPoint objects by reference instead of on the stack.
4 years ago
Jeff Young
4760480f40
Quiet compiler warnings.
4 years ago
david-beinder
937e4b1d8c
ShapeToPoly: Fix outline/arc intersection for large expansions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8820
Adds shortcut code path for 90deg corners
Segments are now actually symetrical
Refactored and commented the code
4 years ago
Wayne Stambaugh
bf80b9c04c
Last of the NULL expunging.
4 years ago
Wayne Stambaugh
4c457b5ed3
More NULL expunging.
4 years ago
jean-pierre charras
25e9d17722
Fix a boost compatibility with old boost versions.
(replace boost::optional::has_value() by its definition is_initialized())
4 years ago
david-beinder
8b3ccab0a3
Implement explicit polygon construction for most pad shapes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8650
4 years ago
jean-pierre charras
54b6f51633
DSN export: export RECT and ARC shapes (on silkscreen layer) from footprints
Also export arc track segments as lines. (Freerouter does not support QARCs)
Fixes #8769
https://gitlab.com/kicad/code/kicad/issues/8769
4 years ago
jean-pierre charras
ec64e8ad5b
TransformRingToPolygon(): fix incorrect approximation of the hole.
4 years ago
Roberto Fernandez Bautista
72435c78af
Fix out of bounds crash in SHAPE_LINE_CHAIN::splitArc
Check that the index references a point that is part of an arc
4 years ago
jean-pierre charras
515669284a
convert_basic_shapes_to_polygon: some enhancements:
- 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
4 years ago
Jon Evans
3103ff9aa3
Fix display of filled polygons with arcs in the outline
4 years ago
Jon Evans
ddc20dadc0
Formatting and spelling tweaks
4 years ago
Roberto Fernandez Bautista
cee5920d5c
Remove dead code (SHAPE_LINE_CHAIN::DetectArcs)
4 years ago
Roberto Fernandez Bautista
778c64de88
Implement ClearArcs() and check curved polys don't get a booleanOp
We cannot (yet) support passing several curved outlines through clipper.
In these cases, the caller should ClearArcs() before processing.
4 years ago
Roberto Fernandez Bautista
260a9d0540
Use ZFillFunction to modify arcs post clipper (does not fully work yet)
Added a unit test to verify union and intersection of polygons result
in desired results: subject + clip - intersect == union
4 years ago
Roberto Fernandez Bautista
437e2783fb
Use Clipper Z value to detect arcs post clipper
4 years ago
Roberto Fernandez Bautista
a9a8aa8243
SHAPE_LINE_CHAIN splitArc on Insert, Remove and Replace
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
5 years ago
Roberto Fernandez Bautista
3f73d8c2b5
SHAPE_LINE_CHAIN::Area() should always be positive
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.
5 years ago
Roberto Fernandez Bautista
c3051ba48a
Refactor SHAPE_LINE_CHAIN to allow two shapes per point
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.
5 years ago
Roberto Fernandez Bautista
c1361ae173
SHAPE_POLY_SET: Detect arcs after boolean operations
5 years ago
Roberto Fernandez Bautista
3ee8b4825c
Implement SHAPE_LINE_CHAIN::DetectArcs and add qa test
5 years ago
Roberto Fernandez Bautista
14c3d9055e
Add CIRCLE::Contains( VECTOR2I aP ) and add unit tests
5 years ago
Seth Hillbrand
a28d9f17e8
WIP
5 years ago
Seth Hillbrand
8521deb38d
De-scope ClipperLib namespace
5 years ago
Seth Hillbrand
6c224156f5
Adding conversion from points to arcs
Allows detection of arcs from segments in a SHAPE_LINE_CHAIN, converting
them to SHAPE_ARCs in the chain
5 years ago
Seth Hillbrand
5b2be906b8
Removing CLIPPER poly support
5 years ago
Seth Hillbrand
4f4deece6d
ADDED support for reading/writing arcs in polys
This adds support for reading and writing arc elements in polygons.
5 years ago
Marek Roszko
eff75b630f
Get rid of anonymous struct typedefs
We are using C++14 where there is no reason for this and is banned in C++20 under P1766R1. MSVC generates a warning under C++14 as a reminder.
4 years ago