Commit Graph

136 Commits

Author SHA1 Message Date
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.
2021-07-01 18:28:41 -04:00
Wayne Stambaugh 507a88524a KiCad internal library header file housekeeping. 2021-07-01 13:46:38 -04:00
jean-pierre charras 17737af130 Fix some issues related to SHAPE_ARC:
- 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).
2021-06-30 13:33:49 +02:00
jean-pierre charras bcb5618315 Fix incorrect calculation in TransformCircleToPolygon(), only noticeable
when the allowed aError is (unusually) large.
2021-06-28 18:51:37 +02:00
jean-pierre charras 310adedf85 Add GetCircleToSegmentError() to geometry/geometry_utils.
This function returns the error created by a circle to segment approximation.
2021-06-26 18:57:07 +02:00
jean-pierre charras 3c81403424 Refinements in Arc to Polygon transform: slightly better shapes of arc ends.
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.
2021-06-26 14:20:55 +02:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Jeff Young 976e756b02 Formatting. 2021-06-03 18:33:59 +01:00
Seth Hillbrand 059f79dfdb Re-remove KiROUND from header
Moves routines requiring KiROUND (and util.h by extension) to the cpp
file
2021-06-03 08:44:17 -07:00
Marek Roszko 29783f125b Eliminate one wxRect constructor in BOX2
The only usage auto converted to BOX2D anyway...
2021-06-03 01:27:15 -04:00
Seth Hillbrand cf1c75ecd4 Handle rounding errors in seg length calculation
SQRT needs to be passed through KiROUND before returning otherwise,
truncation errrors will accumulate between routing and DRC

