kicad/3d-viewer
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_cache Delete 3D cache files with GUI settable number of days 2020-08-09 10:41:45 +00:00
3d_canvas Clean up arc/circle polygonization. 2020-09-11 11:23:49 +01:00
3d_model_viewer 3D-Viewer: implements opacity property for 3D models 2020-05-08 21:28:16 +00:00
3d_rendering Clean up arc/circle polygonization. 2020-09-11 11:23:49 +01:00
3d_viewer 3D-Viewer: Parameterize sampling options 2020-09-04 15:12:01 +00:00
common_ogl Remove all debugging output that cannot be disabled. 2020-08-18 10:17:36 -04:00
3d_enums.h Migrate more 3d viewer actions to the tool framework 2020-08-16 19:10:25 +00:00
3d_fastmath.cpp 3D Viewer: complete refactor of the 3D viewer. 2016-07-19 13:35:25 -04:00
3d_fastmath.h Cleanup: Replace C-only deprecated headers 2019-12-05 11:03:15 -08:00
3d_math.cpp Removed all exception specifiers since deprecated. 2017-06-12 13:54:55 -04:00
3d_math.h (forget to staged modified files) 2016-10-09 11:33:53 -04:00
3d_plugin_dir.h.in Use absolute path CMAKE_INSTALL_FULL_LIBDIR for 3d viewer PLUGINDIR 2018-12-11 14:28:01 -05:00
3d_viewer_id.h Migrate more 3d viewer actions to the tool framework 2020-08-16 19:10:25 +00:00
CMakeLists.txt Implement a framework to handle wxUpdateUIEvents for tool actions 2020-08-16 19:10:25 +00:00
credits.txt 3D Viewer: complete refactor of the 3D viewer. 2016-07-19 13:35:25 -04:00