openscad/openscad — pull request #816 by donbright (2014-05-31 11:46:01+00:00)
Title: Test3dexport

Test 3d file format export, by exporting 3d format, creating temporary '.scad' file that import()s the generated 3d file, then re-exporting to PNG, and comparing against the cgalpngtest expected file. The set of tests is somewhat small to begin with, but can be grown by editing CMakeLists.txt

The new tests are named for the 3dformat then 'png'. The first two are

stlpngtests
offpngtests

Of course, to test export, an import() functionality for the format has to have been implemented

Major refactoring of entire color subsystem, with 'color schemes' inside colormap.cc / colormap.h and centralization of colorization when calling renderers.

New cmdnline option --colorscheme

New colorscheme for black-background previewing (Starnight)

New colorscheme to make 'backface' same color as 'front face' (Monochrome)

Export test is a new .py file based on @t-paul 's design of csgtest.

Known Bugs:

Not 100% backwards compatible. For example, Throwntogether doesnt have the magenta on backwards faces... some work needs to be done to fix that.

Starnight scheme hides the 'x y z' letters on the axes.

------------
Major issue

the threshold of 10% in the ImageMagick Compare test is causing all the tests to pass, even though we are comparing an image with Green backfaces to an image with Gold backfaces, even without feeding --monochrome to the openscad binary. So either the Imagemagick is 'too loose', or the colorscheme refactoring was totally unnecessary. I'm a bit confused how this happened.