Commit e289a87c authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

1st Gerber download

parent f63330f9
......@@ -104,10 +104,12 @@ function format(x) {
function plot() {
var imgwidth = mod.imageInfo.width/parseFloat(mod.imageInfo.dpi)
var imgheight = mod.imageInfo.height/parseFloat(mod.imageInfo.dpi)
//
str = ''
str += "%MOIN*%\n" // inch units
str += "%LPD*%\n" // layer dark
str += "%FSLAX66Y66*%\n" // format absolute 6.6
//
var x,y
for (var seg = 0; seg < mod.path.length; ++seg) {
str += "G36*\n"
......@@ -125,7 +127,14 @@ function plot() {
str += "G37*\n"
}
str += "M02*\n"
console.log(str)
//
var obj = {}
obj.type = 'file'
obj.name = mod.imageInfo.name+'.gbr'
//var xml = new XMLSerializer().serializeToString(str)
//obj.contents = xml
obj.contents = str
outputs.Gerber.event(obj)
}
/*
%ADD11C,0.1*%
......@@ -137,41 +146,6 @@ X1000Y2000D01*
X2000Y2000D01*
X1500Y1000D01*
M02*
//
// convert
//
function convert(path) {
//
// draw path
//
if (mod.fill.checked == true) {
var polyline = document.createElementNS(svgNS,'polyline')
polyline.setAttribute('stroke','none')
polyline.setAttribute('fill','black')
polyline.setAttribute('fill-rule','evenodd')
polyline.setAttribute('points',points)
g.appendChild(polyline)
}
else {
var polyline = document.createElementNS(svgNS,'polyline')
polyline.setAttribute('stroke','black')
polyline.setAttribute('stroke-width','0.01')
polyline.setAttribute('stroke-linecap','round')
polyline.setAttribute('fill','none')
polyline.setAttribute('points',points)
g.appendChild(polyline)
}
}
//
// save file
//
var obj = {}
obj.type = 'file'
obj.name = mod.imageInfo.name+'.svg'
var xml = new XMLSerializer().serializeToString(svg)
obj.contents = xml
outputs.SVG.event(obj)
}
*/
//
// return values
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment