Commit Graph

63 Commits

Author SHA1 Message Date
Jeff Young 0fb864d596 Pull some name changes back from 7.0 to ease merging. 2021-07-21 20:58:59 +01:00
Marek Roszko 10e60acf34 Clean up including of board_design_settings.h 2021-06-06 15:03:42 -04:00
Marek Roszko 21fde9b629 enum class PCB_SHAPE_TYPE_T 2021-04-30 22:36:12 -04:00
Jon Evans 94fad2944d ConvertOutlineToPolygon: Don't crash if we didn't find a segment owner
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8184
2021-04-12 19:59:55 -04:00
Jeff Young 4679682fe9 Don't treat success == true as "we got an outline".
It just means the outline wasn't malformed.  It might still be
empty.

[Edit: my fix collided with JP's, so all this really is now is a
couple of slight performance improvements.]
2021-02-10 12:38:06 +00:00
jean-pierre charras 5079881f3f BuildFootprintPolygonOutlines(): fix incorrect outlines when no pad in the footprint.
It is used in 3D viewer to build a "board" polygonal outlines.
The polygon was empty when no pad and no item on ede cuts found (i.e. logos)
Fixes #7448
https://gitlab.com/kicad/code/kicad/issues/7448
2021-02-10 08:45:17 +01:00
jean-pierre charras 1b755bbc37 Fix issues in ConvertOutlineToPolygon() related to S_POLYGON PCV_SHAPE
Fixes #7046
https://gitlab.com/kicad/code/kicad/issues/7046
2021-01-11 17:05:44 +01:00
Jeff Young e1f76ea2ab Gracefully handle dots in the outline path.
Fixes https://gitlab.com/kicad/code/kicad/issues/6854
2020-12-27 01:01:25 +00:00
Jeff Young 3aca0e1853 Make sure we nofity of self-intersecting outlines. 2020-12-27 01:01:25 +00:00
Jeff Young ab97035ecb Handle closed shapes being processed after other shapes.
Fixes https://gitlab.com/kicad/code/kicad/issues/6845
2020-12-26 12:57:49 +00:00
Jeff Young 04c8d0e9d8 Comments. 2020-12-25 16:59:41 +00:00
Jeff Young 84ce814037 Repair segment ownership logic for rects and curves.
Fixes https://gitlab.com/kicad/code/kicad/issues/6847
2020-12-25 13:21:20 +00:00
Jeff Young ef25c78a04 Separate polygonization error from chaining error.
This way we can report anything that doesn't exactly chain while still
applying  a fudge factor for our own stuff.

Fixes https://gitlab.com/kicad/code/kicad/issues/1795
2020-12-24 21:02:14 +00:00
Jeff Young 9c7c05c161 Mostly formatting cleanup but a few type-casting cleanups too. 2020-11-24 22:16:41 +00:00
Jeff Young 1391774f64 Re-factor boundary/courtyard checker error handling.
ADDED Footprint Checker dialog to display the results in.

Fixes https://gitlab.com/kicad/code/kicad/issues/6446
2020-11-21 20:57:35 +00:00
Jeff Young b123318cf6 Encourage use of full DRC for board & footprint malformed outlines.
It shows much more detail.  Removes some nag dialogs and places
hypertext links in others.

Also fixes the auto-layer-showing to correctly show Edge.Cuts or
F.CrtYd or B.CrtYd for errors relating to them.

Fixes https://gitlab.com/kicad/code/kicad/issues/6446
2020-11-20 17:24:52 +00:00
Jeff Young bdbb68f813 MODULE -> FOOTPRINT. 2020-11-13 16:04:03 +00:00
Jeff Young 522d64968e Yet more module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young f5443de7f9 D_PAD -> PAD. 2020-11-13 15:16:24 +00:00
Jeff Young 84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Jeff Young 4dc877d0e9 Module -> Footprint. 2020-11-08 21:43:19 +00:00
Jeff Young 7c60c2e404 Module -> footprint. 2020-11-07 18:50:30 +00:00
jean-pierre charras 442f40fa66 ConvertOutlineToPolygon() fix another issue for arcs found inside a outline 2020-10-24 10:04:15 +02:00
jean-pierre charras 51be98428d fix a few issues in ConvertOutlineToPolygon().
Fixes #6130
https://gitlab.com/kicad/code/kicad/issues/6130
Fixes #6129
https://gitlab.com/kicad/code/kicad/issues/6129
2020-10-23 11:23:45 +02:00
jean-pierre charras 15369915cc Minor code cleanup: move "extern" declarations to convert_drawsegment_list_to_polygon.h 2020-10-23 08:48:52 +02:00
Jeff Young cce557b9ad Redo the board-edge-building logic to return better error reports.
Fixes https://gitlab.com/kicad/code/kicad/issues/6119
2020-10-22 21:29:04 +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
Jeff Young 37906511f5 Class renaming.
DRAWSEGMENT  -> PCB_SHAPE
EDGE_MODULE  -> FP_SHAPE
TEXTE_PCB    -> PCB_TEXT
TEXTE_MODULE -> FP_TEXT
2020-10-05 11:55:33 +01:00
Jeff Young 7a4900b8dc PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T
Also updated footprint text and zone types for consistencey.
2020-10-04 16:49:04 +01:00
Mikolaj Wielgus 400c15b8eb Add mils to units, remove useMils variables 2020-10-03 20:06:56 +00:00
Ian McInerney a5ed5e5675 Handle single line segments on footprint edgecuts
Also, only display an infobar message for footprints when
there is no footprint loaded (instead of if the outline
isn't closed).

Fixes https://gitlab.com/kicad/code/kicad/issues/4866
2020-09-30 23:34:04 +01:00
Ian McInerney 37eed564ab Process all drawsegments on the outline layer 2020-09-30 23:34:04 +01:00
Ian McInerney 0ac2803624 Create footprint edgecuts differently than the board edge cuts 2020-09-30 23:34:04 +01:00
Jeff Young e2bc7557cc Clean up arc/circle polygonization.
1) For a while now we've been using a calculated seg count from a given
maxError, and a correction factor to push the radius out so that all
the error is outside the arc/circle.  However, the second calculation
(which pre-dates the first) is pretty much just the inverse of the first
(and yields nothing more than maxError back). This is particularly
sub-optimal given the cost of trig functions.

