kicad/3d-viewer/3d_rendering
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
..
3d_render_ogl_legacy Clean up arc/circle polygonization. 2020-09-11 11:23:49 +01:00
3d_render_raytracing Change partitions to fixed size 2020-09-10 09:31:20 -07:00
buffers_debug.cpp Fix unnecessary value parameter detected by clang-tidy. - Replace value parameter by const reference parameter or move-assignement in some cases 2018-01-09 18:55:51 -05:00
buffers_debug.h Fix unnecessary value parameter detected by clang-tidy. - Replace value parameter by const reference parameter or move-assignement in some cases 2018-01-09 18:55:51 -05:00
c3d_render_base.cpp Rationalise 3D settings data-structure. 2020-03-28 16:09:40 +00:00
c3d_render_base.h Give the 3D viewer an infobar & Infobar upgrades 2020-06-04 00:13:27 +01:00
ccamera.cpp Actionize the rest of the 3D viewer. 2020-03-19 15:10:32 +00:00
ccamera.h Actionize the rest of the 3D viewer. 2020-03-19 15:10:32 +00:00
ccolorrgb.cpp 3D Viewer: complete refactor of the 3D viewer. 2016-07-19 13:35:25 -04:00
ccolorrgb.h 3D Viewer: complete refactor of the 3D viewer. 2016-07-19 13:35:25 -04:00
cimage.cpp Add missing includes 2020-05-10 00:24:11 +02:00
cimage.h Comment-only changes 2020-01-10 16:43:01 -08:00
cpostshader.cpp 3D-Viewer: improve SSAO 2020-07-16 11:23:02 +00:00
cpostshader.h 3D-Viewer: improve SSAO 2020-07-16 11:23:02 +00:00
cpostshader_ssao.cpp Fix missing variable initialization 2020-07-18 23:56:39 +01:00
cpostshader_ssao.h 3D-Viewer: improve SSAO 2020-07-16 11:23:02 +00:00
ctrack_ball.cpp Scope 3d viewer enums 2019-12-30 13:01:06 +00:00
ctrack_ball.h Add virtual constructors to some classes that should have them 2020-02-05 22:19:14 +00:00
test_cases.cpp 3D Viewer: complete refactor of the 3D viewer. 2016-07-19 13:35:25 -04:00
test_cases.h 3D Viewer: complete refactor of the 3D viewer. 2016-07-19 13:35:25 -04:00
trackball.cpp Remove deprecated 'register' storage spec 2016-09-30 22:32:24 -04:00
trackball.h 3D Viewer: complete refactor of the 3D viewer. 2016-07-19 13:35:25 -04:00