rename drill to hole
This commit is contained in:
parent
d5723c2597
commit
e09ffa9507
@ -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
|
||||
}
|
||||
]
|
||||
|
24
cvlp_lib.js
24
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user