Change parameter from `reverse` to `reversible`

This commit is contained in:
Marco Massarelli 2024-01-24 21:24:02 +00:00
parent 8fc281e621
commit ef2c20ee0d
1 changed files with 14 additions and 13 deletions

View File

@ -9,8 +9,9 @@
// to: corresponds to pin 2 // to: corresponds to pin 2
// //
// Params // Params
// reverse: default is false // reversible: default is false
// if true, will flip the footprint such that the pcb can be reversible // if true, the footprint will be placed on both sides so that the PCB can be
// reversible
// side: default is B for Back // side: default is B for Back
// the side on which to place the single-side footprint and designator // the side on which to place the single-side footprint and designator
// hotswap: default is true // hotswap: default is true
@ -67,7 +68,7 @@ module.exports = {
params: { params: {
designator: 'S', designator: 'S',
side: 'B', side: 'B',
reverse: false, reversible: false,
hotswap: true, hotswap: true,
solder: false, solder: false,
outer_pad_width_front: 2.6, outer_pad_width_front: 2.6,
@ -188,7 +189,7 @@ module.exports = {
(fp_arc (start 0.97 -2.17) (end 2.5 -2.17) (angle -90) (layer B.SilkS) (width 0.15)) (fp_arc (start 0.97 -2.17) (end 2.5 -2.17) (angle -90) (layer B.SilkS) (width 0.15))
${'' /* Left Pad*/} ${'' /* Left Pad*/}
${p.reverse ? hotswap_back_pad_cutoff : hotswap_back_pad_full} ${p.reversible ? hotswap_back_pad_cutoff : hotswap_back_pad_full}
${'' /* Right Pad (not cut off) */} ${'' /* 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.rot}) (size ${p.outer_pad_width_back} 2.6) (layers B.Cu B.Paste B.Mask) ${p.to.str})
@ -214,7 +215,7 @@ module.exports = {
(fp_arc (start -2.55 -6.75) (end -2.52 -6.2) (angle -90) (layer F.SilkS) (width 0.15)) (fp_arc (start -2.55 -6.75) (end -2.52 -6.2) (angle -90) (layer F.SilkS) (width 0.15))
${'' /* Right Pad (cut off) */} ${'' /* Right Pad (cut off) */}
${p.reverse ? hotswap_front_pad_cutoff : hotswap_front_pad_full} ${p.reversible ? hotswap_front_pad_cutoff : hotswap_front_pad_full}
${'' /* Left Pad (not cut off) */} ${'' /* 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.rot}) (size ${p.outer_pad_width_front} 2.6) (layers F.Cu F.Paste F.Mask) ${p.to.str})
@ -273,10 +274,10 @@ module.exports = {
final += choc_v1_stabilizers final += choc_v1_stabilizers
} }
if(p.show_corner_marks){ if(p.show_corner_marks){
if(p.reverse || p.side == "F"){ if(p.reversible || p.side == "F"){
final += corner_marks_front final += corner_marks_front
} }
if(p.reverse || p.side == "B"){ if(p.reversible || p.side == "B"){
final += corner_marks_back final += corner_marks_back
} }
} }
@ -284,14 +285,14 @@ module.exports = {
final += keycap_marks final += keycap_marks
} }
if(p.include_stabilizer_pad && p.choc_v2_support){ if(p.include_stabilizer_pad && p.choc_v2_support){
if(p.reverse || p.side == "F"){ if(p.reversible || p.side == "F"){
if(p.oval_stabilizer_pad){ if(p.oval_stabilizer_pad){
final += oval_corner_stab_front final += oval_corner_stab_front
} else { } else {
final += round_corner_stab_front final += round_corner_stab_front
} }
} }
if(p.reverse || p.side == "B"){ if(p.reversible || p.side == "B"){
if(p.oval_stabilizer_pad){ if(p.oval_stabilizer_pad){
final += oval_corner_stab_back final += oval_corner_stab_back
} else { } else {
@ -301,19 +302,19 @@ module.exports = {
} }
if(p.hotswap){ if(p.hotswap){
final += hotswap_common final += hotswap_common
if(p.reverse || p.side == "F"){ if(p.reversible || p.side == "F"){
final += hotswap_front final += hotswap_front
} }
if(p.reverse || p.side == "B"){ if(p.reversible || p.side == "B"){
final += hotswap_back final += hotswap_back
} }
} }
if(p.solder){ if(p.solder){
final += solder_common final += solder_common
if(p.reverse || p.side == "F"){ if(p.reversible || p.side == "F"){
final += solder_front final += solder_front
} }
if(p.reverse || p.side == "B"){ if(p.reversible || p.side == "B"){
final += solder_back final += solder_back
} }
} }