Jon Evans
bf0592ad53
Lift some point-vs-shape APIs into SHAPE base class
...
Also provide a virtual method for conversion to polygon
2023-08-17 08:02:14 -04:00
Tomasz Wlostowski
4d208bac49
geometry: added SHAPE_SEGMENT::Is45Degree() method
2023-01-12 23:37:07 +01:00
Tomasz Wlostowski
cd29dcf6e0
libs/kimath: SHAPE::Format() can now produce C++ object construction and simple test dump of shapes
2022-10-31 11:17:31 +01:00
Jeff Young
4eac8d7c66
Remove unit-less angles from geometry lib APIs.
2022-01-20 21:10:04 +00:00
Jon Evans
0570c22732
Use point collision test for zero-length segments
...
SEG::SquaredDistance( SEG& ) does not do the right thing
for segments with zero length at the moment.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9791
2021-11-27 09:08:34 -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
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
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
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
Simon Richter
c407e96b14
std::min/std::max requires <algorithm>
2020-07-11 15:46:57 +02:00
Jeff Young
d85a707385
Move rest of DRC to SHAPE collision architecture.
2020-07-06 20:00:50 +01:00
Jeff Young
eb1ff80d57
SHAPE collision fixes.
...
1) An actual distance of 0 is still a collision, even if the allowed
distance is 0.
2) Be consitent about edges and interiors. Everyone expect the edge
of a RECT to be part of the RECT; same with a CIRCLE. SHAPE_POLY_SET
shouldn't be any different. (And SHAPE_LINE_CHAIN was a split-
personality with the edge considered part of it for Collide() but not
for PointInside()).
2020-07-02 21:38:37 +01:00
Jeff Young
441dfa30f0
Return individual custom pad shapes instead of a SHAPE_POLY_SET.
...
Also implements an optional pointer to return the actual distance
from all the SHAPE collision routines.
Fixes https://gitlab.com/kicad/code/kicad/issues/4774
2020-07-02 17:09:15 +01:00
Ian McInerney
13b6028e1b
Refactor all math into a new kimath library
...
* Split up the thirdparty code into the thirdparty folder (#3637 )
* Create a new kimath static library containing all the math functions
This is part of cleaning the build system for #1906 .
2020-01-07 17:12:59 +00:00