kicad/common/plotters
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
..
DXF_plotter.cpp Clean up arc/circle polygonization. 2020-09-11 11:23:49 +01:00
GERBER_plotter.cpp Use a local tmp file for plotting 2020-08-20 16:23:51 +00:00
HPGL_plotter.cpp Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
PDF_plotter.cpp Use a local tmp file for plotting 2020-08-20 16:23:51 +00:00
PS_plotter.cpp PDF plotter: better handling of non ASCII7 (unicode 16) chars. 2020-07-26 17:59:02 +02:00
SVG_plotter.cpp Mirror hidden text in SVG plotter 2020-07-30 06:17:37 -07:00
common_plot_functions.cpp Change super/subscript syntax to ^{foo} and _{foo}. 2020-04-18 21:04:41 +01:00
plotter.cpp Eeschema: allow editing of junction properties diameter and color. 2020-06-24 13:36:17 -04:00