Skip to content
Snippets Groups Projects
Commit 091fde0d authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

outline working

parent e289a87c
Branches
No related tags found
No related merge requests found
...@@ -77,7 +77,6 @@ var interface = function(div){ ...@@ -77,7 +77,6 @@ var interface = function(div){
input.type = 'radio' input.type = 'radio'
input.name = mod.div.id+'format' input.name = mod.div.id+'format'
input.id = mod.div.id+'outline' input.id = mod.div.id+'outline'
input.disabled = true
formats.appendChild(input) formats.appendChild(input)
mod.outline = input mod.outline = input
formats.appendChild(document.createTextNode('outline')) formats.appendChild(document.createTextNode('outline'))
...@@ -104,13 +103,15 @@ function format(x) { ...@@ -104,13 +103,15 @@ function format(x) {
function plot() { function plot() {
var imgwidth = mod.imageInfo.width/parseFloat(mod.imageInfo.dpi) var imgwidth = mod.imageInfo.width/parseFloat(mod.imageInfo.dpi)
var imgheight = mod.imageInfo.height/parseFloat(mod.imageInfo.dpi) var imgheight = mod.imageInfo.height/parseFloat(mod.imageInfo.dpi)
var x,y
// //
str = '' str = ''
str += "%MOIN*%\n" // inch units str += "%MOIN*%\n" // inch units
str += "%LPD*%\n" // layer dark str += "%LPD*%\n" // layer dark
str += "%FSLAX66Y66*%\n" // format absolute 6.6 str += "%FSLAX66Y66*%\n" // format absolute 6.6
str += "G01*\n" // linear interpolation
// //
var x,y if (mod.fill.checked == true) {
for (var seg = 0; seg < mod.path.length; ++seg) { for (var seg = 0; seg < mod.path.length; ++seg) {
str += "G36*\n" str += "G36*\n"
x = imgwidth*mod.path[seg][0][0]/(mod.imageInfo.width-1) x = imgwidth*mod.path[seg][0][0]/(mod.imageInfo.width-1)
...@@ -127,19 +128,37 @@ function plot() { ...@@ -127,19 +128,37 @@ function plot() {
str += "G37*\n" str += "G37*\n"
} }
str += "M02*\n" str += "M02*\n"
//
var obj = {} var obj = {}
obj.type = 'file' obj.type = 'file'
obj.name = mod.imageInfo.name+'.gbr' obj.name = mod.imageInfo.name+'.gtl'
//var xml = new XMLSerializer().serializeToString(str) obj.contents = str
//obj.contents = xml outputs.Gerber.event(obj)
}
else if (mod.outline.checked == true) {
str += "%ADD10C,0.001*%\n"
str += "D10*\n"
for (var seg = 0; seg < mod.path.length; ++seg) {
x = imgwidth*mod.path[seg][0][0]/(mod.imageInfo.width-1)
y = imgheight*mod.path[seg][0][1]/(mod.imageInfo.height-1)
str += 'X'+format(x)+'Y'+format(y)+'D02*\n'
for (var pt = 1; pt < mod.path[seg].length; ++pt) {
var x = imgwidth*mod.path[seg][pt][0]/(mod.imageInfo.width-1)
var y = imgheight*mod.path[seg][pt][1]/(mod.imageInfo.height-1)
str += 'X'+format(x)+'Y'+format(y)+'D01*\n'
}
x = imgwidth*mod.path[seg][0][0]/(mod.imageInfo.width-1)
y = imgheight*mod.path[seg][0][1]/(mod.imageInfo.height-1)
str += 'X'+format(x)+'Y'+format(y)+'D01*\n'
}
str += "M02*\n"
var obj = {}
obj.type = 'file'
obj.name = mod.imageInfo.name+'.gko'
obj.contents = str obj.contents = str
outputs.Gerber.event(obj) outputs.Gerber.event(obj)
} }
}
/* /*
%ADD11C,0.1*%
%LPC*%
G01*
D11* D11*
X1000Y1000D02* X1000Y1000D02*
X1000Y2000D01* X1000Y2000D01*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment