Closed abetusk closed 5 years ago
Outline of work:
gbr2ngc ... --height-offset <heightfile> ... [--height-offset-algorithm (catmull-rom)]...
.tests/height-offset
directory (creating if necessary)At the very least, Catmull-Rom should be implemented. I'd also like to implement some inverse distance dropoff method as this method could be used for height sample points that aren't on a grid. It'd be really nice to have some real world data to see how good or bad each of the interpolation methods is and maybe come up with some new ones.
Whether gbr2ngc
accepts input GCode and can spit out height offsetting seems out of scope. There should be other tools that can or should handle this (maybe grecode?). If this is really wanted by folks, though, I'll add it.
Branch https://github.com/abetusk/gbr2ngc/tree/16-height-offseting is the current work in progress. Code could be in an intermediate state so don't run with expectation of it being functional.
0d5627add6bdd49610c2c7f1dbdc62a4006e1f86 resolves it.
Still need some documentation but the basics have been implemented enough to warrant a release.
Provide an option to 'height offset' the resulting GCode file using an input height map file.
The height map file should be of the format
The height file should be passed in on the command line as a
--height-file
option. There should be extra option that allow different options for the interpolation algorithm used of the form--height-interpolation <interpolation-algorithm>
.The units for the height file should default to whatever is being used in the Gerber file but can be specified with another option,
--height-file-units
.Initially the interpolation should be Catmull-Rom (though I'm not sure what to do in the case of the height file not being on a grid). I need to do some research to figure out which interpolations are appropriate for this method.
At least one test file should be included that outputs a correct set of interpolated heights (in GCode). It would be nice to have a test file that had variable height which was sub-sampled to get the height map to be fed in and compared against each interpolation algorithm to see how well it did.
This is not that much work and probably provides a large 'added value'.