Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mods
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
mods
Commits
9df3a692
Commit
9df3a692
authored
7 years ago
by
Neil Gershenfeld
Browse files
Options
Downloads
Patches
Plain Diff
working on Epilog
parent
bb26d113
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/toolpath/machines/laser cutter/Epilog
+39
-95
39 additions, 95 deletions
modules/toolpath/machines/laser cutter/Epilog
with
39 additions
and
95 deletions
modules/toolpath/machines/laser cutter/Epilog
+
39
−
95
View file @
9df3a692
...
@@ -25,7 +25,11 @@ var name = 'Epilog laser cutter'
...
@@ -25,7 +25,11 @@ var name = 'Epilog laser cutter'
// initialization
// initialization
//
//
var init = function() {
var init = function() {
mod.speed.value = 2
mod.power.value = 25
mod.speed.value = 75
mod.rate.value = 100
mod.x = 0
mod.y = 0
}
}
//
//
// inputs
// inputs
...
@@ -75,7 +79,7 @@ var interface = function(div){
...
@@ -75,7 +79,7 @@ var interface = function(div){
div.appendChild(input)
div.appendChild(input)
mod.power = input
mod.power = input
div.appendChild(document.createElement('br'))
div.appendChild(document.createElement('br'))
div.appendChild(document.createTextNode('speed (
cm/s
): '))
div.appendChild(document.createTextNode('speed (
%
): '))
var input = document.createElement('input')
var input = document.createElement('input')
input.type = 'text'
input.type = 'text'
input.size = 6
input.size = 6
...
@@ -141,61 +145,35 @@ var interface = function(div){
...
@@ -141,61 +145,35 @@ var interface = function(div){
//
//
function make_path() {
function make_path() {
var dx = mod.width/globals.dpi
var dx = 25.4*mod.width/mod.dpi
var dy = mod.height/globals.dpi
var dy = 25.4*mod.height/mod.dpi
var nx = mod.width
var nx = mod.width
var ny = mod.height
var ny = mod.height
var force = parseFloat(mod.force.value)
var scale = 600.0*dx/(nx-1) // 600 DPI
var power = parseFloat(mod.power.value)
var speed = parseFloat(mod.speed.value)
var speed = parseFloat(mod.speed.value)
var str = "PA;PA;!ST1;!FS"+force+";VS"+speed+";\n"
var rate = parseFloat(mod.rate.value)
var scale = 40.0*dx/(nx-1.0) // 40/mm
var ox = parseFloat(mod.x.value)/25.4
var ox = 0
var oy = parseFloat(mod.y.value)/25.4
var oy = 0
if (mod.botleft.checked) {
if (mod.botleft.checked) {
var xoffset = 40.0*ox
var yoffset = 40.0*oy
}
else if (mod.botright.checked) {
var xoffset = 40.0*(ox-dx)
var yoffset = 40.0*oy
}
else if (mod.topleft.checked) {
var xoffset = 40.0*ox
var yoffset = 40.0*(oy-dy)
}
else if (mod.topright.checked) {
var xoffset = 40.0*(ox-dx)
var yoffset = 40.0*(oy-dy)
}
var dx = globals.width/globals.dpi
var dy = globals.height/globals.dpi
var nx = globals.width
var ny = globals.height
var power = parseFloat(findEl("mod_power").value)
var speed = parseFloat(findEl("mod_speed").value)
var rate = parseFloat(findEl("mod_rate").value)
var ox = parseFloat(findEl("mod_x_origin").value)/25.4
var oy = parseFloat(findEl("mod_y_origin").value)/25.4
var scale = 600.0*dx/(nx-1) // 600 DPI
if (findEl("mod_bottom_left").checked) {
var xoffset = 600.0*ox
var xoffset = 600.0*ox
var yoffset = 600.0*(oy-dy)
var yoffset = 600.0*(oy-dy)
} else if (findEl("mod_bottom_right").checked) {
}
else if (mod.botright.checked) {
var xoffset = 600.0*(ox-dx)
var xoffset = 600.0*(ox-dx)
var yoffset = 600.0*(oy-dy)
var yoffset = 600.0*(oy-dy)
} else if (findEl("mod_top_left").checked) {
}
else if (mod.topleft.checked) {
var xoffset = 600.0*ox
var xoffset = 600.0*ox
var yoffset = 600.0*oy
var yoffset = 600.0*oy
} else if (findEl("mod_top_right").checked) {
}
else if (mod.topright.checked) {
var xoffset = 600.0*(ox-dx)
var xoffset = 600.0*(ox-dx)
var yoffset = 600.0*oy
var yoffset = 600.0*oy
}
}
var str = "%-12345X@PJL JOB NAME=" + mod.name + "\r\n"
var str = "%-12345X@PJL JOB NAME=" + globals.input_basename + "\r\n"
str += "E@PJL ENTER LANGUAGE=PCL\r\n"
str += "E@PJL ENTER LANGUAGE=PCL\r\n"
if (
findEl("mod_auto
focus
")
.checked)
if (
mod.
focus.checked)
//
//
// init with autofocus on
// init with autofocus on
//
//
...
@@ -207,48 +185,21 @@ else if (mod.topright.checked) {
...
@@ -207,48 +185,21 @@ else if (mod.topright.checked) {
str += "&y0A"
str += "&y0A"
str += "&l0U&l0Z&u600D*p0X*p0Y*t600R*r0F&y50P&z50S*r6600T*r5100S*r1A*rC%1BIN;"
str += "&l0U&l0Z&u600D*p0X*p0Y*t600R*r0F&y50P&z50S*r6600T*r5100S*r1A*rC%1BIN;"
str += "XR"+rate+";YP"+power+";ZS"+speed+";\n"
str += "XR"+rate+";YP"+power+";ZS"+speed+";\n"
//
//
// loop over segments
// loop over segments
//
//
for (var seg = 0; seg < mod.path.length; ++seg) {
for (var seg = 0; seg < mod.path.length; ++seg) {
x = xoffset+scale*mod.path[seg][0][0]
y = yoffset+scale*mod.path[seg][0][1]
str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move up to start point
//str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped
str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move down
//str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped
//
// loop over points
//
for (var pt = 1; pt < mod.path[seg].length; ++pt) {
x = xoffset+scale*mod.path[seg][pt][0]
y = yoffset+scale*mod.path[seg][pt][1]
str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move down
//str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped
}
str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // move up at last point
//str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";\n" // hack: repeat in case comm dropped
}
//
// loop over segments
//
for (var seg = 0; seg < path.length; ++seg) {
//
//
// loop over points
// loop over points
//
//
x = xoffset+scale*path[seg][0][0]
x = xoffset+scale*
mod.
path[seg][0][0]
y = yoffset+scale*(ny-path[seg][0][1])
y = yoffset+scale*(ny-
mod.
path[seg][0][1])
if (x < 0) x = 0
if (x < 0) x = 0
if (y < 0) y = 0
if (y < 0) y = 0
str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";" // move up to start point
str += "PU"+x.toFixed(0)+","+y.toFixed(0)+";" // move up to start point
for (var pt = 1; pt < path[seg].length; ++pt) {
for (var pt = 1; pt <
mod.
path[seg].length; ++pt) {
x = xoffset+scale*path[seg][pt][0]
x = xoffset+scale*
mod.
path[seg][pt][0]
y = yoffset+scale*(ny-path[seg][pt][1])
y = yoffset+scale*(ny-
mod.
path[seg][pt][1])
if (x < 0) x = 0
if (x < 0) x = 0
if (y < 0) y = 0
if (y < 0) y = 0
str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";" // move down
str += "PD"+x.toFixed(0)+","+y.toFixed(0)+";" // move down
...
@@ -256,20 +207,13 @@ for (var seg = 0; seg < mod.path.length; ++seg) {
...
@@ -256,20 +207,13 @@ for (var seg = 0; seg < mod.path.length; ++seg) {
str += "\n"
str += "\n"
}
}
str += "%0B%1BPUE%-12345X@PJL EOJ \r\n"
str += "%0B%1BPUE%-12345X@PJL EOJ \r\n"
str += "PU0,0;\n" // pen up to origin
outputs.file.event(str)
//
//
// end-of-file padding hack from Epilog print driver
// end-of-file padding hack from Epilog print driver
//
//
for (var i = 0; i < 10000; ++i)
for (var i = 0; i < 10000; ++i)
str += " "
str += " "
outputs.file.event(str)
return str
}
}
//
//
// return values
// return values
//
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment