Commit Graph

241 Commits

Author SHA1 Message Date
Marek Roszko 28c6967dbc Start trying to shuffle around path management 2021-01-27 19:12:18 -05: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 19620cebe7 qa tests: fix test_circle 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 a342bb9ab3 Standardize rounding in 64-bit rescale
32-bit rescale still uses truncation until we can determine how this
affects poly_grid_partition
2021-01-07 11:21:05 -08: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 6ca9a42251 Removes 3 other instances of a potential encoding problem
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2021-01-07 17:36:49 +00: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
Jon Evans 8901e71fc8 PNS: Fix loop removal, make walkaround less broken for arcs 2021-01-05 17:57:21 -05:00
Jon Evans aebb571dc9 Short-circuit arc generation if we are on a diagonal 2021-01-05 17:57:21 -05:00
Seth Hillbrand 5a97764319 Make segment contain its edge
This allows segment snapping along its diagonals to the grid.

Fixes https://gitlab.com/kicad/code/kicad/issues/6924
2021-01-03 12:47:33 -08:00
Jon Evans eaffacbc85 PNS: construct initial lines with arcs more precisely 2021-01-02 23:57:09 -05:00
Jon Evans af4c6393bb Fix arc collisions to account for width
This was causing arcs to be really hard to start routing from
2021-01-02 22:01:05 -05:00
Jon Evans 73248ab219 PNS: correct initial segment direction for posture solver 2020-12-31 13:05:43 -05:00
Jon Evans 111c644a82 Don't append zero-length arcs 2020-12-31 13:05:43 -05:00
Jon Evans fbdf31d35a Prevent creating arcs with slightly offset endpoints 2020-12-31 13:05:43 -05:00
Jon Evans 23c9eddf2d Cleanup 2020-12-30 18:29:41 -05:00
Jon Evans 79502a0d88 PNS: A new approach to arc placement
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6334
2020-12-30 18:23:24 -05:00
Jeff Young af2219ba7f Finish implementation of hole clearance checking.
It appears we never did via hole testing, and pad hole testing didn't
appear to get much testing.
2020-12-25 22:32:19 +00:00
Jon Evans ea351fde69 Recache polygon triangulation when mirroring
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6265
2020-12-20 10:45:24 -05:00
Marek Roszko 33dbc8ccd1 Add IsNetworkPath to kiplatform 2020-12-15 19:28:58 -05:00
Marek Roszko d67cf2f9af Replace wxFile usage with wxFFile
Buffered libc wxFFile is better thinking about syscall wxFile going wrong.
2020-12-12 13:16:23 -05:00
Jeff Young bc484784fc Make sure zones are triangulated for DRC.
Normally this happens as a side-effect of rendering them but if done
from a script (or test case) this won't happen.

Fixes https://gitlab.com/kicad/code/kicad/issues/6635
2020-12-12 15:27:46 +00:00
Jeff Young f08b7f098f Cleanup. 2020-12-12 15:27:46 +00:00
Jeff Young 807eef1208 Better error reporting to try and catch 6635. 2020-12-12 12:22:52 +00:00
Jeff Young 2c2630ef9e Formatting. 2020-12-12 03:43:41 +00:00
Ian McInerney be4b6ec06a Cleanup compiler warnings 2020-12-09 23:13:33 +00:00
Jeff Young 37178e3751 Formatting. 2020-11-29 14:02:46 +00:00
jean-pierre charras 68625494f3 specctra_export: fix an issue with custom and chamfered/round rect pads.
Is some cases a created pad stack name had the same name as an other pad stack
having a slightly different shape, thus creating pads with a incorrect shape on board.

Fixes #6495
https://gitlab.com/kicad/code/kicad/issues/6495
2020-11-25 13:57:46 +01:00
Jeff Young 9c7c05c161 Mostly formatting cleanup but a few type-casting cleanups too. 2020-11-24 22:16:41 +00:00
Marek Roszko 45598f2933 Add handling of DXF arbitrary axis/extrusions
This fixes some DXFs imports where unforunately CAD tools like SolidWorks
randomly decide to mirror circle definitions across the "z" axis (resulting in x or y axis flips in 2d)
Most likely live projection from 3D to 2D drawings introduces this.
However this is DXF specification to describe it so obtusely with vectors for a 2d drawing.
2020-11-23 21:24:38 -05:00
Werni 0e44f5128c Add const specifiers 2020-11-18 19:50:36 +00:00
Jeff Young a3a409b438 Fix crash bug when deleting files with spaces in names. 2020-11-14 14:15:02 +00:00
jean-pierre charras 7265f84358 fix PAD::TransformShapeWithClearanceToPolygon() incorrect calculation in some cases.
For round rect pads, when the arc error was OUTSIDE, the shape was too big and creates
bad shape for chamfered round rect pads.
For chamfered pads, when the clearance value was not 0, the chamfer was not at the
right place.
2020-11-14 08:50:58 +01:00
Jeff Young 63773809d0 Formatting. 2020-11-10 18:08:25 +00:00
Jeff Young 791a50b493 Remove work-around in favour of real fix in Clipper. 2020-11-04 11:21:45 +00:00
Jeff Young 55c25f3cc4 Work around a round-off bug in Clipper.
Fixes https://gitlab.com/kicad/code/kicad/issues/6260
2020-11-02 17:43:13 +00:00
Jeff Young 6bf29deb7f Improve formatting. 2020-10-31 17:25:08 +00:00
Werni a7d5d1f091 Add more consts all over the place 2020-10-27 11:03:35 +00:00
Jeff Young d1c73cb1d5 Clean up MODULE effective shape memory handling. 2020-10-25 23:38:21 +00:00
Jeff Young 31cc100669 Don't make clients deal with nested SHAPE_COMPOUNDs. 2020-10-25 18:17:58 +00:00
jean-pierre charras d6f91c810f Fix a few compil and Coverity warnings. 2020-10-25 10:02:07 +01:00
Jeff Young 59f3fefd17 When polygonizing arcs don't use synthesized center and angle.
Start, mid and end are the "real" properties and come with less
error.

Also collapses two arc polygonization routines into one.

Also fixes DRC checks to be cognizant of arc approximation error.

Fixes https://gitlab.com/kicad/code/kicad/issues/6039
2020-10-23 23:55:45 +01:00
Jeff Young 1cb7fbaab1 Fix errors in arc polygonization and test case.
1) Tests can't expect accuracies around 1 to work.  PCBNew defaults
to 5000.
2) Tests shouldn't artifically expand tolerance just to match the
results.
3) Tests should guarantee that end point is on arc, not just close
to it.
4) Standard polygonization of a circle is inside so splitting the
error needs to increase radius, not decrease.
5) Special-case first and last points so that they're exact.
2020-10-23 23:55:45 +01:00
Seth Hillbrand 19bf594aa0 Remove unused point in polygon test
There can be only one.
2020-10-23 12:13:09 -07:00
Jeff Young 58c006bc45 Register properties for ARC elements so we can get their netclass.
Also improves GAL arc drawing and polygonization.

Fixes https://gitlab.com/kicad/code/kicad/issues/6039
2020-10-23 14:27:36 +01:00
Tomasz Wlostowski 5b4f463c38 kimath: SHAPE_POLY_SET::Format() outputs C++-like code now, like other shapes 2020-10-23 01:18:01 +02:00
Tomasz Wlostowski a8074ed37d kimath: POLY_GRID_PARTITION now uses safer degeneracy (overlapping edges/'slits') handling mechanism. Also added some explanation of the algorithm used. 2020-10-23 01:17:54 +02:00
Wayne Stambaugh 8185a416b9 Fix broken build on Linux with gcc. 2020-10-22 08:36:28 -04:00
Jeff Young 9ff49277e1 Add implicit rule generation for keepout areas.
Also implements collision detection for SHAPE_POLY_SET.

Fixes https://gitlab.com/kicad/code/kicad/issues/6105
2020-10-22 10:41:21 +01:00
Jeff Young bfd04926b5 Performance improvement for polyset fracture. 2020-10-20 22:26:47 +01:00
Roberto Fernandez Bautista 006c462d8f ADDED: Fillet Tracks tool in pcbnew
Select two or more track segments and run the "Fillet Tracks" tool.
2020-10-20 21:23:05 +00:00
Ian McInerney 06f01d0d8a Add platform-specific code to allow wxChoice to ellipsize
Fixes https://gitlab.com/kicad/code/kicad/issues/5377
2020-10-17 23:20:13 +01:00
Jeff Young bbe7573d1c Performance enhancements to roundrect pads and clearance outlines.
Aka: avoid Clipper at all costs.

Fixes https://gitlab.com/kicad/code/kicad/issues/5900
2020-10-14 15:56:43 +01:00
Jeff Young 54dc91a623 Account for segment width in aActual calculation.
Fixes https://gitlab.com/kicad/code/kicad/issues/5990
2020-10-14 15:56:32 +01:00
Jeff Young 1703729269 Require explicit decl of maxError and errorLocations.
This should reduce both performance issues and clearance issues.
2020-10-13 13:49:07 +01:00
Marek Roszko 88102bca46 Kick the refresh timer for GAL on Win32 with a terrible hack 2020-10-11 21:44:46 -04:00
Jon Evans 14c2937fc3 Implement IsDarkTheme for GTK 2020-10-10 14:55:32 -04:00
Jon Evans cc563d254f Add MSW implementation for IsDarkTheme (for future)
As noted, we can't enable this yet as wxWidgets does
not automatically apply a dark theme to the system
colors.
2020-10-10 14:15:30 -04:00
Ian McInerney 48a5907412 Remove extraneous debug statements 2020-10-08 17:56:54 +01:00
Tomasz Wlostowski db9e111838 kimath: SHAPE_POLY_SET should re-parent triangulated polygons when copied/cloned 2020-10-08 15:22:17 +02:00
Jeff Young 2f49db49bf Fix fly-off arc handles and move Arc Properties to start/end/angle.
Fixes https://gitlab.com/kicad/code/kicad/issues/5791
2020-10-08 11:33:32 +01:00
Mark Roszko d9485129c8 Implement more context specific cursors using both stock and custom cursors. 2020-10-08 00:50:28 +00:00
Ian McInerney 16374e9ae1 Ensure string is chosen correctly 2020-10-07 23:23:43 +01:00
Tomasz Wlostowski 8fb154e04e geometry: SHAPE_RECT: use SquaredDistance() for collision detection 2020-10-07 16:36:37 +02:00
Tomasz Wlostowski d6fa81036b geometry: SEG::NearestPoint(SEG) now returns points only on (this) segment 2020-10-07 16:36:37 +02:00
Tomasz Wlostowski 1ef120ff4f geometry: SHAPE::Format() now outputs C-like code for easy test cases... 2020-10-07 16:36:37 +02:00
Tomasz Wlostowski 7ffef32ea0 geometry: placeholder method for converting compounds to simple polygons [wip] 2020-10-07 16:36:37 +02:00
Tomasz Wlostowski bd27d38d9a DRAW_PANEL_GAL: added DebugOverlay() method, creating a temporary overlay for drawing debug graphics 2020-10-07 16:36:37 +02:00
Jeff Young 18a3c4c1db Fix some fairly catastrophic bugs in shape collision optimization.
I did a little too much copy & paste last time around....
2020-10-05 22:32:07 +01:00
Mark Roszko a28a0e14ba Fix conversion warnings 2020-10-05 10:41:14 +00:00
Jeff Young 8dd7777108 Handle closed shape-line-chain with circle collisions. 2020-10-04 19:40:18 +01:00
Jeff Young f9cfd31351 0 is always a collision (whether clearance is 0 or not). 2020-10-04 13:21:01 +01:00
Jeff Young f4f578b755 Add closed-shape handling to SHAPE_LINE_CHAIN collision routines. 2020-10-04 13:21:01 +01:00
Jeff Young bf67648562 Support optional location reporting in SHAPE collisions.
Also fixes a few bugs in the collision routines.
2020-09-28 23:28:33 +01:00
Tomasz Wlostowski 482767a850 libs/kimath: implement indexable subshape support for SHAPE_COMPOUND and SHAPE_POLY_SET 2020-09-27 16:45:46 +02:00
Ian McInerney c5feccca53 Add stub functions in KIPLATFORM to detect dark mode
These haven't been written yet, but current code can
be adapted to use these now.
2020-09-20 01:43:27 +01:00
Jeff Young d402d93487 Implement shape routines for DIMENSION_Ts.
This allows them to participate in DRC and PNS.

Fixes https://gitlab.com/kicad/code/kicad/issues/5712
2020-09-19 14:16:00 +01:00
Jeff Young 0f3d2147aa Performance enhancements for DRC. 2020-09-17 20:13:39 +01:00
Seth Hillbrand 08bf5f4b4e ADDED: 45° snapping for rectangles aka Squares
The snap obeys only the Ctrl key and not the global preference setting
for drawsegments because rectangles are _always_ on H/V lines when drawn

Fixes https://gitlab.com/kicad/code/kicad/issues/5607
2020-09-15 11:22:26 -07:00
jean-pierre charras 9f85730987 Make SHAPE_POLY_SET::CacheTriangulation() behavior same as previously.
Previously, SHAPE_POLY_SET::CacheTriangulation() was able to handle polygons
with holes.
Due to recent changes, CacheTriangulation( true ) handle polygons with holes,
but CacheTriangulation( false ) did not handle polygons with holes, due to a
missing call to Fracture(), lost in latest changes.
This is now fixed.

Fixes #5606
https://gitlab.com/kicad/code/kicad/issues/5606
2020-09-13 17:55:59 +02:00
Seth Hillbrand 35d993988d Comment update 2020-09-11 09:48:39 -07:00