Fixes https://gitlab.com/kicad/code/kicad/issues/8541
2021-06-02 16:42:35 -07:00
Marek Roszko c294d28275 Split POLY_GRID_PARTITION to a cpp file
Not entirely a lightweight class
2021-06-02 18:31:30 -04:00
Marek Roszko 13abb9f947 Shift some seg functions to the cpp file 2021-06-02 18:31:30 -04:00
Marek Roszko 0b4a680dbb Hotglue wxLogDebug into math/util.h without the global include 2021-06-02 00:26:16 -04:00
Marek Roszko cf2bb5692a Remove the wxLog calls from math/util.h for now
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.
2021-06-01 18:44:22 -04:00
Jeff Young 46d746c9da Performance optimizations. 2021-06-01 23:11:54 +01:00
Tomasz Wlostowski 2d8264124d geometry: SHAPE_LINE_CHAIN::PathLength() now can accept the maximum index of the segment to calculate the length to 2021-05-29 00:13:24 +02:00
Tomasz Wlostowski 7553b7b092 geometry: add minimum distance threshold parameter to SHAPE_LINE_CHAIN::Find()/FindSegment() 2021-05-29 00:13:24 +02:00
Tomasz Wlostowski e7fe8c4ddb geometry: rework SHAPE_LINE_CHAIN::Intersect() to explicitly indicate touching vertices and remove references to SEGs from INTERSECTION structure 2021-05-29 00:13:24 +02:00
Jon Evans f30ebbde33 Fix accuracy of tuning path calculation when measuring arcs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8401
2021-05-10 21:22:51 -04:00
Thomas Pointhuber a30894e5a1 Allow SHAPE_LINE_CHAIN and SHAPE_ARC to be mirrored using a SEG 2021-04-11 13:27:25 +00:00
Roberto Fernandez Bautista 235688e459 Less restrictive Arc Track Dragging tool
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
2021-04-06 12:52:01 +00:00
Marcus A. Romer 1632707d9b Replace tabs with spaces 2021-04-05 01:13:39 +00:00
Jeff Young b6f2941a06 Another try a allowing touching courtyards.
Fixes https://gitlab.com/kicad/code/kicad/issues/8076
2021-03-31 22:54:30 +01:00
Dominik Wernberger e2aa7be4b3 Added a lot of consts and refactored a few lines 2021-03-08 12:49:48 -08:00
Mikolaj Wielgus 0f22b54cd8 Clip the leader lines properly when using circular text frame
Fixes https://gitlab.com/kicad/code/kicad/issues/7810
2021-03-07 21:19:19 +00:00
Jeff Young e89f9db438 Footprint disallow layer checking needs to be based on courtyards.
Fixes https://gitlab.com/kicad/code/kicad/issues/7620
2021-02-20 14:13:36 +00:00
Roberto Fernandez Bautista 2d66abdc89 CADSTAR PCB Archive Importer: More improvements to loading of zones
Adds a new function Area() to SHAPE_POLY_SET
2021-02-10 18:49:21 +00:00
Wayne Stambaugh 6ab1144ea3 Fix broken Doxygen comment specifiers.
Please note, ///> is not a valid Doxygen comment specifier.  ///< is the
correct specifier to use for single line or short Doxygen comments.
2021-01-25 07:42:36 -05:00
Roberto Fernandez Bautista 99d203feae Clarify CIRCLE::ConstructFromTanTanPt
Remove unused bool aAlternateSolution and add doxygen comments
2021-01-24 16:41:11 +00:00
Roberto Fernandez Bautista 48823c0723 Formatting fixes and fix qa_kimath following rebase 2021-01-24 16:41:10 +00:00
Roberto Fernandez Bautista 6ed5ed52b8 qa tests for CIRCLE geometry library 2021-01-24 16:41:10 +00:00
Roberto Fernandez Bautista b6a50d2f74 qa tests for SEG perpendicularity and parallelism 2021-01-24 16:41:10 +00:00
Roberto Fernandez Bautista 6e7ae93cc8 EDIT_TOOL::DragArcTrack Fix incorrect undo history when items are deleted
Need to make sure we only apply one COMMIT operation per object before calling COMMIT::Push() or COMMIT::Revert()
2021-01-24 16:41:10 +00:00
Roberto Fernandez Bautista 2b5c1bae97 CHANGED: Dragging a curved track starts an interactive resizing of it, keeping start an end points tangent 2021-01-24 16:41:10 +00:00
Seth Hillbrand b8dfcb34c4 Revert "Use less-sophisticated arc editing math."
This reverts commit 3b424d3868.  And fixes
issue with rouding causing arc errors
2021-01-18 12:44:27 -08:00
Mikolaj Wielgus 00a9910149 Fix misplaced parenthesis in VECTOR2<T>::Resize()
Fixes https://gitlab.com/kicad/code/kicad/issues/7045
2021-01-16 09:41:14 +00:00
Dominik Wernberger dc02ec9758 Remove a few const_cast 2021-01-12 20:51:31 +00:00
Dominik Wernberger ac94d72d2d Add more const specifiers 2021-01-12 20:51:31 +00:00
Tomasz Wlostowski 7994c59169 libs/kimath: POLY_GRID_PARTITION must use truncating (round-to-zero) rescale function for correct grid generation. 2021-01-10 00:04:57 +01:00
Seth Hillbrand b2cfd7f479 Fix rounding issues
Rescaling and rotating has been leaving 1nm errors due to integer
truncation in VECTOR2I.  This rounds integers using KiROUND before
returning
2021-01-09 13:05:58 -08:00
Jon Evans 31dd04fa96 Fix ToVector to return world coordinates
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7002
2021-01-08 13:52:39 -05:00
Jon Evans c3eb8dccda Fix typo in DIRECTION_45 ctor 2021-01-07 19:13:05 -05:00
Seth Hillbrand 77acf85310 Revert "Standardize rescale"
poly_grid_partition appears to depend on integer calculation for large
scaling

This reverts commit eef16fe717.
2021-01-07 10:36:06 -08:00
hoijui e34b829242 Prevent an encoding error when generating python API DoxyGen
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2021-01-07 17:36:49 +00:00
Jon Evans 0234b7278a PNS: Make DIRECTION_45 North be up everywhere
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6935
2021-01-06 21:47:06 -05:00
Seth Hillbrand eef16fe717 Standardize rescale
Rescale was returning differing results based on 32-bit vs 64-bit
implementations.  Speed difference here appears to be positive.
2021-01-06 17:52:14 -08:00
Jeff Young 2a088e5c7b Add conversion of circles to zones and enable in footprint editor.
Also rule areas, of course.

Fixes https://gitlab.com/kicad/code/kicad/issues/6966
2021-01-06 17:21:49 +00:00
Jon Evans 7431d5c985 PNS: First pass at updating meander placers for arcs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6464
2021-01-05 17:57:21 -05:00
Jon Evans 8619086cf2 PNS: re-enable optimization of colinear segs in lines with arcs 2021-01-05 17:57:21 -05:00