2) There are a lot of old optimizations to reduce segcounts in certain
situations, someting that our error-based calculation compensates for
 anyway.  (Smaller radii need fewer segments to meet the maxError
condition.) But perhaps more importantly we now surface maxError in the
UI and we don't really want to call it "Max deviation except when it's
not".

3) We were also clamping the segCount twice: once in the calculation
routine and once in most of it's callers.  Furthermore, the caller
clamping was inconsistent (both in being done and in the clamping
value). We now clamp only in the calculation routine.

4) There's no reason to use the correction factors in the 3Dviewer;
it's just a visualization and whether the polygonization error is
inside or outside the shape isn't really material.

5) The arc-correction-disabling stuff (used for solder mask layer) was
somewhat fragile in that it depended on the caller to turn it back on
afterwards.  It's now only exposed as a RAII object which  automatically
cleans up when it goes out of scope.

6) There were also bugs in a couple of the polygonization routines where
we'd accumulate round-off error in adding up the segments and end up with
an overly long last segment (which of course would voilate the error
max). This was the cause of the linked bug and also some issues with vias
that we had fudged in the past with extra clearance.

Fixes https://gitlab.com/kicad/code/kicad/issues/5567
2020-09-11 11:23:49 +01:00
qu1ck 636285311e Make DRAWSEGMENT::GetRectCorners return vector
... instead of modifying the argument.
This will make the method usable in python API and will not incur
permormance penalty because named return value optimization (NRVO)
is a thing since C++11.
But even if copy is not elided vector is moved instead of copied.
https://en.cppreference.com/w/cpp/language/copy_elision
2020-09-07 05:33:10 +00:00
Seth Hillbrand cd51785173 Fix crash with missing board outline 2020-08-21 05:55:22 -07:00
Jeff Young 66ff16dd3d Better board-edge error reporting.
Fixes https://gitlab.com/kicad/code/kicad/issues/4950
2020-08-17 23:55:31 +01:00
Jeff Young 6c74658a98 Finish arc implementation of m_ThirdPoint for EDGE_MODULEs.
Fixes https://gitlab.com/kicad/code/kicad/issues/5191
2020-08-15 17:32:13 +01:00
Jeff Young aeed8e6e2c Finish implementation of DRAWSEGMENT::C_RECT.
It's currently only supported in the Footprint Editor.  It could be
easily added to the board editor (all the code is there), but the board
editor is a little short on room in the drawing tools toolbar.
2020-06-15 20:51:31 +01:00
Jeff Young d046f165de Fix board outline issues.
1) Don't try and do board-edge clearance checking against a
synthetic polygon constructed because we didn't find any edges.

2) Check pads against board edge.

3) Don't report vias as "Track too close to board edge".
2020-05-18 21:11:01 +01:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Seth Hillbrand ac435ecd68 Moving further arc approximations down
This corrects an issue with fill segments-per-circle and moves the error
to segmetns calculation down in a number of functions to expose the
single value for approximation
2019-05-22 14:35:17 -07:00
jean-pierre charras abc605fcfa fix a compil warning.
Fix a few comments.
2019-04-02 09:05:42 +02:00
Seth Hillbrand 5eb2a33498 pcbnew: Ensure DRC circles have at least 4 points
This prevents invalid outline errors for small circles.

Fixes: lp:1822641
* https://bugs.launchpad.net/kicad/+bug/1822641
2019-04-01 11:47:58 -07:00
Seth Hillbrand 40309a17ef pcbnew: Check exact overlapping polygons
Checks for polygon collisions in the outline when the polygon contains
two or more segments that exactly overlap.  This also places the DRC
marker at the location where the collision happens.

Fixes: lp:1818163
* https://bugs.launchpad.net/kicad/+bug/1818163

Fixes: lp:1818218
* https://bugs.launchpad.net/kicad/+bug/1818218
2019-03-01 09:38:33 -08:00
Seth Hillbrand 2e0887d49f pcbnew: correctly display edgecut polygons in modules
Commit 1858b7dca corrected the handling of polygons on the edge cut
layer for board items.  This adjusts for the possibility of polygons
in modules on the edge cut layer by applying the module offset/rotation
to the polygon elements.
2018-12-04 15:08:04 -08:00
Seth Hillbrand 1858b7dca7 pcbnew: Allow closed polygons as board edges
Like circles, polygons are self-closed elements that define an outline.
This allows them to be used as such for board outlines and cutouts.

Fixes: lp:1795563
* https://bugs.launchpad.net/kicad/+bug/1795563
2018-12-04 12:32:47 -08:00
Seth Hillbrand 26765161c1 drc: Add board outline and edge crossing
This adds a check for contiguous board outlines to the DRC.  It also
uses the calculated outline to ensure that traces are not crossing the
outlines.

Fixes: lp:1648055
* https://bugs.launchpad.net/kicad/+bug/1648055
2018-12-02 07:54:52 -08:00
jean-pierre charras 0d3637c2ee Fix a few minor I18n issues.
Avoid translation of debug messages.
2018-11-11 10:46:26 +01:00
Jeff Young d9bf1550e4 Improve slightly confusing error message. 2018-10-11 18:53:00 +01:00