Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
mods
Commits
e289a87c
Commit
e289a87c
authored
Aug 20, 2021
by
Neil Gershenfeld
Browse files
1st Gerber download
parent
f63330f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/path/formats/gerber
View file @
e289a87c
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment