/**
Copyright (C) 2015-2018 by Autodesk, Inc.
All rights reserved.
$Revision: 41849 6d7e405464bb0f11c955ad97df850d057fefd042 $
$Date: 2018-02-14 14:11:32 $
FORKID {BD9FC5A6-277B-4D20-8FD5-7F70CC009C8D}
*/
description = "Epilog Laser";
vendor = "Epilog Laser";
vendorUrl = "https://www.epiloglaser.com";
legal = "Copyright (C) 2015-2018 by Autodesk, Inc.";
certificationLevel = 2;
longDescription = "Generic post for Epilog Laser. The post will output an HTML page with embedded SVG graphics which can then be printed using the installed Epilog Laser printer. " +
"You can do both through-cutting and etching in the same program by enabling the 'useColorMapping' property. " +
"When enabled, RED (255,0,0) will be used for through-cutting and GREEN (0,255,0) for etching. " +
"You have to make sure to turn on color mapping and adjust the power settings correspondingly in the Epilog settings. " +
"By default you will get BLUE (0,0,255) for both through-cutting and etching. " +
"Enable the 'useWCS' property to force the part placement to match the WCS setting in the Setup. Otherwise the workpiece will be centered according to the given 'width' and 'height' properties. " +
"Also keep in mind that you can choose the alignment of the workpiece in the print dialog (e.g. Top-Left corner).";
extension = "html";
mimetype = "text/html";
setCodePage("utf-8");
capabilities = CAPABILITY_JET;
minimumCircularSweep = toRad(0.01);
maximumCircularSweep = toRad(90); // avoid potential center calculation errors for CNC
allowHelicalMoves = true;
allowedCircularPlanes = (1 << PLANE_XY); // only XY arcs
properties = {
useWCS: true, // do not center the toolpath
useTimeStamp: false, // enable to output a time stamp
width: 48 * 25.4, // width in mm used when useWCS is disabled
height: 24 * 25.4, // height in mm used when useWCS is disabled
margin: 0, // margin in mm
outputGuide: false, // output help geometry also
useColorMapping: false, // use color mapping
embedInHTML: true // enable to output SVG embedded in HTML
};
// user-defined property definitions
propertyDefinitions = {
useWCS: {title:"Use WCS", description:"Do not center the toolpath.", type:"boolean"},
useTimeStamp: {title:"Use time stamp", description:"If enabled, a time stamp is outputted.", type:"boolean"},
width: {title:"Height(mm", description:"Height in mm, used when useWCS is disabled.", type:"number"},
height: {title:"Height(mm)", description:"Height in mm, used when useWCS is disabled.", type:"number"},
margin: {title:"Margin(mm)", description:"Sets the margin in mm.", type:"number"},
outputGuide: {title:"Output guide", description:"Enable to include help geometry.", type:"boolean"},
useColorMapping: {title:"Use color mapping", description:"Enable to use color mapping.", type:"boolean"},
embedInHTML: {title:"Embedded in HTML", description:"Enable to output SVG embedded in HTML.", type:"boolean"}
};
var xyzFormat = createFormat({decimals:(unit == MM ? 3 : 4)});
// Recommended colors for color mapping.
var RED = "rgb(255,0,0)";
var GREEN = "rgb(0,255,0)";
var BLUE = "rgb(0,0,255)";
var YELLOW = "rgb(255,255,0)";
var MAGENTA = "rgb(255,0,255)";
var CYAN = "rgb(0,255,255)";
/** Returns the given spatial value in MM. */
function toMM(value) {
return value * ((unit == IN) ? 25.4 : 1);
}
function onOpen() {
if (properties.embedInHTML) {
writeln("");
writeln("");
writeln("
" + (programName ? programName : localize("Unnamed")) + " - Autodesk CAM" + "");
writeln("");
writeln("");
if (properties.useTimeStamp) {
var d = new Date();
writeln("");
}
} else {
writeln("");
}
var WIDTH = 210;
var HEIGHT = 297;
if (properties.margin < 0) {
error(localize("Margin must be 0 or positive."));
return;
}
var box = getWorkpiece();
var dx = toMM(box.upper.x - box.lower.x) + 2 * properties.margin;
var dy = toMM(box.upper.y - box.lower.y) + 2 * properties.margin;
log("Width: " + xyzFormat.format(dx));
log("Height: " + xyzFormat.format(dy));
var width = WIDTH;
var height = HEIGHT;
var useLandscape = false;
if (properties.useWCS) {
width = dx;
height = dy;
} else {
if ((dx > width) || (dy > height)) {
if ((dx <= height) && (dy <= width)) {
useLandscape = true;
width = HEIGHT;
height = WIDTH;
}
}
log("Sheet width: " + xyzFormat.format(width));
log("Sheet height: " + xyzFormat.format(height));
if (dx > width) {
warning(localize("Toolpath exceeds sheet width."));
}
if (dy > height) {
warning(localize("Toolpath exceeds sheet height."));
}
}
writeln("");
if (properties.embedInHTML) {
writeln("");
writeln("");
}
}