forked from tracespace/tracespace
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharduino.js
34 lines (27 loc) · 1009 Bytes
/
arduino.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict'
var fs = require('fs')
var path = require('path')
var pcbStackup = require('../index')
var gerberPaths = [
'../integration/boards/arduino-uno/arduino-uno.cmp',
'../integration/boards/arduino-uno/arduino-uno.drd',
'../integration/boards/arduino-uno/arduino-uno.gko',
'../integration/boards/arduino-uno/arduino-uno.plc',
'../integration/boards/arduino-uno/arduino-uno.sol',
'../integration/boards/arduino-uno/arduino-uno.stc',
'../integration/boards/arduino-uno/arduino-uno.sts'
]
var layers = gerberPaths.map(function (gerberPath) {
var filename = path.join(__dirname, gerberPath)
var gerber = fs.createReadStream(filename)
return {filename: filename, gerber: gerber}
})
pcbStackup(layers, function (error, stackup) {
if (error) {
throw error
}
var topOut = path.join(__dirname, './arduino-top.svg')
var bottomOut = path.join(__dirname, './arduino-bottom.svg')
fs.writeFileSync(topOut, stackup.top.svg)
fs.writeFileSync(bottomOut, stackup.bottom.svg)
})