-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-layout.js
More file actions
33 lines (28 loc) · 816 Bytes
/
make-layout.js
File metadata and controls
33 lines (28 loc) · 816 Bytes
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
const fs = require('fs');
const path = require('path');
const { FpLibTable } = require('libkicad');
const { Library } = require('electron-qeda');
const layoutDir = path.join(__dirname, 'layout');
if (!fs.existsSync(layoutDir)) {
fs.mkdirSync(layoutDir);
}
process.chdir(layoutDir);
const fplib = new FpLibTable();
fplib.addLib('vdiv');
fplib.write();
const lib = new Library('vdiv');
lib.addFootprint({
name: 'R0402',
description: 'Chip resistor 1x0.5 mm',
keywords: [ 'Resistor', '1/16W' ],
housing: {
pattern: 'chip',
bodyLength: '0.9-1.1',
bodyWidth: '0.45-0.55',
height: '0.3-0.4',
leadLength: '0.1-0.3'
}
});
lib.generate(layoutDir);
const net = path.join(__dirname, 'build', 'VoltageDivider.net');
fs.createReadStream(net).pipe(fs.createWriteStream('VoltageDivider.net'));