diff --git a/battery_connector_jst_ph_2.js b/battery_connector_jst_ph_2.js index 6ec7b06..a57af33 100644 --- a/battery_connector_jst_ph_2.js +++ b/battery_connector_jst_ph_2.js @@ -54,40 +54,6 @@ module.exports = { BAT_N: { type: 'net', value: 'GND' }, }, body: p => { - - const get_at_coordinates = () => { - const pattern = /\(at (-?[\d\.]*) (-?[\d\.]*) (-?[\d\.]*)\)/; - const matches = p.at.match(pattern); - if (matches && matches.length == 4) { - return [parseFloat(matches[1]), parseFloat(matches[2]), parseFloat(matches[3])]; - } else { - return null; - } - } - - const adjust_point = (x, y) => { - const at_l = get_at_coordinates(); - if (at_l == null) { - throw new Error( - `Could not get x and y coordinates from p.at: ${p.at}` - ); - } - const at_x = at_l[0]; - const at_y = at_l[1]; - const at_angle = at_l[2]; - const adj_x = at_x + x; - const adj_y = at_y + y; - - const radians = (Math.PI / 180) * at_angle, - cos = Math.cos(radians), - sin = Math.sin(radians), - nx = (cos * (adj_x - at_x)) + (sin * (adj_y - at_y)) + at_x, - ny = (cos * (adj_y - at_y)) - (sin * (adj_x - at_x)) + at_y; - - const point_str = `${nx.toFixed(3)} ${ny.toFixed(3)}`; - return point_str; - } - let local_nets = [ p.local_net("1"), p.local_net("2"), @@ -98,7 +64,7 @@ module.exports = { ${p.at /* parametric position */} (descr "JST PH series connector, S2B-PH-K (http://www.jst-mfg.com/product/pdf/eng/ePH.pdf)") - (fp_text reference "${p.ref}" (at 0 4.8 ${p.rot}) (layer "${p.side}.SilkS") ${p.ref_hide} + (fp_text reference "${p.ref}" (at 0 4.8 ${p.r}) (layer "${p.side}.SilkS") ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15))) ) ` @@ -161,17 +127,17 @@ module.exports = { (fp_line (start 3.06 6.36) (end 3.06 5.36) (width 0.12) (layer "B.SilkS")) ` const front_pads = ` - (pad 1 thru_hole roundrect (at -1 0 ${p.rot}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") (roundrect_rratio 0.20) ${p.BAT_N.str}) - (pad 2 thru_hole oval (at 1 0 ${p.rot}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") ${p.BAT_P.str}) + (pad 1 thru_hole roundrect (at -1 0 ${p.r}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") (roundrect_rratio 0.20) ${p.BAT_N.str}) + (pad 2 thru_hole oval (at 1 0 ${p.r}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") ${p.BAT_P.str}) ` const back_pads = ` - (pad 1 thru_hole roundrect (at 1 0 ${p.rot}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") (roundrect_rratio 0.20) ${p.BAT_N.str}) - (pad 2 thru_hole oval (at -1 0 ${p.rot}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") ${p.BAT_P.str}) + (pad 1 thru_hole roundrect (at 1 0 ${p.r}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") (roundrect_rratio 0.20) ${p.BAT_N.str}) + (pad 2 thru_hole oval (at -1 0 ${p.r}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") ${p.BAT_P.str}) ` const reversible_pads = ` - (pad 11 thru_hole oval (at -1 0 ${p.rot}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") ${local_nets[0].str}) - (pad 12 thru_hole oval (at 1 0 ${p.rot}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") ${local_nets[1].str}) - (pad 21 smd custom (at -1 1.8 ${180 + p.rot}) (size 0.1 0.1) (layers "F.Cu" "F.Mask") + (pad 11 thru_hole oval (at -1 0 ${p.r}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") ${local_nets[0].str}) + (pad 12 thru_hole oval (at 1 0 ${p.r}) (size 1.2 1.75) (drill 0.75) (layers "*.Cu" "*.Mask") ${local_nets[1].str}) + (pad 21 smd custom (at -1 1.8 ${180 + p.r}) (size 0.1 0.1) (layers "F.Cu" "F.Mask") (clearance 0.1) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -186,7 +152,7 @@ module.exports = { (width 0)) ) ${local_nets[0]}) - (pad 31 smd custom (at -1 1.8 ${180 + p.rot}) (size 0.1 0.1) (layers "B.Cu" "B.Mask") + (pad 31 smd custom (at -1 1.8 ${180 + p.r}) (size 0.1 0.1) (layers "B.Cu" "B.Mask") (clearance 0.1) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -201,7 +167,7 @@ module.exports = { (width 0)) ) ${local_nets[0]}) - (pad 22 smd custom (at 1 1.8 ${180 + p.rot}) (size 0.1 0.1) (layers "F.Cu" "F.Mask") + (pad 22 smd custom (at 1 1.8 ${180 + p.r}) (size 0.1 0.1) (layers "F.Cu" "F.Mask") (clearance 0.1) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -216,7 +182,7 @@ module.exports = { (width 0)) ) ${local_nets[1]}) - (pad 32 smd custom (at 1 1.8 ${180 + p.rot}) (size 0.1 0.1) (layers "B.Cu" "B.Mask") + (pad 32 smd custom (at 1 1.8 ${180 + p.r}) (size 0.1 0.1) (layers "B.Cu" "B.Mask") (clearance 0.1) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -231,7 +197,7 @@ module.exports = { (width 0)) ) ${local_nets[1]}) - (pad 1 smd custom (at -1 2.816 ${180 + p.rot}) (size 1.2 0.5) (layers "F.Cu" "F.Mask") ${p.BAT_P.str} + (pad 1 smd custom (at -1 2.816 ${180 + p.r}) (size 1.2 0.5) (layers "F.Cu" "F.Mask") ${p.BAT_P.str} (clearance 0.1) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -245,7 +211,7 @@ module.exports = { ) (width 0)) ) ) - (pad 1 smd custom (at 1 2.816 ${180 + p.rot}) (size 1.2 0.5) (layers "B.Cu" "B.Mask") ${p.BAT_P.str} + (pad 1 smd custom (at 1 2.816 ${180 + p.r}) (size 1.2 0.5) (layers "B.Cu" "B.Mask") ${p.BAT_P.str} (clearance 0.1) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -259,7 +225,7 @@ module.exports = { ) (width 0)) ) ) - (pad 2 smd custom (at -1 2.816 ${180 + p.rot}) (size 1.2 0.5) (layers "B.Cu" "B.Mask") ${p.BAT_N.str} + (pad 2 smd custom (at -1 2.816 ${180 + p.r}) (size 1.2 0.5) (layers "B.Cu" "B.Mask") ${p.BAT_N.str} (clearance 0.1) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -273,7 +239,7 @@ module.exports = { ) (width 0)) ) ) - (pad 2 smd custom (at 1 2.816 ${180 + p.rot}) (size 1.2 0.5) (layers "F.Cu" "F.Mask") ${p.BAT_N.str} + (pad 2 smd custom (at 1 2.816 ${180 + p.r}) (size 1.2 0.5) (layers "F.Cu" "F.Mask") ${p.BAT_N.str} (clearance 0.1) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -293,10 +259,10 @@ module.exports = { ` const reversible_traces = ` - (segment (start ${adjust_point(-1, 1.8)}) (end ${adjust_point(-1, 0)}) (width ${p.trace_width}) (layer "F.Cu") (net ${local_nets[0].index})) - (segment (start ${adjust_point(-1, 1.8)}) (end ${adjust_point(-1, 0)}) (width ${p.trace_width}) (layer "B.Cu") (net ${local_nets[0].index})) - (segment (start ${adjust_point(1, 1.8)}) (end ${adjust_point(1, 0)}) (width ${p.trace_width}) (layer "F.Cu") (net ${local_nets[1].index})) - (segment (start ${adjust_point(1, 1.8)}) (end ${adjust_point(1, 0)}) (width ${p.trace_width}) (layer "B.Cu") (net ${local_nets[1].index})) + (segment (start ${p.eaxy(-1, 1.8)}) (end ${p.eaxy(-1, 0)}) (width ${p.trace_width}) (layer "F.Cu") (net ${local_nets[0].index})) + (segment (start ${p.eaxy(-1, 1.8)}) (end ${p.eaxy(-1, 0)}) (width ${p.trace_width}) (layer "B.Cu") (net ${local_nets[0].index})) + (segment (start ${p.eaxy(1, 1.8)}) (end ${p.eaxy(1, 0)}) (width ${p.trace_width}) (layer "F.Cu") (net ${local_nets[1].index})) + (segment (start ${p.eaxy(1, 1.8)}) (end ${p.eaxy(1, 0)}) (width ${p.trace_width}) (layer "B.Cu") (net ${local_nets[1].index})) ` let final = standard_opening; diff --git a/diode_tht_sod123.js b/diode_tht_sod123.js index 82c29b1..9e9b1cc 100644 --- a/diode_tht_sod123.js +++ b/diode_tht_sod123.js @@ -59,11 +59,10 @@ module.exports = { to: undefined }, body: p => { - const standard_opening = ` (module "ceoloide:diode_tht_sod123" (layer ${p.side}.Cu) (tedit 5B24D78E) ${p.at /* parametric position */} - (fp_text reference "${p.ref}" (at 0 0 ${p.rot}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1.27 1.27) (thickness 0.15)))) + (fp_text reference "${p.ref}" (at 0 0 ${p.r}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1.27 1.27) (thickness 0.15)))) ` const front = ` (fp_line (start 0.25 0) (end 0.75 0) (layer F.SilkS) (width 0.1)) @@ -73,8 +72,8 @@ module.exports = { (fp_line (start -0.35 0) (end -0.35 0.55) (layer F.SilkS) (width 0.1)) (fp_line (start -0.35 0) (end -0.35 -0.55) (layer F.SilkS) (width 0.1)) (fp_line (start -0.75 0) (end -0.35 0) (layer F.SilkS) (width 0.1)) - (pad 1 smd rect (at -1.65 0 ${p.rot}) (size 0.9 1.2) (layers F.Cu F.Paste F.Mask) ${p.to.str}) - (pad 2 smd rect (at 1.65 0 ${p.rot}) (size 0.9 1.2) (layers F.Cu F.Paste F.Mask) ${p.from.str}) + (pad 1 smd rect (at -1.65 0 ${p.r}) (size 0.9 1.2) (layers F.Cu F.Paste F.Mask) ${p.to.str}) + (pad 2 smd rect (at 1.65 0 ${p.r}) (size 0.9 1.2) (layers F.Cu F.Paste F.Mask) ${p.from.str}) ` const back = ` (fp_line (start 0.25 0) (end 0.75 0) (layer B.SilkS) (width 0.1)) @@ -84,13 +83,13 @@ module.exports = { (fp_line (start -0.35 0) (end -0.35 0.55) (layer B.SilkS) (width 0.1)) (fp_line (start -0.35 0) (end -0.35 -0.55) (layer B.SilkS) (width 0.1)) (fp_line (start -0.75 0) (end -0.35 0) (layer B.SilkS) (width 0.1)) - (pad 2 smd rect (at 1.65 0 ${p.rot}) (size 0.9 1.2) (layers B.Cu B.Paste B.Mask) ${p.from.str}) - (pad 1 smd rect (at -1.65 0 ${p.rot}) (size 0.9 1.2) (layers B.Cu B.Paste B.Mask) ${p.to.str}) + (pad 2 smd rect (at 1.65 0 ${p.r}) (size 0.9 1.2) (layers B.Cu B.Paste B.Mask) ${p.from.str}) + (pad 1 smd rect (at -1.65 0 ${p.r}) (size 0.9 1.2) (layers B.Cu B.Paste B.Mask) ${p.to.str}) ` const tht = ` - (pad 1 thru_hole rect (at -3.81 0 ${p.rot}) (size 1.778 1.778) (drill 0.9906) (layers *.Cu *.Mask) ${p.to.str}) - (pad 2 thru_hole circle (at 3.81 0 ${p.rot}) (size 1.905 1.905) (drill 0.9906) (layers *.Cu *.Mask) ${p.from.str}) + (pad 1 thru_hole rect (at -3.81 0 ${p.r}) (size 1.778 1.778) (drill 0.9906) (layers *.Cu *.Mask) ${p.to.str}) + (pad 2 thru_hole circle (at 3.81 0 ${p.r}) (size 1.905 1.905) (drill 0.9906) (layers *.Cu *.Mask) ${p.from.str}) ` const diode_3dmodel = ` diff --git a/display_ssd1306.js b/display_ssd1306.js index 7be152d..4756c90 100644 --- a/display_ssd1306.js +++ b/display_ssd1306.js @@ -53,39 +53,6 @@ module.exports = { GND: { type: 'net', value: 'GND' }, }, body: p => { - const get_at_coordinates = () => { - const pattern = /\(at (-?[\d\.]*) (-?[\d\.]*) (-?[\d\.]*)\)/; - const matches = p.at.match(pattern); - if (matches && matches.length == 4) { - return [parseFloat(matches[1]), parseFloat(matches[2]), parseFloat(matches[3])]; - } else { - return null; - } - } - - const adjust_point = (x, y) => { - const at_l = get_at_coordinates(); - if (at_l == null) { - throw new Error( - `Could not get x and y coordinates from p.at: ${p.at}` - ); - } - const at_x = at_l[0]; - const at_y = at_l[1]; - const at_angle = at_l[2]; - const adj_x = at_x + x; - const adj_y = at_y + y; - - const radians = (Math.PI / 180) * at_angle, - cos = Math.cos(radians), - sin = Math.sin(radians), - nx = (cos * (adj_x - at_x)) + (sin * (adj_y - at_y)) + at_x, - ny = (cos * (adj_y - at_y)) - (sin * (adj_x - at_x)) + at_y; - - const point_str = `${nx.toFixed(3)} ${ny.toFixed(3)}`; - return point_str; - } - let dst_nets = [ p.GND, p.VCC, @@ -120,7 +87,7 @@ module.exports = { if (p.invert_jumpers_position) { jumpers_offset = 4.4; jumpers_rot = 180; - labels_offset = jumpers_offset + 2.80 + 0.1; + labels_offset = jumpers_offset + 2.80 + 0.1; jumpers_front_top = local_nets; jumpers_front_bottom = dst_nets; @@ -132,10 +99,10 @@ module.exports = { (module "ceoloide:display_ssd1306" (layer ${p.side}.Cu) (tedit 6448AF5B) ${p.at /* parametric position */} (attr virtual) - (fp_text reference "${p.ref}" (at 0 20 ${p.rot}) (layer ${p.side}.SilkS) ${p.ref_hide} + (fp_text reference "${p.ref}" (at 0 20 ${p.r}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text user %R (at 0 20 ${p.rot}) (layer ${p.side}.Fab) + (fp_text user %R (at 0 20 ${p.r}) (layer ${p.side}.Fab) (effects (font (size 1 1) (thickness 0.15))) ) ` @@ -157,15 +124,15 @@ module.exports = { ` const front_jumpers = ` - (pad 14 smd rect (at -3.81 ${14.05 + jumpers_offset} ${90 + p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_top[0].str}) - (pad 15 smd rect (at -1.27 ${14.05 + jumpers_offset} ${90 + p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_top[1].str}) - (pad 16 smd rect (at 1.27 ${14.05 + jumpers_offset} ${90 + p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_top[2].str}) - (pad 17 smd rect (at 3.81 ${14.05 + jumpers_offset} ${90 + p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_top[3].str}) - - (pad 10 smd rect (at -3.81 ${14.95 + jumpers_offset} ${90 + p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_bottom[0].str}) - (pad 11 smd rect (at -1.27 ${14.95 + jumpers_offset} ${90 + p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_bottom[1].str}) - (pad 12 smd rect (at 1.27 ${14.95 + jumpers_offset} ${90 + p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_bottom[2].str}) - (pad 13 smd rect (at 3.81 ${14.95 + jumpers_offset} ${90 + p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_bottom[3].str}) + (pad 14 smd rect (at -3.81 ${14.05 + jumpers_offset} ${90 + p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_top[0].str}) + (pad 15 smd rect (at -1.27 ${14.05 + jumpers_offset} ${90 + p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_top[1].str}) + (pad 16 smd rect (at 1.27 ${14.05 + jumpers_offset} ${90 + p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_top[2].str}) + (pad 17 smd rect (at 3.81 ${14.05 + jumpers_offset} ${90 + p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_top[3].str}) + + (pad 10 smd rect (at -3.81 ${14.95 + jumpers_offset} ${90 + p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_bottom[0].str}) + (pad 11 smd rect (at -1.27 ${14.95 + jumpers_offset} ${90 + p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_bottom[1].str}) + (pad 12 smd rect (at 1.27 ${14.95 + jumpers_offset} ${90 + p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_bottom[2].str}) + (pad 13 smd rect (at 3.81 ${14.95 + jumpers_offset} ${90 + p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${jumpers_front_bottom[3].str}) ` const back = ` @@ -186,49 +153,49 @@ module.exports = { ` const back_jumpers = ` - (pad 24 smd rect (at 3.81 ${14.05 + jumpers_offset} ${270 + p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_top[0].str}) - (pad 25 smd rect (at 1.27 ${14.05 + jumpers_offset} ${270 + p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_top[1].str}) - (pad 26 smd rect (at -1.27 ${14.05 + jumpers_offset} ${270 + p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_top[2].str}) - (pad 27 smd rect (at -3.81 ${14.05 + jumpers_offset} ${270 + p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_top[3].str}) - - (pad 20 smd rect (at 3.81 ${14.95 + jumpers_offset} ${270 + p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_bottom[0].str}) - (pad 21 smd rect (at 1.27 ${14.95 + jumpers_offset} ${270 + p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_bottom[1].str}) - (pad 22 smd rect (at -1.27 ${14.95 + jumpers_offset} ${270 + p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_bottom[2].str}) - (pad 23 smd rect (at -3.81 ${14.95 + jumpers_offset} ${270 + p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_bottom[3].str}) + (pad 24 smd rect (at 3.81 ${14.05 + jumpers_offset} ${270 + p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_top[0].str}) + (pad 25 smd rect (at 1.27 ${14.05 + jumpers_offset} ${270 + p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_top[1].str}) + (pad 26 smd rect (at -1.27 ${14.05 + jumpers_offset} ${270 + p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_top[2].str}) + (pad 27 smd rect (at -3.81 ${14.05 + jumpers_offset} ${270 + p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_top[3].str}) + + (pad 20 smd rect (at 3.81 ${14.95 + jumpers_offset} ${270 + p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_bottom[0].str}) + (pad 21 smd rect (at 1.27 ${14.95 + jumpers_offset} ${270 + p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_bottom[1].str}) + (pad 22 smd rect (at -1.27 ${14.95 + jumpers_offset} ${270 + p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_bottom[2].str}) + (pad 23 smd rect (at -3.81 ${14.95 + jumpers_offset} ${270 + p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${jumpers_back_bottom[3].str}) ` const labels = ` - (fp_text user SDA (at -4.50 ${13.0 + labels_offset} ${p.rot}) (layer F.SilkS) + (fp_text user SDA (at -4.50 ${13.0 + labels_offset} ${p.r}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text user SCL (at -1.50 ${13.0 + labels_offset} ${p.rot}) (layer F.SilkS) + (fp_text user SCL (at -1.50 ${13.0 + labels_offset} ${p.r}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text user VCC (at 1.50 ${13.0 + labels_offset} ${p.rot}) (layer F.SilkS) + (fp_text user VCC (at 1.50 ${13.0 + labels_offset} ${p.r}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text user GND (at 4.50 ${13.0 + labels_offset} ${p.rot}) (layer F.SilkS) + (fp_text user GND (at 4.50 ${13.0 + labels_offset} ${p.r}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text user GND (at -4.50 ${13.0 + labels_offset} ${p.rot}) (layer B.SilkS) + (fp_text user GND (at -4.50 ${13.0 + labels_offset} ${p.r}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) ) - (fp_text user VCC (at -1.50 ${13.0 + labels_offset} ${p.rot}) (layer B.SilkS) + (fp_text user VCC (at -1.50 ${13.0 + labels_offset} ${p.r}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) ) - (fp_text user SCL (at 1.50 ${13.0 + labels_offset} ${p.rot}) (layer B.SilkS) + (fp_text user SCL (at 1.50 ${13.0 + labels_offset} ${p.r}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) ) - (fp_text user SDA (at 4.50 ${13.0 + labels_offset} ${p.rot}) (layer B.SilkS) + (fp_text user SDA (at 4.50 ${13.0 + labels_offset} ${p.r}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) ) ` const bottom = ` - (pad 1 thru_hole oval (at -3.81 16.7 ${270 + p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${socket_nets[0].str}) - (pad 2 thru_hole oval (at -1.27 16.7 ${270 + p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${socket_nets[1].str}) - (pad 3 thru_hole oval (at 1.27 16.7 ${270 + p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${socket_nets[2].str}) - (pad 4 thru_hole oval (at 3.81 16.7 ${270 + p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${socket_nets[3].str}) + (pad 1 thru_hole oval (at -3.81 16.7 ${270 + p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${socket_nets[0].str}) + (pad 2 thru_hole oval (at -1.27 16.7 ${270 + p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${socket_nets[1].str}) + (pad 3 thru_hole oval (at 1.27 16.7 ${270 + p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${socket_nets[2].str}) + (pad 4 thru_hole oval (at 3.81 16.7 ${270 + p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${socket_nets[3].str}) (fp_line (start -6.00 -19.70) (end -6.00 18.30) (layer Dwgs.User) (width 0.15)) (fp_line (start 6.00 -19.70) (end 6.00 18.30) (layer Dwgs.User) (width 0.15)) @@ -240,25 +207,25 @@ module.exports = { ` const traces_bottom = ` - (segment (start ${adjust_point(-3.81, 16.7)}) (end ${adjust_point(-3.81, 18.45)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_bottom[0].index})) - (segment (start ${adjust_point(-1.27, 16.7)}) (end ${adjust_point(-1.27, 18.45)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${jumpers_front_bottom[1].index})) - (segment (start ${adjust_point(1.27, 16.7)}) (end ${adjust_point(1.27, 18.45)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_bottom[2].index})) - (segment (start ${adjust_point(3.81, 16.7)}) (end ${adjust_point(3.81, 18.45)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_bottom[3].index})) - (segment (start ${adjust_point(-3.81, 16.7)}) (end ${adjust_point(-3.81, 18.45)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_bottom[0].index})) - (segment (start ${adjust_point(-1.27, 16.7)}) (end ${adjust_point(-1.27, 18.45)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_bottom[1].index})) - (segment (start ${adjust_point(1.27, 16.7)}) (end ${adjust_point(1.27, 18.45)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${jumpers_back_bottom[2].index})) - (segment (start ${adjust_point(3.81, 16.7)}) (end ${adjust_point(3.81, 18.45)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_bottom[3].index})) + (segment (start ${p.eaxy(-3.81, 16.7)}) (end ${p.eaxy(-3.81, 18.45)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_bottom[0].index})) + (segment (start ${p.eaxy(-1.27, 16.7)}) (end ${p.eaxy(-1.27, 18.45)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${jumpers_front_bottom[1].index})) + (segment (start ${p.eaxy(1.27, 16.7)}) (end ${p.eaxy(1.27, 18.45)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_bottom[2].index})) + (segment (start ${p.eaxy(3.81, 16.7)}) (end ${p.eaxy(3.81, 18.45)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_bottom[3].index})) + (segment (start ${p.eaxy(-3.81, 16.7)}) (end ${p.eaxy(-3.81, 18.45)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_bottom[0].index})) + (segment (start ${p.eaxy(-1.27, 16.7)}) (end ${p.eaxy(-1.27, 18.45)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_bottom[1].index})) + (segment (start ${p.eaxy(1.27, 16.7)}) (end ${p.eaxy(1.27, 18.45)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${jumpers_back_bottom[2].index})) + (segment (start ${p.eaxy(3.81, 16.7)}) (end ${p.eaxy(3.81, 18.45)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_bottom[3].index})) ` const traces_top = ` - (segment (start ${adjust_point(-3.81, 16.7)}) (end ${adjust_point(-3.81, 14.95)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_top[0].index})) - (segment (start ${adjust_point(-1.27, 16.7)}) (end ${adjust_point(-1.27, 14.95)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${jumpers_front_top[1].index})) - (segment (start ${adjust_point(1.27, 16.7)}) (end ${adjust_point(1.27, 14.95)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_top[2].index})) - (segment (start ${adjust_point(3.81, 16.7)}) (end ${adjust_point(3.81, 14.95)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_top[3].index})) - (segment (start ${adjust_point(-3.81, 16.7)}) (end ${adjust_point(-3.81, 14.95)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_top[0].index})) - (segment (start ${adjust_point(-1.27, 16.7)}) (end ${adjust_point(-1.27, 14.95)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_top[1].index})) - (segment (start ${adjust_point(1.27, 16.7)}) (end ${adjust_point(1.27, 14.95)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${jumpers_back_top[2].index})) - (segment (start ${adjust_point(3.81, 16.7)}) (end ${adjust_point(3.81, 14.95)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_top[3].index})) + (segment (start ${p.eaxy(-3.81, 16.7)}) (end ${p.eaxy(-3.81, 14.95)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_top[0].index})) + (segment (start ${p.eaxy(-1.27, 16.7)}) (end ${p.eaxy(-1.27, 14.95)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${jumpers_front_top[1].index})) + (segment (start ${p.eaxy(1.27, 16.7)}) (end ${p.eaxy(1.27, 14.95)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_top[2].index})) + (segment (start ${p.eaxy(3.81, 16.7)}) (end ${p.eaxy(3.81, 14.95)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${jumpers_front_top[3].index})) + (segment (start ${p.eaxy(-3.81, 16.7)}) (end ${p.eaxy(-3.81, 14.95)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_top[0].index})) + (segment (start ${p.eaxy(-1.27, 16.7)}) (end ${p.eaxy(-1.27, 14.95)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_top[1].index})) + (segment (start ${p.eaxy(1.27, 16.7)}) (end ${p.eaxy(1.27, 14.95)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${jumpers_back_top[2].index})) + (segment (start ${p.eaxy(3.81, 16.7)}) (end ${p.eaxy(3.81, 14.95)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${jumpers_back_top[3].index})) ` let final = top; diff --git a/led_sk6812mini-e.js b/led_sk6812mini-e.js index d92f287..5008888 100644 --- a/led_sk6812mini-e.js +++ b/led_sk6812mini-e.js @@ -94,45 +94,12 @@ module.exports = { P4: undefined, }, body: p => { - const get_at_coordinates = () => { - const pattern = /\(at (-?[\d\.]*) (-?[\d\.]*) (-?[\d\.]*)\)/; - const matches = p.at.match(pattern); - if (matches && matches.length == 4) { - return [parseFloat(matches[1]), parseFloat(matches[2]), parseFloat(matches[3])]; - } else { - return null; - } - } - - const adjust_point = (x, y) => { - const at_l = get_at_coordinates(); - if (at_l == null) { - throw new Error( - `Could not get x and y coordinates from p.at: ${p.at}` - ); - } - const at_x = at_l[0]; - const at_y = at_l[1]; - const at_angle = at_l[2]; - const adj_x = at_x + x; - const adj_y = at_y + y; - - const radians = (Math.PI / 180) * at_angle, - cos = Math.cos(radians), - sin = Math.sin(radians), - nx = (cos * (adj_x - at_x)) + (sin * (adj_y - at_y)) + at_x, - ny = (cos * (adj_y - at_y)) - (sin * (adj_x - at_x)) + at_y; - - const point_str = `${nx.toFixed(3)} ${ny.toFixed(3)}`; - return point_str; - } - const standard_opening = ` (module "ceoloide:led_SK6812mini-e (${p.reverse_mount ? "per-key" : "underglow"}${p.reversible ? ", reversible" : "single-side"})" (layer ${p.side}.Cu) (tedit 5F70BC98) ${p.at /* parametric position */} - (fp_text reference "${p.ref}" (at -4.75 0 ${90 + p.rot}) (layer ${p.side}.SilkS) ${p.ref_hide} + (fp_text reference "${p.ref}" (at -4.75 0 ${90 + p.r}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15))) ) @@ -166,34 +133,34 @@ module.exports = { const front_reversed = ` (fp_line (start -3.8 1.6) (end -2.2 1.6) (layer F.SilkS) (width 0.12)) (fp_line (start -3.8 0) (end -3.8 1.6) (layer F.SilkS) (width 0.12)) - (pad 4 smd rect (at -2.7 -0.7 ${p.rot}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P4.str}) - (pad 3 smd rect (at -2.7 0.7 ${p.rot}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P3.str}) - (pad 1 smd rect (at 2.7 -0.7 ${p.rot}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P1.str}) - (pad 2 smd rect (at 2.7 0.7 ${p.rot}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P2.str}) + (pad 4 smd rect (at -2.7 -0.7 ${p.r}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P4.str}) + (pad 3 smd rect (at -2.7 0.7 ${p.r}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P3.str}) + (pad 1 smd rect (at 2.7 -0.7 ${p.r}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P1.str}) + (pad 2 smd rect (at 2.7 0.7 ${p.r}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P2.str}) ` const front = ` (fp_line (start -3.8 -1.6) (end -2.2 -1.6) (layer F.SilkS) (width 0.12)) (fp_line (start -3.8 0) (end -3.8 -1.6) (layer F.SilkS) (width 0.12)) - (pad 4 smd rect (at -2.70 0.7 ${p.rot}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P4.str}) - (pad 3 smd rect (at -2.70 -0.7 ${p.rot}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P3.str}) - (pad 1 smd rect (at 2.70 0.7 ${p.rot}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P1.str}) - (pad 2 smd rect (at 2.70 -0.7 ${p.rot}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P2.str}) + (pad 4 smd rect (at -2.70 0.7 ${p.r}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P4.str}) + (pad 3 smd rect (at -2.70 -0.7 ${p.r}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P3.str}) + (pad 1 smd rect (at 2.70 0.7 ${p.r}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P1.str}) + (pad 2 smd rect (at 2.70 -0.7 ${p.r}) (size 1.4 1) (layers F.Cu F.Paste F.Mask) ${p.P2.str}) ` const back_reversed = ` (fp_line (start -3.8 -1.6) (end -2.2 -1.6) (layer B.SilkS) (width 0.12)) (fp_line (start -3.8 0) (end -3.8 -1.6) (layer B.SilkS) (width 0.12)) - (pad 2 smd rect (at 2.70 -0.7 ${p.rot}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P2.str}) - (pad 1 smd rect (at 2.70 0.7 ${p.rot}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P1.str}) - (pad 3 smd rect (at -2.70 -0.7 ${p.rot}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P3.str}) - (pad 4 smd rect (at -2.70 0.7 ${p.rot}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P4.str}) + (pad 2 smd rect (at 2.70 -0.7 ${p.r}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P2.str}) + (pad 1 smd rect (at 2.70 0.7 ${p.r}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P1.str}) + (pad 3 smd rect (at -2.70 -0.7 ${p.r}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P3.str}) + (pad 4 smd rect (at -2.70 0.7 ${p.r}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P4.str}) ` const back = ` (fp_line (start -3.8 1.6) (end -2.2 1.6) (layer B.SilkS) (width 0.12)) (fp_line (start -3.8 0) (end -3.8 1.6) (layer B.SilkS) (width 0.12)) - (pad 2 smd rect (at 2.70 0.7 ${p.rot}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P2.str}) - (pad 1 smd rect (at 2.70 -0.7 ${p.rot}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P1.str}) - (pad 3 smd rect (at -2.70 0.7 ${p.rot}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P3.str}) - (pad 4 smd rect (at -2.70 -0.7 ${p.rot}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P4.str}) + (pad 2 smd rect (at 2.70 0.7 ${p.r}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P2.str}) + (pad 1 smd rect (at 2.70 -0.7 ${p.r}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P1.str}) + (pad 3 smd rect (at -2.70 0.7 ${p.r}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P3.str}) + (pad 4 smd rect (at -2.70 -0.7 ${p.r}) (size 1.4 1) (layers B.Cu B.Paste B.Mask) ${p.P4.str}) ` const standard_closing = ` (fp_line (start -1.8 -1.55) (end -1.8 1.55) (layer Edge.Cuts) (width 0.12)) @@ -205,60 +172,60 @@ module.exports = { const traces_vias_reversed = ` ${'' /* VCC Trace */} - (segment (start ${adjust_point(3.4, -0.7)}) (end ${adjust_point(4.06, -0.105916)}) (width ${p.vcc_trace_width}) (layer "F.Cu") (net ${p.P1.index})) - (segment (start ${adjust_point(4.06, -0.105916)}) (end ${adjust_point(4.06, 0.7)}) (width ${p.vcc_trace_width}) (layer "F.Cu") (net ${p.P1.index})) - (segment (start ${adjust_point(2.7, -0.7)}) (end ${adjust_point(3.4, -0.7)}) (width ${p.vcc_trace_width}) (layer "F.Cu") (net ${p.P1.index})) - (via (at ${adjust_point(4.06, 0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P1.index})) - (segment (start ${adjust_point(2.7, 0.7)}) (end ${adjust_point(4.06, 0.7)}) (width ${p.vcc_trace_width}) (layer "B.Cu") (net ${p.P1.index})) + (segment (start ${p.eaxy(3.4, -0.7)}) (end ${p.eaxy(4.06, -0.105916)}) (width ${p.vcc_trace_width}) (layer "F.Cu") (net ${p.P1.index})) + (segment (start ${p.eaxy(4.06, -0.105916)}) (end ${p.eaxy(4.06, 0.7)}) (width ${p.vcc_trace_width}) (layer "F.Cu") (net ${p.P1.index})) + (segment (start ${p.eaxy(2.7, -0.7)}) (end ${p.eaxy(3.4, -0.7)}) (width ${p.vcc_trace_width}) (layer "F.Cu") (net ${p.P1.index})) + (via (at ${p.eaxy(4.06, 0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P1.index})) + (segment (start ${p.eaxy(2.7, 0.7)}) (end ${p.eaxy(4.06, 0.7)}) (width ${p.vcc_trace_width}) (layer "B.Cu") (net ${p.P1.index})) ${'' /* Data signal out trace */} - (segment (start ${adjust_point(4.95, -0.7)}) (end ${adjust_point(2.7, -0.7)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) - (via (at ${adjust_point(4.95, -0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P2.index})) - (segment (start ${adjust_point(2.7, 0.7)}) (end ${adjust_point(3.481, 1.485)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) - (segment (start ${adjust_point(3.481, 1.485)}) (end ${adjust_point(4.529, 1.485)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) - (segment (start ${adjust_point(4.95, 1.06)}) (end ${adjust_point(4.95, -0.7)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) - (segment (start ${adjust_point(4.529, 1.485)}) (end ${adjust_point(4.95, 1.06)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(4.95, -0.7)}) (end ${p.eaxy(2.7, -0.7)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) + (via (at ${p.eaxy(4.95, -0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(2.7, 0.7)}) (end ${p.eaxy(3.481, 1.485)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(3.481, 1.485)}) (end ${p.eaxy(4.529, 1.485)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(4.95, 1.06)}) (end ${p.eaxy(4.95, -0.7)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(4.529, 1.485)}) (end ${p.eaxy(4.95, 1.06)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) ${'' /* GND Trace */} - (segment (start ${adjust_point(-3.4, -0.7)}) (end ${adjust_point(-4.06, -0.105916)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${p.P3.index})) - (segment (start ${adjust_point(-4.06, -0.105916)}) (end ${adjust_point(-4.06, 0.7)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${p.P3.index})) - (segment (start ${adjust_point(-2.7, -0.7)}) (end ${adjust_point(-3.4, -0.7)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${p.P3.index})) - (via (at ${adjust_point(-4.06, 0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P3.index})) - (segment (start ${adjust_point(-2.7, 0.7)}) (end ${adjust_point(-4.06, 0.7)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${p.P3.index})) + (segment (start ${p.eaxy(-3.4, -0.7)}) (end ${p.eaxy(-4.06, -0.105916)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${p.P3.index})) + (segment (start ${p.eaxy(-4.06, -0.105916)}) (end ${p.eaxy(-4.06, 0.7)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${p.P3.index})) + (segment (start ${p.eaxy(-2.7, -0.7)}) (end ${p.eaxy(-3.4, -0.7)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${p.P3.index})) + (via (at ${p.eaxy(-4.06, 0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P3.index})) + (segment (start ${p.eaxy(-2.7, 0.7)}) (end ${p.eaxy(-4.06, 0.7)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${p.P3.index})) ${'' /* Data signal in trace */} - (segment (start ${adjust_point(-4.95, -0.7)}) (end ${adjust_point(-2.7, -0.7)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) - (via (at ${adjust_point(-4.95, -0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P4.index})) - (segment (start ${adjust_point(-2.7, 0.7)}) (end ${adjust_point(-3.481, 1.485)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) - (segment (start ${adjust_point(-3.481, 1.485)}) (end ${adjust_point(-4.529, 1.485)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) - (segment (start ${adjust_point(-4.95, 1.06)}) (end ${adjust_point(-4.95, -0.7)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) - (segment (start ${adjust_point(-4.529, 1.485)}) (end ${adjust_point(-4.95, 1.06)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-4.95, -0.7)}) (end ${p.eaxy(-2.7, -0.7)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) + (via (at ${p.eaxy(-4.95, -0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-2.7, 0.7)}) (end ${p.eaxy(-3.481, 1.485)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-3.481, 1.485)}) (end ${p.eaxy(-4.529, 1.485)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-4.95, 1.06)}) (end ${p.eaxy(-4.95, -0.7)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-4.529, 1.485)}) (end ${p.eaxy(-4.95, 1.06)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) ` const traces_vias_straight = ` ${'' /* VCC Trace */} - (segment (start ${adjust_point(3.4, -0.7)}) (end ${adjust_point(4.06, -0.105916)}) (width ${p.vcc_trace_width}) (layer "B.Cu") (net ${p.P1.index})) - (segment (start ${adjust_point(4.06, -0.105916)}) (end ${adjust_point(4.06, 0.7)}) (width ${p.vcc_trace_width}) (layer "B.Cu") (net ${p.P1.index})) - (segment (start ${adjust_point(2.7, -0.7)}) (end ${adjust_point(3.4, -0.7)}) (width ${p.vcc_trace_width}) (layer "B.Cu") (net ${p.P1.index})) - (via (at ${adjust_point(4.06, 0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P1.index})) - (segment (start ${adjust_point(2.7, 0.7)}) (end ${adjust_point(4.06, 0.7)}) (width ${p.vcc_trace_width}) (layer "F.Cu") (net ${p.P1.index})) + (segment (start ${p.eaxy(3.4, -0.7)}) (end ${p.eaxy(4.06, -0.105916)}) (width ${p.vcc_trace_width}) (layer "B.Cu") (net ${p.P1.index})) + (segment (start ${p.eaxy(4.06, -0.105916)}) (end ${p.eaxy(4.06, 0.7)}) (width ${p.vcc_trace_width}) (layer "B.Cu") (net ${p.P1.index})) + (segment (start ${p.eaxy(2.7, -0.7)}) (end ${p.eaxy(3.4, -0.7)}) (width ${p.vcc_trace_width}) (layer "B.Cu") (net ${p.P1.index})) + (via (at ${p.eaxy(4.06, 0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P1.index})) + (segment (start ${p.eaxy(2.7, 0.7)}) (end ${p.eaxy(4.06, 0.7)}) (width ${p.vcc_trace_width}) (layer "F.Cu") (net ${p.P1.index})) ${'' /* Data signal out trace */} - (segment (start ${adjust_point(4.95, -0.7)}) (end ${adjust_point(2.7, -0.7)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) - (via (at ${adjust_point(4.95, -0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P2.index})) - (segment (start ${adjust_point(2.7, 0.7)}) (end ${adjust_point(3.481, 1.485)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) - (segment (start ${adjust_point(3.481, 1.485)}) (end ${adjust_point(4.529, 1.485)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) - (segment (start ${adjust_point(4.95, 1.06)}) (end ${adjust_point(4.95, -0.7)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) - (segment (start ${adjust_point(4.529, 1.485)}) (end ${adjust_point(4.95, 1.06)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(4.95, -0.7)}) (end ${p.eaxy(2.7, -0.7)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P2.index})) + (via (at ${p.eaxy(4.95, -0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(2.7, 0.7)}) (end ${p.eaxy(3.481, 1.485)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(3.481, 1.485)}) (end ${p.eaxy(4.529, 1.485)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(4.95, 1.06)}) (end ${p.eaxy(4.95, -0.7)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) + (segment (start ${p.eaxy(4.529, 1.485)}) (end ${p.eaxy(4.95, 1.06)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P2.index})) ${'' /* GND Trace */} - (segment (start ${adjust_point(-3.4, -0.7)}) (end ${adjust_point(-4.06, -0.105916)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${p.P3.index})) - (segment (start ${adjust_point(-4.06, -0.105916)}) (end ${adjust_point(-4.06, 0.7)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${p.P3.index})) - (segment (start ${adjust_point(-2.7, -0.7)}) (end ${adjust_point(-3.4, -0.7)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${p.P3.index})) - (via (at ${adjust_point(-4.06, 0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P3.index})) - (segment (start ${adjust_point(-2.7, 0.7)}) (end ${adjust_point(-4.06, 0.7)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${p.P3.index})) + (segment (start ${p.eaxy(-3.4, -0.7)}) (end ${p.eaxy(-4.06, -0.105916)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${p.P3.index})) + (segment (start ${p.eaxy(-4.06, -0.105916)}) (end ${p.eaxy(-4.06, 0.7)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${p.P3.index})) + (segment (start ${p.eaxy(-2.7, -0.7)}) (end ${p.eaxy(-3.4, -0.7)}) (width ${p.gnd_trace_width}) (layer "F.Cu") (net ${p.P3.index})) + (via (at ${p.eaxy(-4.06, 0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P3.index})) + (segment (start ${p.eaxy(-2.7, 0.7)}) (end ${p.eaxy(-4.06, 0.7)}) (width ${p.gnd_trace_width}) (layer "B.Cu") (net ${p.P3.index})) ${'' /* Data signal in trace */} - (segment (start ${adjust_point(-4.95, -0.7)}) (end ${adjust_point(-2.7, -0.7)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) - (via (at ${adjust_point(-4.95, -0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P4.index})) - (segment (start ${adjust_point(-2.7, 0.7)}) (end ${adjust_point(-3.481, 1.485)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) - (segment (start ${adjust_point(-3.481, 1.485)}) (end ${adjust_point(-4.529, 1.485)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) - (segment (start ${adjust_point(-4.95, 1.06)}) (end ${adjust_point(-4.95, -0.7)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) - (segment (start ${adjust_point(-4.529, 1.485)}) (end ${adjust_point(-4.95, 1.06)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-4.95, -0.7)}) (end ${p.eaxy(-2.7, -0.7)}) (width ${p.signal_trace_width}) (layer "B.Cu") (net ${p.P4.index})) + (via (at ${p.eaxy(-4.95, -0.7)}) (size ${p.via_size}) (drill ${p.via_drill}) (layers "F.Cu" "B.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-2.7, 0.7)}) (end ${p.eaxy(-3.481, 1.485)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-3.481, 1.485)}) (end ${p.eaxy(-4.529, 1.485)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-4.95, 1.06)}) (end ${p.eaxy(-4.95, -0.7)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) + (segment (start ${p.eaxy(-4.529, 1.485)}) (end ${p.eaxy(-4.95, 1.06)}) (width ${p.signal_trace_width}) (layer "F.Cu") (net ${p.P4.index})) ` const courtyard_front = ` @@ -323,10 +290,10 @@ module.exports = { (fill (thermal_gap 0.5) (thermal_bridge_width 0.5)) (polygon (pts - (xy ${adjust_point(-2.00, -1.85)}) - (xy ${adjust_point(2.00, -1.85)}) - (xy ${adjust_point(2.00, 1.85)}) - (xy ${adjust_point(-2.00, 1.85)}) + (xy ${p.eaxy(-2.00, -1.85)}) + (xy ${p.eaxy(2.00, -1.85)}) + (xy ${p.eaxy(2.00, 1.85)}) + (xy ${p.eaxy(-2.00, 1.85)}) ) ) ) @@ -367,7 +334,7 @@ module.exports = { } if (p.led_3dmodel_filename) { - final += led_3dmodel + final += led_3dmodel } final += standard_closing; diff --git a/mcu_nice_nano.js b/mcu_nice_nano.js index 8bd717f..8fca26e 100644 --- a/mcu_nice_nano.js +++ b/mcu_nice_nano.js @@ -185,60 +185,27 @@ module.exports = { return label; }; - const get_at_coordinates = () => { - const pattern = /\(at (-?[\d\.]*) (-?[\d\.]*) (-?[\d\.]*)\)/; - const matches = p.at.match(pattern); - if (matches && matches.length == 4) { - return [parseFloat(matches[1]), parseFloat(matches[2]), parseFloat(matches[3])]; - } else { - return null; - } - } - - const adjust_point = (x, y) => { - const at_l = get_at_coordinates(); - if (at_l == null) { - throw new Error( - `Could not get x and y coordinates from p.at: ${p.at}` - ); - } - const at_x = at_l[0]; - const at_y = at_l[1]; - const at_angle = at_l[2]; - const adj_x = at_x + x; - const adj_y = at_y + y; - - const radians = (Math.PI / 180) * at_angle, - cos = Math.cos(radians), - sin = Math.sin(radians), - nx = (cos * (adj_x - at_x)) + (sin * (adj_y - at_y)) + at_x, - ny = (cos * (adj_y - at_y)) - (sin * (adj_x - at_x)) + at_y; - - const point_str = `${nx.toFixed(3)} ${ny.toFixed(3)}`; - return point_str; - } - const gen_traces_row = (row_num) => { const traces = ` - (segment (start ${adjust_point((p.use_rectangular_jumpers ? 4.58 : 4.775), -12.7 + (row_num * 2.54))}) (end ${adjust_point(3.4, -12.7 + (row_num * 2.54))}) (width 0.25) (layer F.Cu) (net 1)) - (segment (start ${adjust_point((p.use_rectangular_jumpers ? -4.58 : -4.775), -12.7 + (row_num * 2.54))}) (end ${adjust_point(-3.4, -12.7 + (row_num * 2.54))}) (width 0.25) (layer F.Cu) (net 13)) + (segment (start ${p.eaxy((p.use_rectangular_jumpers ? 4.58 : 4.775), -12.7 + (row_num * 2.54))}) (end ${p.eaxy(3.4, -12.7 + (row_num * 2.54))}) (width 0.25) (layer F.Cu) (net 1)) + (segment (start ${p.eaxy((p.use_rectangular_jumpers ? -4.58 : -4.775), -12.7 + (row_num * 2.54))}) (end ${p.eaxy(-3.4, -12.7 + (row_num * 2.54))}) (width 0.25) (layer F.Cu) (net 13)) - (segment (start ${adjust_point(-7.62, -12.7 + (row_num * 2.54))}) (end ${adjust_point(-5.5, -12.7 + (row_num * 2.54))}) (width 0.25) (layer F.Cu) (net 23)) - (segment (start ${adjust_point(-7.62, -12.7 + (row_num * 2.54))}) (end ${adjust_point(-5.5, -12.7 + (row_num * 2.54))}) (width 0.25) (layer B.Cu) (net 23)) - (segment (start ${adjust_point(5.5, -12.7 + (row_num * 2.54))}) (end ${adjust_point(7.62, -12.7 + (row_num * 2.54))}) (width 0.25) (layer F.Cu) (net 24)) - (segment (start ${adjust_point(7.62, -12.7 + (row_num * 2.54))}) (end ${adjust_point(5.5, -12.7 + (row_num * 2.54))}) (width 0.25) (layer B.Cu) (net 24)) + (segment (start ${p.eaxy(-7.62, -12.7 + (row_num * 2.54))}) (end ${p.eaxy(-5.5, -12.7 + (row_num * 2.54))}) (width 0.25) (layer F.Cu) (net 23)) + (segment (start ${p.eaxy(-7.62, -12.7 + (row_num * 2.54))}) (end ${p.eaxy(-5.5, -12.7 + (row_num * 2.54))}) (width 0.25) (layer B.Cu) (net 23)) + (segment (start ${p.eaxy(5.5, -12.7 + (row_num * 2.54))}) (end ${p.eaxy(7.62, -12.7 + (row_num * 2.54))}) (width 0.25) (layer F.Cu) (net 24)) + (segment (start ${p.eaxy(7.62, -12.7 + (row_num * 2.54))}) (end ${p.eaxy(5.5, -12.7 + (row_num * 2.54))}) (width 0.25) (layer B.Cu) (net 24)) - (segment (start ${adjust_point(-2.604695, 0.23 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(3.17, 0.23 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) - (segment (start ${adjust_point(-4.775, 0 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(-4.425305, 0 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) - (segment (start ${adjust_point(-3.700305, 0.725 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(-3.099695, 0.725 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) - (segment (start ${adjust_point(-4.425305, 0 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(-3.700305, 0.725 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) - (segment (start ${adjust_point(-3.099695, 0.725 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(-2.604695, 0.23 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) - - (segment (start ${adjust_point(4.775, 0 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(4.425305, 0 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) - (segment (start ${adjust_point(2.594695, -0.22 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(-3.18, -0.22 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) - (segment (start ${adjust_point(4.425305, 0 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(3.700305, -0.725 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) - (segment (start ${adjust_point(3.700305, -0.725 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(3.099695, -0.725 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) - (segment (start ${adjust_point(3.099695, -0.725 + (row_num * 2.54) - 12.7)}) (end ${adjust_point(2.594695, -0.22 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) + (segment (start ${p.eaxy(-2.604695, 0.23 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(3.17, 0.23 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) + (segment (start ${p.eaxy(-4.775, 0 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(-4.425305, 0 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) + (segment (start ${p.eaxy(-3.700305, 0.725 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(-3.099695, 0.725 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) + (segment (start ${p.eaxy(-4.425305, 0 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(-3.700305, 0.725 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) + (segment (start ${p.eaxy(-3.099695, 0.725 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(-2.604695, 0.23 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 2)) + + (segment (start ${p.eaxy(4.775, 0 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(4.425305, 0 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) + (segment (start ${p.eaxy(2.594695, -0.22 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(-3.18, -0.22 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) + (segment (start ${p.eaxy(4.425305, 0 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(3.700305, -0.725 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) + (segment (start ${p.eaxy(3.700305, -0.725 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(3.099695, -0.725 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) + (segment (start ${p.eaxy(3.099695, -0.725 + (row_num * 2.54) - 12.7)}) (end ${p.eaxy(2.594695, -0.22 + (row_num * 2.54) - 12.7)}) (width 0.25) (layer "B.Cu") (net 20)) ` return traces @@ -281,36 +248,36 @@ module.exports = { let socket_row_base = ` ${''/* Socket Holes */} - (pad ${socket_hole_num_left} thru_hole circle (at -7.62 ${-12.7 + row_offset_y} ${p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? p.local_net(socket_hole_num_left).str : net_left}) - (pad ${socket_hole_num_right} thru_hole circle (at 7.62 ${-12.7 + row_offset_y} ${p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? p.local_net(socket_hole_num_right).str : net_right}) + (pad ${socket_hole_num_left} thru_hole circle (at -7.62 ${-12.7 + row_offset_y} ${p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? p.local_net(socket_hole_num_left).str : net_left}) + (pad ${socket_hole_num_right} thru_hole circle (at 7.62 ${-12.7 + row_offset_y} ${p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? p.local_net(socket_hole_num_right).str : net_right}) ` let socket_row_vias = ` ${''/* Inside VIAS */} - (pad ${via_num_right} thru_hole circle (at 3.4 ${-12.7 + row_offset_y} ${p.rot}) (size ${p.via_size} ${p.via_size}) (drill ${p.via_drill}) (layers *.Cu *.Mask) ${p.reverse_mount ? net_right : net_left}) - (pad ${via_num_left} thru_hole circle (at -3.4 ${-12.7 + row_offset_y} ${p.rot}) (size ${p.via_size} ${p.via_size}) (drill ${p.via_drill}) (layers *.Cu *.Mask) ${p.reverse_mount ? net_left : net_right}) + (pad ${via_num_right} thru_hole circle (at 3.4 ${-12.7 + row_offset_y} ${p.r}) (size ${p.via_size} ${p.via_size}) (drill ${p.via_drill}) (layers *.Cu *.Mask) ${p.reverse_mount ? net_right : net_left}) + (pad ${via_num_left} thru_hole circle (at -3.4 ${-12.7 + row_offset_y} ${p.r}) (size ${p.via_size} ${p.via_size}) (drill ${p.via_drill}) (layers *.Cu *.Mask) ${p.reverse_mount ? net_left : net_right}) ` let socket_row_rectangular_jumpers = ` ${''/* Jumper Pads - Front Left */} - (pad ${socket_hole_num_left} smd rect (at -5.48 ${-12.7 + row_offset_y} ${p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${p.local_net(socket_hole_num_left).str}) - (pad ${via_num_left} smd rect (at -4.58 ${-12.7 + row_offset_y} ${p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${p.reverse_mount ? net_left : net_right}) + (pad ${socket_hole_num_left} smd rect (at -5.48 ${-12.7 + row_offset_y} ${p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${p.local_net(socket_hole_num_left).str}) + (pad ${via_num_left} smd rect (at -4.58 ${-12.7 + row_offset_y} ${p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${p.reverse_mount ? net_left : net_right}) ${''/* Jumper Pads - Front Right */} - (pad ${via_num_right} smd rect (at 4.58 ${-12.7 + row_offset_y} ${p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${p.reverse_mount ? net_right : net_left}) - (pad ${socket_hole_num_left} smd rect (at 5.48 ${-12.7 + row_offset_y} ${p.rot}) (size 0.6 1.2) (layers F.Cu F.Mask) ${p.local_net(socket_hole_num_right).str}) + (pad ${via_num_right} smd rect (at 4.58 ${-12.7 + row_offset_y} ${p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${p.reverse_mount ? net_right : net_left}) + (pad ${socket_hole_num_left} smd rect (at 5.48 ${-12.7 + row_offset_y} ${p.r}) (size 0.6 1.2) (layers F.Cu F.Mask) ${p.local_net(socket_hole_num_right).str}) ${''/* Jumper Pads - Back Left */} - (pad ${socket_hole_num_left} smd rect (at -5.48 ${-12.7 + row_offset_y} ${p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${p.local_net(socket_hole_num_left).str}) - (pad ${via_num_right} smd rect (at -4.58 ${-12.7 + row_offset_y} ${p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${p.reverse_mount ? net_right : net_left}) + (pad ${socket_hole_num_left} smd rect (at -5.48 ${-12.7 + row_offset_y} ${p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${p.local_net(socket_hole_num_left).str}) + (pad ${via_num_right} smd rect (at -4.58 ${-12.7 + row_offset_y} ${p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${p.reverse_mount ? net_right : net_left}) ${''/* Jumper Pads - Back Right */} - (pad ${via_num_left} smd rect (at 4.58 ${-12.7 + row_offset_y} ${p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${p.reverse_mount ? net_left : net_right}) - (pad ${socket_hole_num_left} smd rect (at 5.48 ${-12.7 + row_offset_y} ${p.rot}) (size 0.6 1.2) (layers B.Cu B.Mask) ${p.local_net(socket_hole_num_right).str}) + (pad ${via_num_left} smd rect (at 4.58 ${-12.7 + row_offset_y} ${p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${p.reverse_mount ? net_left : net_right}) + (pad ${socket_hole_num_left} smd rect (at 5.48 ${-12.7 + row_offset_y} ${p.r}) (size 0.6 1.2) (layers B.Cu B.Mask) ${p.local_net(socket_hole_num_right).str}) ` let socket_row_chevron_jumpers = ` ${''/* Jumper Pads - Front Left */} - (pad ${socket_hole_num_left} smd custom (at -5.5 ${-12.7 + row_offset_y} ${p.rot}) (size 0.2 0.2) (layers F.Cu F.Mask) ${p.local_net(socket_hole_num_left).str} + (pad ${socket_hole_num_left} smd custom (at -5.5 ${-12.7 + row_offset_y} ${p.r}) (size 0.2 0.2) (layers F.Cu F.Mask) ${p.local_net(socket_hole_num_left).str} (zone_connect 2) (options (clearance outline) (anchor rect)) (primitives @@ -318,7 +285,7 @@ module.exports = { (xy -0.5 -0.625) (xy -0.25 -0.625) (xy 0.25 0) (xy -0.25 0.625) (xy -0.5 0.625) ) (width 0)) )) - (pad ${via_num_left} smd custom (at -4.775 ${-12.7 + row_offset_y} ${p.rot}) (size 0.2 0.2) (layers F.Cu F.Mask) ${p.reverse_mount ? net_left : net_right} + (pad ${via_num_left} smd custom (at -4.775 ${-12.7 + row_offset_y} ${p.r}) (size 0.2 0.2) (layers F.Cu F.Mask) ${p.reverse_mount ? net_left : net_right} (zone_connect 2) (options (clearance outline) (anchor rect)) (primitives @@ -328,7 +295,7 @@ module.exports = { )) ${''/* Jumper Pads - Front Right */} - (pad ${via_num_right} smd custom (at 4.775 ${-12.7 + row_offset_y} ${180 + p.rot}) (size 0.2 0.2) (layers F.Cu F.Mask) ${p.reverse_mount ? net_right : net_left} + (pad ${via_num_right} smd custom (at 4.775 ${-12.7 + row_offset_y} ${180 + p.r}) (size 0.2 0.2) (layers F.Cu F.Mask) ${p.reverse_mount ? net_right : net_left} (zone_connect 2) (options (clearance outline) (anchor rect)) (primitives @@ -336,7 +303,7 @@ module.exports = { (xy -0.65 -0.625) (xy 0.5 -0.625) (xy 0.5 0.625) (xy -0.65 0.625) (xy -0.15 0) ) (width 0)) )) - (pad ${socket_hole_num_right} smd custom (at 5.5 ${-12.7 + row_offset_y} ${180 + p.rot}) (size 0.2 0.2) (layers F.Cu F.Mask) ${p.local_net(socket_hole_num_right).str} + (pad ${socket_hole_num_right} smd custom (at 5.5 ${-12.7 + row_offset_y} ${180 + p.r}) (size 0.2 0.2) (layers F.Cu F.Mask) ${p.local_net(socket_hole_num_right).str} (zone_connect 2) (options (clearance outline) (anchor rect)) (primitives @@ -346,7 +313,7 @@ module.exports = { )) ${''/* Jumper Pads - Back Left */} - (pad ${socket_hole_num_left} smd custom (at -5.5 ${-12.7 + row_offset_y} ${p.rot}) (size 0.2 0.2) (layers B.Cu B.Mask) ${p.local_net(socket_hole_num_left).str} + (pad ${socket_hole_num_left} smd custom (at -5.5 ${-12.7 + row_offset_y} ${p.r}) (size 0.2 0.2) (layers B.Cu B.Mask) ${p.local_net(socket_hole_num_left).str} (zone_connect 2) (options (clearance outline) (anchor rect)) (primitives @@ -355,7 +322,7 @@ module.exports = { ) (width 0)) )) - (pad ${via_num_right} smd custom (at -4.775 ${-12.7 + row_offset_y} ${p.rot}) (size 0.2 0.2) (layers B.Cu B.Mask) ${p.reverse_mount ? net_right : net_left} + (pad ${via_num_right} smd custom (at -4.775 ${-12.7 + row_offset_y} ${p.r}) (size 0.2 0.2) (layers B.Cu B.Mask) ${p.reverse_mount ? net_right : net_left} (zone_connect 2) (options (clearance outline) (anchor rect)) (primitives @@ -365,7 +332,7 @@ module.exports = { )) ${''/* Jumper Pads - Back Right */} - (pad ${via_num_left} smd custom (at 4.775 ${-12.7 + row_offset_y} ${180 + p.rot}) (size 0.2 0.2) (layers B.Cu B.Mask) ${p.reverse_mount ? net_left : net_right} + (pad ${via_num_left} smd custom (at 4.775 ${-12.7 + row_offset_y} ${180 + p.r}) (size 0.2 0.2) (layers B.Cu B.Mask) ${p.reverse_mount ? net_left : net_right} (zone_connect 2) (options (clearance outline) (anchor rect)) (primitives @@ -373,7 +340,7 @@ module.exports = { (xy -0.65 0.625) (xy 0.5 0.625) (xy 0.5 -0.625) (xy -0.65 -0.625) (xy -0.15 0) ) (width 0)) )) - (pad ${socket_hole_num_right} smd custom (at 5.5 ${-12.7 + row_offset_y} ${180 + p.rot}) (size 0.2 0.2) (layers B.Cu B.Mask) ${p.local_net(socket_hole_num_right).str} + (pad ${socket_hole_num_right} smd custom (at 5.5 ${-12.7 + row_offset_y} ${180 + p.r}) (size 0.2 0.2) (layers B.Cu B.Mask) ${p.local_net(socket_hole_num_right).str} (zone_connect 2) (options (clearance outline) (anchor rect)) (primitives @@ -392,35 +359,35 @@ module.exports = { } } if (show_silk_labels == true) { - if(p.reversible || p.show_silk_labels_on_both_sides || p.side == 'F') { + if (p.reversible || p.show_silk_labels_on_both_sides || p.side == 'F') { // Silkscreen labels - front - if(row_num != 10 || (!p.include_extra_pins && p.reversible) || (invert_pins && !p.reversible)) { + if (row_num != 10 || (!p.include_extra_pins && p.reversible) || (invert_pins && !p.reversible)) { socket_row += ` - (fp_text user ${net_silk_front_left} (at -${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? 3 : 6} ${-12.7 + row_offset_y} ${p.rot}) (layer F.SilkS) + (fp_text user ${net_silk_front_left} (at -${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? 3 : 6} ${-12.7 + row_offset_y} ${p.r}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify left)) ) ` } - if(row_num != 10 || (!p.include_extra_pins && p.reversible) || (!invert_pins && !p.reversible)) { + if (row_num != 10 || (!p.include_extra_pins && p.reversible) || (!invert_pins && !p.reversible)) { socket_row += ` - (fp_text user ${net_silk_front_right} (at ${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? 3 : 6} ${-12.7 + row_offset_y} ${p.rot}) (layer F.SilkS) + (fp_text user ${net_silk_front_right} (at ${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? 3 : 6} ${-12.7 + row_offset_y} ${p.r}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify right)) ) ` } } - if(p.reversible && !p.include_extra_pins || p.show_silk_labels_on_both_sides || p.side == 'B') { + if (p.reversible && !p.include_extra_pins || p.show_silk_labels_on_both_sides || p.side == 'B') { // Silkscreen labels - back - if(!p.include_extra_pins && (p.reversible || row_num != 10 || invert_pins)) { + if (!p.include_extra_pins && (p.reversible || row_num != 10 || invert_pins)) { socket_row += ` - (fp_text user ${net_silk_back_left} (at -${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? 3 : 6} ${-12.7 + row_offset_y} ${180 + p.rot}) (layer B.SilkS) + (fp_text user ${net_silk_back_left} (at -${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? 3 : 6} ${-12.7 + row_offset_y} ${180 + p.r}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify right mirror)) ) ` } - if(!p.include_extra_pins && (p.reversible || row_num != 10 || !invert_pins)) { + if (!p.include_extra_pins && (p.reversible || row_num != 10 || !invert_pins)) { socket_row += ` - (fp_text user ${net_silk_back_right} (at ${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? 3 : 6} ${-12.7 + row_offset_y} ${180 + p.rot}) (layer B.SilkS) + (fp_text user ${net_silk_back_right} (at ${p.reversible && (row_num < 4 || !p.only_required_jumpers) ? 3 : 6} ${-12.7 + row_offset_y} ${180 + p.r}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify left mirror)) ) ` @@ -431,18 +398,18 @@ module.exports = { if (show_via_labels && (p.reversible && (row_num < 4 || !p.only_required_jumpers))) { socket_row += ` ${''/* Via Labels - Front */} - (fp_text user ${via_label_left} (at -3.262 ${-13.5 + row_offset_y} ${p.rot}) (layer F.Fab) + (fp_text user ${via_label_left} (at -3.262 ${-13.5 + row_offset_y} ${p.r}) (layer F.Fab) (effects (font (size 0.5 0.5) (thickness 0.08))) ) - (fp_text user ${via_label_right} (at 3.262 ${-13.5 + row_offset_y} ${p.rot}) (layer F.Fab) + (fp_text user ${via_label_right} (at 3.262 ${-13.5 + row_offset_y} ${p.r}) (layer F.Fab) (effects (font (size 0.5 0.5) (thickness 0.08))) ) ${''/* Via Labels - Back */} - (fp_text user ${via_label_left} (at -3.262 ${-13.5 + row_offset_y} ${180 + p.rot}) (layer B.Fab) + (fp_text user ${via_label_left} (at -3.262 ${-13.5 + row_offset_y} ${180 + p.r}) (layer B.Fab) (effects (font (size 0.5 0.5) (thickness 0.08)) (justify mirror)) ) - (fp_text user ${via_label_right} (at 3.262 ${-13.5 + row_offset_y} ${180 + p.rot}) (layer B.Fab) + (fp_text user ${via_label_right} (at 3.262 ${-13.5 + row_offset_y} ${180 + p.r}) (layer B.Fab) (effects (font (size 0.5 0.5) (thickness 0.08)) (justify mirror)) ) ` @@ -469,7 +436,7 @@ module.exports = { ['P8', 'P16'], ['P9', 'P10'], ] - + let socket_rows = ''; for (let i = 0; i < pin_names.length; i++) { pin_name_left = pin_names[i][invert_pins ? 1 : 0] @@ -485,7 +452,7 @@ module.exports = { // Socket silkscreen // P1 / D1 / P0.06 is marked according to orientation if (show_silk_labels == true) { - if(p.reversible || p.show_silk_labels_on_both_sides || p.side == 'F') { + if (p.reversible || p.show_silk_labels_on_both_sides || p.side == 'F') { socket_rows += ` (fp_line (start 6.29 -14.03) (end 8.95 -14.03) (layer F.SilkS) (width 0.12)) (fp_line (start 6.29 -14.03) (end 6.29 16.57) (layer F.SilkS) (width 0.12)) @@ -498,7 +465,7 @@ module.exports = { (fp_line (start ${invert_pins ? '' : '-'}6.29 -11.43) (end ${invert_pins ? '' : '-'}8.95 -11.43) (layer F.SilkS) (width 0.12)) ` } - if(p.reversible || p.show_silk_labels_on_both_sides || p.side == 'B') { + if (p.reversible || p.show_silk_labels_on_both_sides || p.side == 'B') { socket_rows += ` (fp_line (start -6.29 -14.03) (end -8.95 -14.03) (layer B.SilkS) (width 0.12)) (fp_line (start -6.29 -14.03) (end -6.29 16.57) (layer B.SilkS) (width 0.12)) @@ -519,7 +486,7 @@ module.exports = { (module "ceoloide:mcu_nice_nano" (layer F.Cu) (tedit 6451A4F1) (attr virtual) ${p.at /* parametric position */} - (fp_text reference "${p.ref}" (at 0 -15 ${p.rot}) (layer ${p.side}.SilkS) ${p.ref_hide} + (fp_text reference "${p.ref}" (at 0 -15 ${p.r}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15))) ) @@ -537,10 +504,10 @@ module.exports = { `; const instructions = ` - (fp_text user "Right Side Jumpers" (at 0 -15.245 ${p.rot}) (layer F.SilkS) + (fp_text user "Right Side Jumpers" (at 0 -15.245 ${p.r}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text user "Left Side Jumpers" (at 0 -15.245 ${p.rot}) (layer B.SilkS) + (fp_text user "Left Side Jumpers" (at 0 -15.245 ${p.r}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) ) ` @@ -551,13 +518,13 @@ module.exports = { const traces = gen_traces() const extra_pins = ` - (pad 25 thru_hole circle (at ${invert_pins ? '' : '-'}5.08 ${-12.7 + 25.4} ${p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P101}) - (pad 26 thru_hole circle (at ${invert_pins ? '' : '-'}2.54 ${-12.7 + 25.4} ${p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P102}) - (pad 27 thru_hole circle (at 0 ${-12.7 + 25.4} ${p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P107}) + (pad 25 thru_hole circle (at ${invert_pins ? '' : '-'}5.08 ${-12.7 + 25.4} ${p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P101}) + (pad 26 thru_hole circle (at ${invert_pins ? '' : '-'}2.54 ${-12.7 + 25.4} ${p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P102}) + (pad 27 thru_hole circle (at 0 ${-12.7 + 25.4} ${p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P107}) ` const extra_pins_reversible = ` - (pad 28 thru_hole circle (at ${invert_pins ? '-' : ''}5.08 ${-12.7 + 25.4} ${p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P101}) - (pad 29 thru_hole circle (at ${invert_pins ? '-' : ''}2.54 ${-12.7 + 25.4} ${p.rot}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P102}) + (pad 28 thru_hole circle (at ${invert_pins ? '-' : ''}5.08 ${-12.7 + 25.4} ${p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P101}) + (pad 29 thru_hole circle (at ${invert_pins ? '-' : ''}2.54 ${-12.7 + 25.4} ${p.r}) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) ${p.P102}) ` return ` diff --git a/mounting_hole_npth.js b/mounting_hole_npth.js index 7a81ef7..ede3fcc 100644 --- a/mounting_hole_npth.js +++ b/mounting_hole_npth.js @@ -29,8 +29,8 @@ module.exports = { body: p => ` (module "ceoloide:mounting_hole_npth" (layer ${p.side}.Cu) (tedit 5F1B9159) ${p.at /* parametric position */} - (fp_text reference "${p.ref}" (at 0 2.55 ${p.rot}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)))) - (pad "" np_thru_hole circle (at 0 0 ${p.rot}) (size ${p.hole_size} ${p.hole_size}) (drill ${p.hole_drill}) (layers *.Cu *.Mask)) + (fp_text reference "${p.ref}" (at 0 2.55 ${p.r}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)))) + (pad "" np_thru_hole circle (at 0 0 ${p.r}) (size ${p.hole_size} ${p.hole_size}) (drill ${p.hole_drill}) (layers *.Cu *.Mask)) ) ` } diff --git a/power_switch_smd_side.js b/power_switch_smd_side.js index eddfa8f..06f6894 100644 --- a/power_switch_smd_side.js +++ b/power_switch_smd_side.js @@ -60,18 +60,18 @@ module.exports = { (module "ceoloide:power_switch_smd_side" (layer ${p.side}.Cu) (tedit 64473C6F) ${p.at /* parametric position */} (attr smd) - (fp_text value "power_switch" (at 0 2.5 ${p.rot}) (layer ${p.side}.Fab) + (fp_text value "power_switch" (at 0 2.5 ${p.r}) (layer ${p.side}.Fab) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text reference "${p.ref}" (at -3.6 0 ${-90 + p.rot}) (layer F.SilkS) ${p.ref_hide} + (fp_text reference "${p.ref}" (at -3.6 0 ${-90 + p.r}) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15))) ) ` const silkscreen_front = ` - (fp_text user "ON" (at 0 ${p.invert_behavior ? '-' : ''}4.5 ${p.rot}) (layer "F.SilkS") + (fp_text user "ON" (at 0 ${p.invert_behavior ? '-' : ''}4.5 ${p.r}) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15)) (justify ${p.invert_behavior ? 'bottom' : 'top'})) ) - (fp_text user "OFF" (at 0 ${p.invert_behavior ? '' : '-'}4.5 ${p.rot}) (layer "F.SilkS") + (fp_text user "OFF" (at 0 ${p.invert_behavior ? '' : '-'}4.5 ${p.r}) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15)) (justify ${p.invert_behavior ? 'top' : 'bottom'})) ) (fp_line (start 0.415 -3.45) (end -0.375 -3.45) (layer F.SilkS) (width 0.12)) @@ -81,13 +81,13 @@ module.exports = { (fp_line (start -1.425 -1.4) (end -1.425 -1.6) (layer F.SilkS) (width 0.12)) ` const silkscreen_back = ` - (fp_text user "${p.ref}" (at -3.5 0 ${90 + p.rot}) (layer B.SilkS) ${p.ref_hide} + (fp_text user "${p.ref}" (at -3.5 0 ${90 + p.r}) (layer B.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) ) - (fp_text user "ON" (at 0 ${p.invert_behavior ? '-' : ''}4.5 ${p.rot}) (layer "B.SilkS") + (fp_text user "ON" (at 0 ${p.invert_behavior ? '-' : ''}4.5 ${p.r}) (layer "B.SilkS") (effects (font (size 1 1) (thickness 0.15)) (justify ${p.invert_behavior ? 'bottom' : 'top'} mirror)) ) - (fp_text user "OFF" (at 0 ${p.invert_behavior ? '' : '-'}4.5 ${p.rot}) (layer "B.SilkS") + (fp_text user "OFF" (at 0 ${p.invert_behavior ? '' : '-'}4.5 ${p.r}) (layer "B.SilkS") (effects (font (size 1 1) (thickness 0.15)) (justify ${p.invert_behavior ? 'top' : 'bottom'} mirror)) ) (fp_line (start -1.425 1.4) (end -1.425 1.6) (layer B.SilkS) (width 0.12)) @@ -128,13 +128,13 @@ module.exports = { (fp_line (start 2.845 1.2) (end 2.845 0.35) (layer F.Fab) (width 0.1)) (fp_line (start 2.645 1.4) (end 2.845 1.2) (layer F.Fab) (width 0.1)) (fp_line (start 1.345 1.4) (end 2.645 1.4) (layer F.Fab) (width 0.1)) - (pad "" smd rect (at 1.125 -3.65 ${90 + p.rot}) (size 1 0.8) (layers F.Cu F.Paste F.Mask)) - (pad "" smd rect (at -1.085 -3.65 ${90 + p.rot}) (size 1 0.8) (layers F.Cu F.Paste F.Mask)) - (pad "" smd rect (at -1.085 3.65 ${90 + p.rot}) (size 1 0.8) (layers F.Cu F.Paste F.Mask)) - (pad "" smd rect (at 1.125 3.65 ${90 + p.rot}) (size 1 0.8) (layers F.Cu F.Paste F.Mask)) - (pad 1 smd rect (at -1.735 2.25 ${90 + p.rot}) (size 0.7 1.5) (layers F.Cu F.Paste F.Mask) ${p.invert_behavior ? '' : p.from.str}) - (pad 2 smd rect (at -1.735 -0.75 ${90 + p.rot}) (size 0.7 1.5) (layers F.Cu F.Paste F.Mask) ${p.to.str}) - (pad 3 smd rect (at -1.735 -2.25 ${90 + p.rot}) (size 0.7 1.5) (layers F.Cu F.Paste F.Mask) ${p.invert_behavior ? p.from.str : ''}) + (pad "" smd rect (at 1.125 -3.65 ${90 + p.r}) (size 1 0.8) (layers F.Cu F.Paste F.Mask)) + (pad "" smd rect (at -1.085 -3.65 ${90 + p.r}) (size 1 0.8) (layers F.Cu F.Paste F.Mask)) + (pad "" smd rect (at -1.085 3.65 ${90 + p.r}) (size 1 0.8) (layers F.Cu F.Paste F.Mask)) + (pad "" smd rect (at 1.125 3.65 ${90 + p.r}) (size 1 0.8) (layers F.Cu F.Paste F.Mask)) + (pad 1 smd rect (at -1.735 2.25 ${90 + p.r}) (size 0.7 1.5) (layers F.Cu F.Paste F.Mask) ${p.invert_behavior ? '' : p.from.str}) + (pad 2 smd rect (at -1.735 -0.75 ${90 + p.r}) (size 0.7 1.5) (layers F.Cu F.Paste F.Mask) ${p.to.str}) + (pad 3 smd rect (at -1.735 -2.25 ${90 + p.r}) (size 0.7 1.5) (layers F.Cu F.Paste F.Mask) ${p.invert_behavior ? p.from.str : ''}) ` const pads_back = ` @@ -148,17 +148,17 @@ module.exports = { (fp_line (start 1.295 -3.35) (end 1.295 3.35) (layer B.Fab) (width 0.1)) (fp_line (start 1.295 3.35) (end -1.305 3.35) (layer B.Fab) (width 0.1)) (fp_line (start -1.305 -3.35) (end 1.295 -3.35) (layer B.Fab) (width 0.1)) - (pad "" smd rect (at -1.085 -3.65 ${270 + p.rot}) (size 1 0.8) (layers B.Cu B.Paste B.Mask)) - (pad "" smd rect (at 1.125 -3.65 ${270 + p.rot}) (size 1 0.8) (layers B.Cu B.Paste B.Mask)) - (pad "" smd rect (at -1.085 3.65 ${270 + p.rot}) (size 1 0.8) (layers B.Cu B.Paste B.Mask)) - (pad "" smd rect (at 1.125 3.65 ${270 + p.rot}) (size 1 0.8) (layers B.Cu B.Paste B.Mask)) - (pad 1 smd rect (at -1.735 -2.25 ${270 + p.rot}) (size 0.7 1.5) (layers B.Cu B.Paste B.Mask) ${p.invert_behavior ? p.from.str : ''}) - (pad 2 smd rect (at -1.735 0.75 ${270 + p.rot}) (size 0.7 1.5) (layers B.Cu B.Paste B.Mask) ${p.to.str}) - (pad 3 smd rect (at -1.735 2.25 ${270 + p.rot}) (size 0.7 1.5) (layers B.Cu B.Paste B.Mask) ${p.invert_behavior ? '' : p.from.str}) + (pad "" smd rect (at -1.085 -3.65 ${270 + p.r}) (size 1 0.8) (layers B.Cu B.Paste B.Mask)) + (pad "" smd rect (at 1.125 -3.65 ${270 + p.r}) (size 1 0.8) (layers B.Cu B.Paste B.Mask)) + (pad "" smd rect (at -1.085 3.65 ${270 + p.r}) (size 1 0.8) (layers B.Cu B.Paste B.Mask)) + (pad "" smd rect (at 1.125 3.65 ${270 + p.r}) (size 1 0.8) (layers B.Cu B.Paste B.Mask)) + (pad 1 smd rect (at -1.735 -2.25 ${270 + p.r}) (size 0.7 1.5) (layers B.Cu B.Paste B.Mask) ${p.invert_behavior ? p.from.str : ''}) + (pad 2 smd rect (at -1.735 0.75 ${270 + p.r}) (size 0.7 1.5) (layers B.Cu B.Paste B.Mask) ${p.to.str}) + (pad 3 smd rect (at -1.735 2.25 ${270 + p.r}) (size 0.7 1.5) (layers B.Cu B.Paste B.Mask) ${p.invert_behavior ? '' : p.from.str}) ` const common_end = ` - (pad "" np_thru_hole circle (at 0.025 -1.5 ${90 + p.rot}) (size 0.9 0.9) (drill 0.9) (layers *.Cu *.Mask)) - (pad "" np_thru_hole circle (at 0.025 1.5 ${90 + p.rot}) (size 0.9 0.9) (drill 0.9) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at 0.025 -1.5 ${90 + p.r}) (size 0.9 0.9) (drill 0.9) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at 0.025 1.5 ${90 + p.r}) (size 0.9 0.9) (drill 0.9) (layers *.Cu *.Mask)) ) ` diff --git a/reset_switch_smd_side.js b/reset_switch_smd_side.js index bf1070a..f840192 100644 --- a/reset_switch_smd_side.js +++ b/reset_switch_smd_side.js @@ -47,10 +47,10 @@ module.exports = { (module "ceoloide:reset_button_smd_side" (layer ${p.side}.Cu) (tedit 64473C6F) ${p.at /* parametric position */} (attr smd) - (fp_text value "reset_button_smd_side" (at 0 2.5 ${p.rot}) (layer ${p.side}.Fab) + (fp_text value "reset_button_smd_side" (at 0 2.5 ${p.r}) (layer ${p.side}.Fab) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text reference "${p.ref}" (at 0 0 ${p.rot}) (layer F.SilkS) ${p.ref_hide} + (fp_text reference "${p.ref}" (at 0 0 ${p.r}) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start -2.35 -1.75) (end -2.35 1.75) (width 0.1) (layer "Dwgs.User")) @@ -72,7 +72,7 @@ module.exports = { (fp_line (start 2.35 1.5) (end 2.35 1.75) (width 0.1) (layer "F.SilkS")) ` const silkscreen_back = ` - (fp_text reference "${p.ref}" (at 0 0 ${p.rot}) (layer B.SilkS) ${p.ref_hide} + (fp_text reference "${p.ref}" (at 0 0 ${p.r}) (layer B.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) ) (fp_line (start -2.35 -1.5) (end -2.35 -1.75) (width 0.1) (layer "B.SilkS")) @@ -85,16 +85,16 @@ module.exports = { (fp_line (start 2.35 1.5) (end 2.35 1.75) (width 0.1) (layer "B.SilkS")) ` const pads_front = ` - (pad "1" smd rect (at 2.625 -0.85 ${180 + p.rot}) (size 1.55 1) (layers "F.Cu" "F.Paste" "F.Mask") ${p.from.str}) - (pad "2" smd rect (at 2.625 0.85 ${180 + p.rot}) (size 1.55 1) (layers "F.Cu" "F.Paste" "F.Mask") ${p.to.str}) - (pad "3" smd rect (at -2.625 -0.85 ${180 + p.rot}) (size 1.55 1) (layers "F.Cu" "F.Paste" "F.Mask") ${p.from.str}) - (pad "4" smd rect (at -2.625 0.85 ${180 + p.rot}) (size 1.55 1) (layers "F.Cu" "F.Paste" "F.Mask") ${p.to.str}) + (pad "1" smd rect (at 2.625 -0.85 ${180 + p.r}) (size 1.55 1) (layers "F.Cu" "F.Paste" "F.Mask") ${p.from.str}) + (pad "2" smd rect (at 2.625 0.85 ${180 + p.r}) (size 1.55 1) (layers "F.Cu" "F.Paste" "F.Mask") ${p.to.str}) + (pad "3" smd rect (at -2.625 -0.85 ${180 + p.r}) (size 1.55 1) (layers "F.Cu" "F.Paste" "F.Mask") ${p.from.str}) + (pad "4" smd rect (at -2.625 0.85 ${180 + p.r}) (size 1.55 1) (layers "F.Cu" "F.Paste" "F.Mask") ${p.to.str}) ` const pads_back = ` - (pad "1" smd rect (at -2.625 -0.85 ${180 + p.rot}) (size 1.55 1) (layers "B.Cu" "B.Paste" "B.Mask") ${p.from.str}) - (pad "2" smd rect (at -2.625 0.85 ${180 + p.rot}) (size 1.55 1) (layers "B.Cu" "B.Paste" "B.Mask") ${p.to.str}) - (pad "3" smd rect (at 2.625 -0.85 ${180 + p.rot}) (size 1.55 1) (layers "B.Cu" "B.Paste" "B.Mask") ${p.from.str}) - (pad "4" smd rect (at 2.625 0.85 ${180 + p.rot}) (size 1.55 1) (layers "B.Cu" "B.Paste" "B.Mask") ${p.to.str}) + (pad "1" smd rect (at -2.625 -0.85 ${180 + p.r}) (size 1.55 1) (layers "B.Cu" "B.Paste" "B.Mask") ${p.from.str}) + (pad "2" smd rect (at -2.625 0.85 ${180 + p.r}) (size 1.55 1) (layers "B.Cu" "B.Paste" "B.Mask") ${p.to.str}) + (pad "3" smd rect (at 2.625 -0.85 ${180 + p.r}) (size 1.55 1) (layers "B.Cu" "B.Paste" "B.Mask") ${p.from.str}) + (pad "4" smd rect (at 2.625 0.85 ${180 + p.r}) (size 1.55 1) (layers "B.Cu" "B.Paste" "B.Mask") ${p.to.str}) ` const courtyard_front = ` (fp_line (start -2.36 -1.75) (end -2.36 1.75) (width 0.05) (layer "F.CrtYd")) @@ -109,8 +109,8 @@ module.exports = { (fp_line (start 2.36 -1.75) (end 2.36 1.75) (width 0.05) (layer "B.CrtYd")) ` const bosses = ` - (pad "" np_thru_hole circle (at 0 -1.375 ${180 + p.rot}) (size 0.75 0.75) (drill 0.75) (layers "*.Cu" "*.Mask")) - (pad "" np_thru_hole circle (at 0 1.375 ${180 + p.rot}) (size 0.75 0.75) (drill 0.75) (layers "*.Cu" "*.Mask")) + (pad "" np_thru_hole circle (at 0 -1.375 ${180 + p.r}) (size 0.75 0.75) (drill 0.75) (layers "*.Cu" "*.Mask")) + (pad "" np_thru_hole circle (at 0 1.375 ${180 + p.r}) (size 0.75 0.75) (drill 0.75) (layers "*.Cu" "*.Mask")) ` const common_end = ` ) diff --git a/reset_switch_tht_top.js b/reset_switch_tht_top.js index eef8127..9ce40fd 100644 --- a/reset_switch_tht_top.js +++ b/reset_switch_tht_top.js @@ -36,11 +36,11 @@ module.exports = { const common_start = ` (module "ceoloide:reset_switch_tht_top" (layer ${p.side}.Cu) (tedit 5B9559E6) (tstamp 61905781) ${p.at /* parametric position */} - (fp_text value "reset_switch_tht_top" (at 0 -2.55 ${90 + p.rot}) (layer ${p.side}.Fab) (effects (font (size 1 1) (thickness 0.15)))) - (fp_text reference "${p.ref}" (at 0 2.55 ${90 + p.rot}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)))) + (fp_text value "reset_switch_tht_top" (at 0 -2.55 ${90 + p.r}) (layer ${p.side}.Fab) (effects (font (size 1 1) (thickness 0.15)))) + (fp_text reference "${p.ref}" (at 0 2.55 ${90 + p.r}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)))) ` const silkscreen_front = ` - (fp_text user "RST" (at 0 0 ${p.rot}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15)))) + (fp_text user "RST" (at 0 0 ${p.r}) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15)))) (fp_line (start -3 1.75) (end 3 1.75) (layer F.SilkS) (width 0.15)) (fp_line (start 3 1.75) (end 3 1.5) (layer F.SilkS) (width 0.15)) (fp_line (start -3 1.75) (end -3 1.5) (layer F.SilkS) (width 0.15)) @@ -49,7 +49,7 @@ module.exports = { (fp_line (start 3 -1.75) (end 3 -1.5) (layer F.SilkS) (width 0.15)) ` const silkscreen_back = ` - (fp_text user "RST" (at 0 0 ${p.rot}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify mirror))) + (fp_text user "RST" (at 0 0 ${p.r}) (layer B.SilkS) (effects (font (size 1 1) (thickness 0.15)) (justify mirror))) (fp_line (start 3 1.5) (end 3 1.75) (layer B.SilkS) (width 0.15)) (fp_line (start 3 1.75) (end -3 1.75) (layer B.SilkS) (width 0.15)) (fp_line (start -3 1.75) (end -3 1.5) (layer B.SilkS) (width 0.15)) @@ -58,8 +58,8 @@ module.exports = { (fp_line (start 3 -1.75) (end 3 -1.5) (layer B.SilkS) (width 0.15)) ` const common_end = ` - (pad 2 thru_hole circle (at -3.25 0 ${p.rot}) (size 2 2) (drill 1.3) (layers *.Cu *.Mask) ${p.from.str}) - (pad 1 thru_hole circle (at 3.25 0 ${p.rot}) (size 2 2) (drill 1.3) (layers *.Cu *.Mask) ${p.to.str}) + (pad 2 thru_hole circle (at -3.25 0 ${p.r}) (size 2 2) (drill 1.3) (layers *.Cu *.Mask) ${p.from.str}) + (pad 1 thru_hole circle (at 3.25 0 ${p.r}) (size 2 2) (drill 1.3) (layers *.Cu *.Mask) ${p.to.str}) ) ` diff --git a/switch_choc_v1_v2.js b/switch_choc_v1_v2.js index b21a14c..5bfdc92 100644 --- a/switch_choc_v1_v2.js +++ b/switch_choc_v1_v2.js @@ -142,16 +142,16 @@ module.exports = { (attr virtual) ${'' /* footprint reference */} - (fp_text reference "${p.ref}" (at 0 0 ${p.rot}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1.27 1.27) (thickness 0.15)))) + (fp_text reference "${p.ref}" (at 0 0 ${p.r}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1.27 1.27) (thickness 0.15)))) ${''/* middle shaft hole */} - (pad "" np_thru_hole circle (at 0 0 ${p.rot}) (size ${p.choc_v2_support ? '5' : '3.4'} ${p.choc_v2_support ? '5' : '3.4'}) + (pad "" np_thru_hole circle (at 0 0 ${p.r}) (size ${p.choc_v2_support ? '5' : '3.4'} ${p.choc_v2_support ? '5' : '3.4'}) (drill ${p.choc_v2_support ? '5' : '3.4'}) (layers *.Cu)) ` const choc_v1_stabilizers = ` - (pad "" np_thru_hole circle (at 5.5 0 ${p.rot}) (size 1.9 1.9) (drill 1.9) (layers *.Cu)) - (pad "" np_thru_hole circle (at -5.5 0 ${p.rot}) (size 1.9 1.9) (drill 1.9) (layers *.Cu)) + (pad "" np_thru_hole circle (at 5.5 0 ${p.r}) (size 1.9 1.9) (drill 1.9) (layers *.Cu)) + (pad "" np_thru_hole circle (at -5.5 0 ${p.r}) (size 1.9 1.9) (drill 1.9) (layers *.Cu)) ` const corner_marks_front = ` @@ -190,11 +190,11 @@ module.exports = { const hotswap_common = ` ${'' /* Middle Hole */} - (pad "" np_thru_hole circle (at 0 -5.95 ${p.rot}) (size 3 3) (drill 3) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at 0 -5.95 ${p.r}) (size 3 3) (drill 3) (layers *.Cu *.Mask)) ` const hotswap_front_pad_cutoff = ` - (pad 1 connect custom (at 3.275 -5.95 ${p.rot}) (size 0.5 0.5) (layers F.Cu F.Paste F.Mask) + (pad 1 connect custom (at 3.275 -5.95 ${p.r}) (size 0.5 0.5) (layers F.Cu F.Paste F.Mask) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -205,11 +205,11 @@ module.exports = { ` const hotswap_front_pad_full = ` - (pad 1 smd rect (at 3.275 -5.95 ${p.rot}) (size 2.6 2.6) (layers F.Cu F.Paste F.Mask) ${p.from.str}) + (pad 1 smd rect (at 3.275 -5.95 ${p.r}) (size 2.6 2.6) (layers F.Cu F.Paste F.Mask) ${p.from.str}) ` const hotswap_back_pad_cutoff = ` - (pad 1 smd custom (at -3.275 -5.95 ${p.rot}) (size 1 1) (layers B.Cu B.Paste B.Mask) + (pad 1 smd custom (at -3.275 -5.95 ${p.r}) (size 1 1) (layers B.Cu B.Paste B.Mask) (zone_connect 0) (options (clearance outline) (anchor rect)) (primitives @@ -220,7 +220,7 @@ module.exports = { ` const hotswap_back_pad_full = ` - (pad 1 smd rect (at -3.275 -5.95 ${p.rot}) (size 2.6 2.6) (layers B.Cu B.Paste B.Mask) ${p.from.str}) + (pad 1 smd rect (at -3.275 -5.95 ${p.r}) (size 2.6 2.6) (layers B.Cu B.Paste B.Mask) ${p.from.str}) ` const hotswap_back = ` @@ -269,10 +269,10 @@ module.exports = { ${p.reversible ? hotswap_back_pad_cutoff : hotswap_back_pad_full} ${'' /* Right Pad (not cut off) */} - (pad 2 smd rect (at ${8.275 - (2.6 - p.outer_pad_width_back) / 2} -3.75 ${p.rot}) (size ${p.outer_pad_width_back} 2.6) (layers B.Cu B.Paste B.Mask) ${p.to.str}) + (pad 2 smd rect (at ${8.275 - (2.6 - p.outer_pad_width_back) / 2} -3.75 ${p.r}) (size ${p.outer_pad_width_back} 2.6) (layers B.Cu B.Paste B.Mask) ${p.to.str}) ${'' /* Side Hole */} - (pad "" np_thru_hole circle (at 5 -3.75 ${195 + p.rot}) (size 3 3) (drill 3) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at 5 -3.75 ${195 + p.r}) (size 3 3) (drill 3) (layers *.Cu *.Mask)) ` const hotswap_front = ` @@ -321,10 +321,10 @@ module.exports = { ${p.reversible ? hotswap_front_pad_cutoff : hotswap_front_pad_full} ${'' /* Left Pad (not cut off) */} - (pad 2 smd rect (at ${-8.275 + (2.6 - p.outer_pad_width_front) / 2} -3.75 ${p.rot}) (size ${p.outer_pad_width_front} 2.6) (layers F.Cu F.Paste F.Mask) ${p.to.str}) + (pad 2 smd rect (at ${-8.275 + (2.6 - p.outer_pad_width_front) / 2} -3.75 ${p.r}) (size ${p.outer_pad_width_front} 2.6) (layers F.Cu F.Paste F.Mask) ${p.to.str}) ${'' /* Side Hole */} - (pad "" np_thru_hole circle (at -5 -3.75 ${195 + p.rot}) (size 3 3) (drill 3) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at -5 -3.75 ${195 + p.r}) (size 3 3) (drill 3) (layers *.Cu *.Mask)) ` // If both hotswap and solder are enabled, move the solder holes @@ -346,26 +346,26 @@ module.exports = { stab_offset_y = '' } const solder_common = ` - (pad 2 thru_hole circle (at 0 ${solder_offset_y}5.9 ${195 + p.rot}) (size 2.032 2.032) (drill 1.27) (layers *.Cu *.Mask) ${p.from.str}) + (pad 2 thru_hole circle (at 0 ${solder_offset_y}5.9 ${195 + p.r}) (size 2.032 2.032) (drill 1.27) (layers *.Cu *.Mask) ${p.from.str}) ` const solder_front = ` - (pad 1 thru_hole circle (at ${solder_offset_x_front}5 ${solder_offset_y}3.8 ${195 + p.rot}) (size 2.032 2.032) (drill 1.27) (layers *.Cu *.Mask) ${p.to.str}) + (pad 1 thru_hole circle (at ${solder_offset_x_front}5 ${solder_offset_y}3.8 ${195 + p.r}) (size 2.032 2.032) (drill 1.27) (layers *.Cu *.Mask) ${p.to.str}) ` const solder_back = ` - (pad 1 thru_hole circle (at ${solder_offset_x_back}5 ${solder_offset_y}3.8 ${195 + p.rot}) (size 2.032 2.032) (drill 1.27) (layers *.Cu *.Mask) ${p.to.str}) + (pad 1 thru_hole circle (at ${solder_offset_x_back}5 ${solder_offset_y}3.8 ${195 + p.r}) (size 2.032 2.032) (drill 1.27) (layers *.Cu *.Mask) ${p.to.str}) ` const oval_corner_stab_front = ` - (pad "" thru_hole oval (at ${stab_offset_x_front}5 ${stab_offset_y}5.15 ${p.rot}) (size 2.4 1.2) (drill oval 1.6 0.4) (layers *.Cu *.Mask) ${p.solder && p.hotswap ? p.to.str : ''}) + (pad "" thru_hole oval (at ${stab_offset_x_front}5 ${stab_offset_y}5.15 ${p.r}) (size 2.4 1.2) (drill oval 1.6 0.4) (layers *.Cu *.Mask) ${p.solder && p.hotswap ? p.to.str : ''}) ` const oval_corner_stab_back = ` - (pad "" thru_hole oval (at ${stab_offset_x_back}5 ${stab_offset_y}5.15 ${p.rot}) (size 2.4 1.2) (drill oval 1.6 0.4) (layers *.Cu *.Mask) ${p.solder && p.hotswap ? p.to.str : ''}) + (pad "" thru_hole oval (at ${stab_offset_x_back}5 ${stab_offset_y}5.15 ${p.r}) (size 2.4 1.2) (drill oval 1.6 0.4) (layers *.Cu *.Mask) ${p.solder && p.hotswap ? p.to.str : ''}) ` const round_corner_stab_front = ` - (pad "" np_thru_hole circle (at ${stab_offset_x_front}5.00 ${stab_offset_y}5.15 ${p.rot}) (size 1.6 1.6) (drill 1.6) (layers *.Cu *.Mask) ${p.solder && p.hotswap ? p.to.str : ''}) + (pad "" np_thru_hole circle (at ${stab_offset_x_front}5.00 ${stab_offset_y}5.15 ${p.r}) (size 1.6 1.6) (drill 1.6) (layers *.Cu *.Mask) ${p.solder && p.hotswap ? p.to.str : ''}) ` const round_corner_stab_back = ` - (pad "" np_thru_hole circle (at ${stab_offset_x_back}5.00 ${stab_offset_y}5.15 ${p.rot}) (size 1.6 1.6) (drill 1.6) (layers *.Cu *.Mask) ${p.solder && p.hotswap ? p.to.str : ''}) + (pad "" np_thru_hole circle (at ${stab_offset_x_back}5.00 ${stab_offset_y}5.15 ${p.r}) (size 1.6 1.6) (drill 1.6) (layers *.Cu *.Mask) ${p.solder && p.hotswap ? p.to.str : ''}) ` const switch_3dmodel = ` (model ${p.switch_3dmodel_filename} @@ -374,7 +374,7 @@ module.exports = { (rotate (xyz ${p.switch_3dmodel_xyz_rotation[0]} ${p.switch_3dmodel_xyz_rotation[1]} ${p.switch_3dmodel_xyz_rotation[2]}))) ` - const hotswap_3dmodel = ` + const hotswap_3dmodel = ` (model ${p.hotswap_3dmodel_filename} (offset (xyz ${p.hotswap_3dmodel_xyz_offset[0]} ${p.hotswap_3dmodel_xyz_offset[1]} ${p.hotswap_3dmodel_xyz_offset[2]})) (scale (xyz ${p.hotswap_3dmodel_xyz_scale[0]} ${p.hotswap_3dmodel_xyz_scale[1]} ${p.hotswap_3dmodel_xyz_scale[2]})) diff --git a/trrs_pj320a.js b/trrs_pj320a.js index 18b3aac..467eb35 100644 --- a/trrs_pj320a.js +++ b/trrs_pj320a.js @@ -86,11 +86,11 @@ module.exports = { const standard_opening = ` (module "ceoloide:${footprint_name}" (layer ${p.side}.Cu) (tedit 5970F8E5) - ${p.at /* parametric position */} + ${p.at} - ${'' /* footprint reference */} - (fp_text reference "${p.ref}" (at 0 14.2 ${p.rot}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.153)))) - (fp_text value TRRS-PJ-320A-dual (at 0 -5.6 ${p.rot}) (layer ${p.side}.Fab) (effects (font (size 1 1) (thickness 0.153)))) + ${''} + (fp_text reference "${p.ref}" (at 0 14.2 ${p.r}) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.153)))) + (fp_text value TRRS-PJ-320A-dual (at 0 -5.6 ${p.r}) (layer ${p.side}.Fab) (effects (font (size 1 1) (thickness 0.153)))) ` function corner_marks(offset_x) { return ` @@ -106,23 +106,23 @@ module.exports = { } function stabilizers(def_pos) { return ` - (pad "" np_thru_hole circle (at ${def_pos} 8.6 ${p.rot}) (size 1.5 1.5) (drill 1.5) (layers *.Cu *.Mask)) - (pad "" np_thru_hole circle (at ${def_pos} 1.6 ${p.rot}) (size 1.5 1.5) (drill 1.5) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at ${def_pos} 8.6 ${p.r}) (size 1.5 1.5) (drill 1.5) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at ${def_pos} 1.6 ${p.r}) (size 1.5 1.5) (drill 1.5) (layers *.Cu *.Mask)) ` } function pins(def_neg, def_pos) { if (p.symmetric && p.reversible) { return ` - (pad 2 thru_hole oval (at ${def_pos} 3.2 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.SL.str}) - (pad 3 thru_hole oval (at ${def_pos} 6.2 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.R2.str}) - (pad 4 thru_hole oval (at ${def_pos} 10.75 ${p.rot}) (size 1.6 3.3) (drill oval 0.9 2.6) (layers *.Cu *.Mask) ${p.TP.str}) + (pad 2 thru_hole oval (at ${def_pos} 3.2 ${p.r}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.SL.str}) + (pad 3 thru_hole oval (at ${def_pos} 6.2 ${p.r}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.R2.str}) + (pad 4 thru_hole oval (at ${def_pos} 10.75 ${p.r}) (size 1.6 3.3) (drill oval 0.9 2.6) (layers *.Cu *.Mask) ${p.TP.str}) ` } else { return ` - (pad 2 thru_hole oval (at ${def_pos} 3.2 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.SL.str}) - (pad 3 thru_hole oval (at ${def_pos} 6.2 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.R2.str}) - (pad 4 thru_hole oval (at ${def_pos} 10.2 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.TP.str}) - (pad 5 thru_hole oval (at ${def_neg} 11.3 ${p.rot}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.R1.str}) + (pad 2 thru_hole oval (at ${def_pos} 3.2 ${p.r}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.SL.str}) + (pad 3 thru_hole oval (at ${def_pos} 6.2 ${p.r}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.R2.str}) + (pad 4 thru_hole oval (at ${def_pos} 10.2 ${p.r}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.TP.str}) + (pad 5 thru_hole oval (at ${def_neg} 11.3 ${p.r}) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) ${p.R1.str}) ` } } diff --git a/utility_ergogen_logo.js b/utility_ergogen_logo.js index 299a7f4..55a4596 100644 --- a/utility_ergogen_logo.js +++ b/utility_ergogen_logo.js @@ -67,9 +67,9 @@ module.exports = { } const common_top = ` (module "ceoloide:ergogen_logo" (layer "${p.side}.Cu") - ${p.at /* parametric position */} + ${p.at} (attr virtual) - (fp_text reference "${p.ref}" (at ${p.scale * 4.572} 0 ${p.rot}) (layer "${p.side}.Fab") ${p.ref_hide} + (fp_text reference "${p.ref}" (at ${p.scale * 4.572} 0 ${p.r}) (layer "${p.side}.Fab") ${p.ref_hide} (effects (font (size 1 1) (thickness 0.1))) ) ` diff --git a/utility_filled_zone.js b/utility_filled_zone.js index 547e486..9f56550 100644 --- a/utility_filled_zone.js +++ b/utility_filled_zone.js @@ -91,7 +91,7 @@ module.exports = { hatch_orientation: 0, hatch_smoothing_level: 0, hatch_smoothing_value: 0.1, - points: [[0,0],[420,0],[420,297],[0,297]], + points: [[0, 0], [420, 0], [420, 297], [0, 297]], }, body: p => { let polygon_pts = ''