/**
Copyright (C) 2015-2021 by Autodesk, Inc.
All rights reserved.
$Revision: 43470 147f5cf60e9217cf9c3365dc511a0f631d89bb16 $
$Date: 2021-10-13 20:53:32 $
FORKID {BD9FC5A6-277B-4D20-8FD5-7F70CC009C8D}
*/
description = "Epilog Laser";
vendor = "Epilog Laser";
vendorUrl = "https://www.epiloglaser.com";
legal = "Copyright (C) 2015-2021 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: {
title : "Use WCS",
description: "Do not center the toolpath.",
type : "boolean",
value : true,
scope : "post"
},
useTimeStamp: {
title : "Use time stamp",
description: "If enabled, a time stamp is outputted.",
type : "boolean",
value : false,
scope : "post"
},
width: {
title : "Width(mm)",
description: "Width in mm, used when useWCS is disabled.",
type : "number",
value : 1219.2,
scope : "post"
},
height: {
title : "Height(mm)",
description: "Height in mm, used when useWCS is disabled.",
type : "number",
value : 609.6,
scope : "post"
},
margin: {
title : "Margin(mm)",
description: "Sets the margin in mm.",
type : "number",
value : 0,
scope : "post"
},
outputGuide: {
title : "Output guide",
description: "Enable to include help geometry.",
type : "boolean",
value : false,
scope : "post"
},
useColorMapping: {
title : "Use color mapping",
description: "Enable to use color mapping.",
type : "boolean",
value : false,
scope : "post"
},
embedInHTML: {
title : "Embedded in HTML",
description: "Enable to output SVG embedded in HTML.",
type : "boolean",
value : true,
scope : "post"
}
};
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 (getProperty("embedInHTML")) {
writeln("");
writeln("");
writeln("" + (programName ? programName : localize("Unnamed")) + " - Autodesk CAM" + "");
writeln("");
writeln("");
if (getProperty("useTimeStamp")) {
var d = new Date();
writeln("");
}
} else {
writeln("");
}
var WIDTH = 210;
var HEIGHT = 297;
if (getProperty("margin") < 0) {
error(localize("Margin must be 0 or positive."));
return;
}
var box = getWorkpiece();
var dx = toMM(box.upper.x - box.lower.x) + 2 * getProperty("margin");
var dy = toMM(box.upper.y - box.lower.y) + 2 * getProperty("margin");
log("Width: " + xyzFormat.format(dx));
log("Height: " + xyzFormat.format(dy));
var width = WIDTH;
var height = HEIGHT;
var useLandscape = false;
if (getProperty("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 (getProperty("embedInHTML")) {
writeln("");
writeln("");
}
}
function setProperty(property, value) {
properties[property].current = value;
}