aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKing Kévin <kingkevin@cuvoodoo.info>2019-05-13 20:43:24 +0200
committerKing Kévin <kingkevin@cuvoodoo.info>2019-05-13 20:43:24 +0200
commite09ffa950793f4f1972e3d664d499b849278fc0b (patch)
treeb6395e7b914cbfa2e9ed3283446784f4d5ca6442
parentd5723c259784c9607d3836b8530788aaea0e3b0b (diff)
rename drill to hole
-rw-r--r--cvlp_format.txt2
-rw-r--r--cvlp_lib.js24
2 files changed, 13 insertions, 13 deletions
diff --git a/cvlp_format.txt b/cvlp_format.txt
index b9cb9e9..0a5347d 100644
--- a/cvlp_format.txt
+++ b/cvlp_format.txt
@@ -48,7 +48,7 @@
"x": 50, // center horizontal position of pin
"y": 50, // center vertical position of pin
"thickness": 30, // diameter/width of copper pin (positive, >= drill diameter/width)
- "drill": 20, // diameter of drill
+ "hole": 20, // diameter of hole
"round": true, // shape of pin: round or square
}
]
diff --git a/cvlp_lib.js b/cvlp_lib.js
index 594d51a..4512ac9 100644
--- a/cvlp_lib.js
+++ b/cvlp_lib.js
@@ -55,14 +55,14 @@ function cvlp_pad(number, x, y, width, height, round) {
}
// create a set of elements with an pin element
-function cvlp_pin(number, x, y, thickness, drill, round) {
+function cvlp_pin(number, x, y, thickness, hole, round) {
var pin = {}
pin.type = "pin"
pin.number = number
pin.x = x
pin.y = y
pin.thickness = thickness
- pin.drill = drill
+ pin.hole = hole
pin.round = round || true
return [pin]
}
@@ -161,7 +161,7 @@ function json2svg(json) {
svg.appendChild(svg_title);
// add layers
layers_desc = [ { name: 'copper', stroke: 'gray', fill: 'gray'},
- { name: 'drill', stroke: 'none', fill: 'white'},
+ { name: 'hole', stroke: 'none', fill: 'white'},
{ name: 'silkscreen', stroke: 'black', fill: 'none', 'stroke-linecap': 'round'}
]
layers = []
@@ -240,12 +240,12 @@ function json2svg(json) {
copper.setAttribute('ry',0)
}
layers['copper'].appendChild(copper)
- var drill = document.createElementNS(svgNS,'circle')
- drill.style.setProperty('stroke-width',0)
- drill.setAttribute('cx',element.x)
- drill.setAttribute('cy',element.y)
- drill.setAttribute('r',element.drill/2)
- layers['drill'].appendChild(drill)
+ var hole = document.createElementNS(svgNS,'circle')
+ hole.style.setProperty('stroke-width',0)
+ hole.setAttribute('cx',element.x)
+ hole.setAttribute('cy',element.y)
+ hole.setAttribute('r',element.hole/2)
+ layers['hole'].appendChild(hole)
break
default:
console.log('unknown element type: '+element.type)
@@ -296,7 +296,7 @@ function json2pcb(json) {
pcb += '"]\n'
break
case 'pin':
- pcb += 'Pin['+element.x+''+json.unit+' '+element.y+''+json.unit+' '+element.thickness+''+json.unit+' '+0+''+json.unit+' '+thickness+''+json.unit+' '+element.drill+''+json.unit+' "" "'+element.number+'" "'
+ pcb += 'Pin['+element.x+''+json.unit+' '+element.y+''+json.unit+' '+element.thickness+''+json.unit+' '+0+''+json.unit+' '+thickness+''+json.unit+' '+element.hole+''+json.unit+' "" "'+element.number+'" "'
if (!element.round) {
pcb += 'square'
}
@@ -354,7 +354,7 @@ function json2kicad(json) {
}
kicad += ' (at '+convert_unit(x,json.unit,'mm')+' '+convert_unit(y,json.unit,'mm')+' '+angle+')'
kicad += ' (size '+convert_unit(length,json.unit,'mm')+' '+convert_unit(element.thickness,json.unit,'mm')+')'
- kicad += ' (drill '+convert_unit(element.drill,json.unit,'mm')
+ kicad += ' (drill '+convert_unit(element.hole,json.unit,'mm')
kicad += ' (layers F.Cu F.Paste F.Mask)'
kicad += ')\n'
break
@@ -454,7 +454,7 @@ function json2eagle(json) {
pin.setAttribute('name',element.number)
pin.setAttribute('x',convert_unit(element.x,json.unit,'mm'))
pin.setAttribute('y',convert_unit(-1*element.y,json.unit,'mm'))
- pin.setAttribute('drill',convert_unit(element.drill,json.unit,'mm'))
+ pin.setAttribute('drill',convert_unit(element.hole,json.unit,'mm'))
pin.setAttribute('diameter',convert_unit(element.thickness,json.unit,'mm'))
pin.setAttribute('layer','17')
if (element.round) {