As I’ve been writing up designs, it has occurred to me that there will be times when I want to engrave to specific depths (for things like inlays or creating slots in dowels). I know that GF will use grayscale to determine how deep to create the engraving. Ex: if I cut some nice shapes out of hardwood veneer that is 1/42 inch deep, I’ll want to engrave the same shapes into the base material so that when I glue in the veneer, it will be flush with the top of the base layer.

So, I wrote up a little javascript app to give me the RGB values of the shade of gray that I’d need. You can play with it here: http://ferociousmellow.com/?pg=grayscale.

Here’s the gist of the logic - are my assumptions correct? Would getting the percentage (desired depth divided by max depth) be the way to calculate the right shade of gray?

var blackAlphaAsDecimal = 255;

var percentage = desired/max;

// NOPE, fixed line below - var resultAsDecimal = Math.round(blackAlphaAsDecimal * percentage);

var resultAsDecimal = 255 - Math.round(blackAlphaAsDecimal * percentage);

var resultAsHexidecimal = (resultAsDecimal.toString(16)).toUpperCase();

if (resultAsHexidecimal.length == 1)

{

resultAsHexidecimal = “0” + resultAsHexidecimal;

}

result_RGB_Dec = “(” + resultAsDecimal + “,” + resultAsDecimal + “,” + resultAsDecimal + “)”;

result_RGB_Hex = resultAsHexidecimal + “” + resultAsHexidecimal + “” + resultAsHexidecimal;

result_RGBA_Hex = result_RGB_Hex + “FF”;

Another assumption I make (when entering in what I think is the maximum engrave depth) is that Black (255,255,255) will be .25 inches. Will that always be the case? If I’m engraving into a material that is 1/4 inch thick, then wouldn’t Black be a full cut through the material? If not, then how do I know what “maximum” is?

screenshot of the little app: