diff --git a/electronics_lib/LedMatrix.py b/electronics_lib/LedMatrix.py index 9c00b8b90..3fc54197f 100644 --- a/electronics_lib/LedMatrix.py +++ b/electronics_lib/LedMatrix.py @@ -51,9 +51,9 @@ def _svgpcb_template(self) -> str: for (let xIndex=0; xIndex < kXCount; xIndex++) {{ ledPos = [xy[0] + colSpacing * xIndex, xy[1] + rowSpacing * yIndex] - obj.footprints[`d[${{yIndex}}_${{xIndex}}]`] = led = board.add({led_footprint}, {{ + obj.footprints[`led[${{yIndex}}_${{xIndex}}]`] = led = board.add({led_footprint}, {{ translate: ledPos, - id: `{self._svgpcb_pathname()}_d[${{yIndex}}_${{xIndex}}]` + id: `{self._svgpcb_pathname()}_led_${{yIndex}}_${{xIndex}}_` }}) rowLeds.push(led) @@ -98,9 +98,9 @@ def _svgpcb_template(self) -> str: allResistors = [] for (let xIndex=0; xIndex < kXCount; xIndex++) {{ const resPos = [xy[0] + colSpacing * xIndex, xy[1] + rowSpacing * kYCount] - obj.footprints[`r[${{xIndex + 1}}]`] = res = board.add({res_footprint}, {{ + obj.footprints[`res[${{xIndex + 1}}]`] = res = board.add({res_footprint}, {{ translate: resPos, - id: `{self._svgpcb_pathname()}_r[${{xIndex + 1}}]` + id: `{self._svgpcb_pathname()}_res_${{xIndex + 1}}_` }}) allResistors.push(res) diff --git a/electronics_lib/Neopixel.py b/electronics_lib/Neopixel.py index cb2269beb..218c3f56e 100644 --- a/electronics_lib/Neopixel.py +++ b/electronics_lib/Neopixel.py @@ -272,7 +272,7 @@ def _svgpcb_template(self) -> str: obj.footprints[`led[${{i}}]`] = led = board.add({led_footprint}, {{ translate: origin, rotate: angle + rot, - id: `{self._svgpcb_pathname()}_led[${{i}}]` + id: `{self._svgpcb_pathname()}_led_${{i}}_` }}) const gndOrigin = pAdd(xy, vRotate([radius - powerRadiusOffset, 0], angle)) diff --git a/electronics_lib/SwitchMatrix.py b/electronics_lib/SwitchMatrix.py index 4f0fc85a1..fba98b39f 100644 --- a/electronics_lib/SwitchMatrix.py +++ b/electronics_lib/SwitchMatrix.py @@ -55,19 +55,19 @@ def _svgpcb_template(self) -> str: index = yIndex * ncols + xIndex + 1 buttonPos = [xy[0] + colSpacing * xIndex, xy[1] + rowSpacing * yIndex] - obj.footprints[`sw[${{xIndex}}][${{yIndex}}]`] = button = board.add( + obj.footprints[`sw[${{xIndex}},${{yIndex}}]`] = button = board.add( {switch_footprint}, {{ translate: buttonPos, rotate: 0, - id: `{self._svgpcb_pathname()}_sw[${{xIndex}}][${{yIndex}}]` + id: `{self._svgpcb_pathname()}_sw_${{xIndex}}_${{yIndex}}_` }}) diodePos = [buttonPos[0] + diodeOffset[0], buttonPos[1] + diodeOffset[1]] - obj[`d[${{xIndex}}][${{yIndex}}]`] = diode = board.add( + obj[`d[${{xIndex}},${{yIndex}}]`] = diode = board.add( {diode_footprint}, {{ translate: diodePos, rotate: 90, - id: `{self._svgpcb_pathname()}_d[${{xIndex}}][${{yIndex}}]` + id: `{self._svgpcb_pathname()}_d_${{xIndex}}_${{yIndex}}_` }}) // create stub wire for button -> column common line diff --git a/examples/BasicKeyboard/BasicKeyboard.svgpcb.js b/examples/BasicKeyboard/BasicKeyboard.svgpcb.js index 1dc93e8a5..1e6cf4278 100644 --- a/examples/BasicKeyboard/BasicKeyboard.svgpcb.js +++ b/examples/BasicKeyboard/BasicKeyboard.svgpcb.js @@ -23,19 +23,19 @@ function SwitchMatrix_2_3_sw(xy, colSpacing=1, rowSpacing=1, diodeOffset=[0.25, index = yIndex * ncols + xIndex + 1 buttonPos = [xy[0] + colSpacing * xIndex, xy[1] + rowSpacing * yIndex] - obj.footprints[`sw[${xIndex}][${yIndex}]`] = button = board.add( + obj.footprints[`sw[${xIndex},${yIndex}]`] = button = board.add( SW_Hotswap_Kailh_MX, { translate: buttonPos, rotate: 0, - id: `sw_sw[${xIndex}][${yIndex}]` + id: `sw_sw_${xIndex}_${yIndex}_` }) diodePos = [buttonPos[0] + diodeOffset[0], buttonPos[1] + diodeOffset[1]] - obj[`d[${xIndex}][${yIndex}]`] = diode = board.add( + obj[`d[${xIndex},${yIndex}]`] = diode = board.add( D_SMA, { translate: diodePos, rotate: 90, - id: `sw_d[${xIndex}][${yIndex}]` + id: `sw_d_${xIndex}_${yIndex}_` }) // create stub wire for button -> column common line diff --git a/examples/IotKnob/IotKnob.svgpcb.js b/examples/IotKnob/IotKnob.svgpcb.js index ef5553736..5cfa0f00c 100644 --- a/examples/IotKnob/IotKnob.svgpcb.js +++ b/examples/IotKnob/IotKnob.svgpcb.js @@ -70,7 +70,7 @@ function NeopixelArrayCircular_4_rgb_knob(xy, rot=90, radius=1, startAngle=0, en obj.footprints[`led[${i}]`] = led = board.add(LED_SK6812_EC15_1_5x1_5mm, { translate: origin, rotate: angle + rot, - id: `rgb_knob_led[${i}]` + id: `rgb_knob_led_${i}_` }) const gndOrigin = pAdd(xy, vRotate([radius - powerRadiusOffset, 0], angle)) @@ -181,7 +181,7 @@ function NeopixelArrayCircular_24_rgb_ring(xy, rot=90, radius=1, startAngle=0, e obj.footprints[`led[${i}]`] = led = board.add(LED_SK6812_EC15_1_5x1_5mm, { translate: origin, rotate: angle + rot, - id: `rgb_ring_led[${i}]` + id: `rgb_ring_led_${i}_` }) const gndOrigin = pAdd(xy, vRotate([radius - powerRadiusOffset, 0], angle)) @@ -292,7 +292,7 @@ function NeopixelArrayCircular_6_rgb_sw(xy, rot=90, radius=1, startAngle=0, endA obj.footprints[`led[${i}]`] = led = board.add(LED_SK6812_EC15_1_5x1_5mm, { translate: origin, rotate: angle + rot, - id: `rgb_sw_led[${i}]` + id: `rgb_sw_led_${i}_` }) const gndOrigin = pAdd(xy, vRotate([radius - powerRadiusOffset, 0], angle)) diff --git a/examples/Keyboard/Keyboard.svgpcb.js b/examples/Keyboard/Keyboard.svgpcb.js index 29768ad24..797d39af5 100644 --- a/examples/Keyboard/Keyboard.svgpcb.js +++ b/examples/Keyboard/Keyboard.svgpcb.js @@ -23,19 +23,19 @@ function SwitchMatrix_2_3_sw(xy, colSpacing=1, rowSpacing=1, diodeOffset=[0.25, index = yIndex * ncols + xIndex + 1 buttonPos = [xy[0] + colSpacing * xIndex, xy[1] + rowSpacing * yIndex] - obj.footprints[`sw[${xIndex}][${yIndex}]`] = button = board.add( + obj.footprints[`sw[${xIndex},${yIndex}]`] = button = board.add( SW_Hotswap_Kailh_MX, { translate: buttonPos, rotate: 0, - id: `sw_sw[${xIndex}][${yIndex}]` + id: `sw_sw_${xIndex}_${yIndex}_` }) diodePos = [buttonPos[0] + diodeOffset[0], buttonPos[1] + diodeOffset[1]] - obj[`d[${xIndex}][${yIndex}]`] = diode = board.add( + obj[`d[${xIndex},${yIndex}]`] = diode = board.add( D_SMA, { translate: diodePos, rotate: 90, - id: `sw_d[${xIndex}][${yIndex}]` + id: `sw_d_${xIndex}_${yIndex}_` }) // create stub wire for button -> column common line diff --git a/examples/LedMatrix/LedMatrix.svgpcb.js b/examples/LedMatrix/LedMatrix.svgpcb.js index db63f69c6..eeb5977d5 100644 --- a/examples/LedMatrix/LedMatrix.svgpcb.js +++ b/examples/LedMatrix/LedMatrix.svgpcb.js @@ -24,9 +24,9 @@ function CharlieplexedLedMatrix_5_6_matrix(xy, colSpacing=1, rowSpacing=1) { for (let xIndex=0; xIndex < kXCount; xIndex++) { ledPos = [xy[0] + colSpacing * xIndex, xy[1] + rowSpacing * yIndex] - obj.footprints[`d[${yIndex}_${xIndex}]`] = led = board.add(LED_0603_1608Metric, { + obj.footprints[`led[${yIndex}_${xIndex}]`] = led = board.add(LED_0603_1608Metric, { translate: ledPos, - id: `matrix_d[${yIndex}_${xIndex}]` + id: `matrix_led_${yIndex}_${xIndex}_` }) rowLeds.push(led) @@ -71,9 +71,9 @@ function CharlieplexedLedMatrix_5_6_matrix(xy, colSpacing=1, rowSpacing=1) { allResistors = [] for (let xIndex=0; xIndex < kXCount; xIndex++) { const resPos = [xy[0] + colSpacing * xIndex, xy[1] + rowSpacing * kYCount] - obj.footprints[`r[${xIndex + 1}]`] = res = board.add(R_0603_1608Metric, { + obj.footprints[`res[${xIndex + 1}]`] = res = board.add(R_0603_1608Metric, { translate: resPos, - id: `matrix_r[${xIndex + 1}]` + id: `matrix_res_${xIndex + 1}_` }) allResistors.push(res)