circuit-json-to-lbrn 0.0.52 → 0.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +1 -0
- package/README.md +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +145 -14
- package/lib/ConvertContext.ts +4 -0
- package/lib/createOxidationCleaningLayerForLayer.ts +120 -0
- package/lib/index.ts +71 -16
- package/lib/layer-indexes.ts +22 -0
- package/package.json +2 -2
- package/site/main.tsx +2 -7
- package/tests/basics/copper-cut-fill/__snapshots__/copper-cut-fill-basic.snap.svg +1 -1
- package/tests/basics/copper-cut-fill/__snapshots__/copper-cut-fill-with-pads.snap.svg +1 -1
- package/tests/basics/laser-profile.test.ts +7 -7
- package/tests/basics/oxidation-cleaning/__snapshots__/oxidation-cleaning-basic.snap.svg +8 -0
- package/tests/basics/oxidation-cleaning/oxidation-cleaning-basic.test.ts +42 -0
- package/tests/examples/example05/__snapshots__/example05.snap.svg +1 -1
package/site/main.tsx
CHANGED
|
@@ -102,11 +102,6 @@ function kHzToHz(khz: number): number {
|
|
|
102
102
|
return khz * 1000
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// Convert pulse width from ns to seconds
|
|
106
|
-
function nsToSeconds(ns: number): number {
|
|
107
|
-
return ns * 1e-9
|
|
108
|
-
}
|
|
109
|
-
|
|
110
105
|
// Load Omni X 6W 150x150 preset
|
|
111
106
|
function loadOmniX6W150x150Preset() {
|
|
112
107
|
copperSpeedInput.value = "300"
|
|
@@ -188,13 +183,13 @@ function getConversionOptions() {
|
|
|
188
183
|
speed: parseFloat(copperSpeedInput.value) || 300,
|
|
189
184
|
numPasses: parseInt(copperNumPassesInput.value) || 100,
|
|
190
185
|
frequency: kHzToHz(parseFloat(copperFrequencyInput.value) || 20),
|
|
191
|
-
pulseWidth:
|
|
186
|
+
pulseWidth: parseFloat(copperPulseWidthInput.value) || 1,
|
|
192
187
|
},
|
|
193
188
|
board: {
|
|
194
189
|
speed: parseFloat(boardSpeedInput.value) || 20,
|
|
195
190
|
numPasses: parseInt(boardNumPassesInput.value) || 100,
|
|
196
191
|
frequency: kHzToHz(parseFloat(boardFrequencyInput.value) || 20),
|
|
197
|
-
pulseWidth:
|
|
192
|
+
pulseWidth: parseFloat(boardPulseWidthInput.value) || 1,
|
|
198
193
|
},
|
|
199
194
|
},
|
|
200
195
|
}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
<style></style><rect class="boundary" x="0" y="0" fill="#000" width="800" height="600" data-type="pcb_background" data-pcb-layer="global"/><rect class="pcb-boundary" fill="none" stroke="#fff" stroke-width="0.3" x="127.27272727272725" y="27.272727272727252" width="545.4545454545455" height="545.4545454545455" data-type="pcb_boundary" data-pcb-layer="global"/><path class="pcb-board" d="M 127.27272727272725 572.7272727272727 L 672.7272727272727 572.7272727272727 L 672.7272727272727 27.272727272727252 L 127.27272727272725 27.272727272727252 Z" fill="none" stroke="rgba(255, 255, 255, 0.5)" stroke-width="2.7272727272727275" data-type="pcb_board" data-pcb-layer="board"/><path class="pcb-trace" stroke="rgb(200, 52, 52)" fill="none" d="M 263.6363636363636 300 L 536.3636363636364 300" stroke-width="13.636363636363637" stroke-linecap="round" stroke-linejoin="round" shape-rendering="crispEdges" data-type="pcb_trace" data-pcb-layer="top"/>
|
|
4
4
|
</g>
|
|
5
5
|
<g transform="translate(0, 600) scale(20, 20) translate(14.65, 19.65)">
|
|
6
|
-
<defs><pattern id="hatch-0.0050-45-true-
|
|
6
|
+
<defs><pattern id="hatch-0.0050-45-true-_2300FFFF-0.1000-0.80__stack1" patternUnits="userSpaceOnUse" width="0.005" height="0.005" patternTransform="rotate(45)"><path d="M -0.005 0 L 0.005 0 M 0 -0.005 L 0 0.005" stroke="#00FFFF" stroke-width="0.1" stroke-opacity="0.8"/></pattern></defs><rect x="-14.65" y="-19.65" width="40" height="40" fill="white"/><g transform="matrix(1 0 0 -1 0 0.7000000000000028)"><g transform="matrix(1,0,0,1,0,0)"><path d="M -4.65 -9.65 L 15.35 -9.65 L 15.35 10.35 L -4.65 10.35 L -4.65 -9.65 L -4.65 -9.65 Z" fill="none" stroke="#FF0000" stroke-width="0.1" stroke-linecap="round" stroke-linejoin="round"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M 10.23867555286557 0.09999999999999998 L 10.2447620560996 0.09593312855939617 L 10.35 0.07499999999999996 L 10.4552379439004 0.09593312855939612 L 10.5444543648263 0.15554563517369935 L 10.604066871440603 0.2447620560996001 L 10.625 0.35 L 10.604066871440603 0.4552379439003997 L 10.5444543648263 0.5444543648263005 L 10.4552379439004 0.6040668714406039 L 10.35 0.625 L 10.2447620560996 0.6040668714406039 L 10.238675552865573 0.6 L 0.46132444713442683 0.6 L 0.45523794390039934 0.6040668714406039 L 0.34999999999999964 0.625 L 0.24476205609959995 0.6040668714406039 L 0.15554563517369907 0.5444543648263006 L 0.09593312855939579 0.45523794390039973 L 0.07499999999999962 0.35000000000000003 L 0.09593312855939573 0.2447620560996003 L 0.15554563517369902 0.1555456351736994 L 0.24476205609959978 0.09593312855939617 L 0.3499999999999996 0.07499999999999996 L 0.4552379439003994 0.09593312855939612 L 0.46132444713442683 0.09999999999999998 L 10.23867555286557 0.09999999999999998 L 10.23867555286557 0.09999999999999998" fill="none" stroke="#000000" stroke-width="0.1" stroke-linecap="round" stroke-linejoin="round"/></g><g><path d="M 10.244762055575848 0.09593313187360764 L 10.238675557076931 0.10000000149011612 L 0.46132444590330124 0.10000000149011612 L 0.4552379474043846 0.09593313187360764 L 0.3500000014901161 0.07500000298023224 L 0.24476205557584763 0.09593313187360764 L 0.15554563701152802 0.15554563701152802 L 0.09593313187360764 0.24476205557584763 L 0.07500000298023224 0.3500000014901161 L 0.09593313187360764 0.4552379474043846 L 0.15554563701152802 0.5444543659687042 L 0.24476205557584763 0.6040668711066246 L 0.3500000014901161 0.625 L 0.4552379474043846 0.6040668711066246 L 0.46132444590330124 0.6000000014901161 L 10.238675557076931 0.6000000014901161 L 10.244762055575848 0.6040668711066246 L 10.350000001490116 0.625 L 10.455237947404385 0.6040668711066246 L 10.544454365968704 0.5444543659687042 L 10.604066871106625 0.4552379474043846 L 10.625 0.3500000014901161 L 10.604066871106625 0.24476205557584763 L 10.544454365968704 0.15554563701152802 L 10.455237947404385 0.09593313187360764 L 10.350000001490116 0.07500000298023224 L 10.244762055575848 0.09593313187360764 L 10.244762055575848 0.09593313187360764 Z M 10.447545163333416 -0.4153926372528076 L 10.552783109247684 -0.3944595083594322 L 10.646579667925835 -0.36600664258003235 L 10.733023069798946 -0.3198016807436943 L 10.822239503264427 -0.26018916070461273 L 10.898007772862911 -0.1980077400803566 L 10.960189193487167 -0.12223946303129196 L 11.019801691174507 -0.033023037016391754 L 11.066006653010845 0.05342037230730057 L 11.094459511339664 0.14721688628196716 L 11.11539264023304 0.25245483219623566 L 11.125 0.3499999865889549 L 11.11539264023304 0.447545163333416 L 11.094459511339664 0.5527831092476845 L 11.066006638109684 0.6465796679258347 L 11.019801691174507 0.7330230474472046 L 10.960189193487167 0.8222394734621048 L 10.898007780313492 0.8980077430605888 L 10.822239473462105 0.9601891934871674 L 10.733023047447205 1.0198016911745071 L 10.646579638123512 1.0660066530108452 L 10.552783109247684 1.0944595113396645 L 10.447545163333416 1.1153926402330399 L 10.350000001490116 1.125 L 10.252454832196236 1.1153926402330399 L 10.175070807337761 1.1000000014901161 L 0.5249291881918907 1.1000000014901161 L 0.447545163333416 1.1153926402330399 L 0.3500000014901161 1.125 L 0.25245483219623566 1.1153926402330399 L 0.14721688628196716 1.0944595113396645 L 0.053420327603816986 1.0660066306591034 L -0.033023037016391754 1.0198016911745071 L -0.12223946303129196 0.9601891934871674 L -0.198007732629776 0.8980077803134918 L -0.26018916070461273 0.8222395032644272 L -0.3198016732931137 0.733023077249527 L -0.36600662767887115 0.6465796828269958 L -0.3944595083594322 0.5527831315994263 L -0.4153926372528076 0.447545163333416 L -0.42499999701976776 0.3500000014901161 L -0.4153926372528076 0.25245483219623566 L -0.3944595083594322 0.14721688628196716 L -0.36600662767887115 0.053420327603816986 L -0.3198016732931137 -0.03302306681871414 L -0.26018916070461273 -0.12223949283361435 L -0.1980077400803566 -0.1980077624320984 L -0.12223949283361435 -0.26018916070461273 L -0.03302306681871414 -0.3198016732931137 L 0.053420327603816986 -0.36600662767887115 L 0.14721687883138657 -0.3944595083594322 L 0.25245483219623566 -0.4153926372528076 L 0.3499999865889549 -0.42499999701976776 L 0.447545163333416 -0.4153926372528076 L 0.5249291881918907 -0.3999999985098839 L 10.175070807337761 -0.3999999985098839 L 10.252454832196236 -0.4153926372528076 L 10.349999986588955 -0.42499999701976776 L 10.447545163333416 -0.4153926372528076 L 10.447545163333416 -0.4153926372528076 Z" fill="url(#hatch-0.0050-45-true-_2300FFFF-0.1000-0.80__stack1)" fill-rule="nonzero" stroke="none"/><path d="M 10.244762055575848 0.09593313187360764 L 10.238675557076931 0.10000000149011612 L 0.46132444590330124 0.10000000149011612 L 0.4552379474043846 0.09593313187360764 L 0.3500000014901161 0.07500000298023224 L 0.24476205557584763 0.09593313187360764 L 0.15554563701152802 0.15554563701152802 L 0.09593313187360764 0.24476205557584763 L 0.07500000298023224 0.3500000014901161 L 0.09593313187360764 0.4552379474043846 L 0.15554563701152802 0.5444543659687042 L 0.24476205557584763 0.6040668711066246 L 0.3500000014901161 0.625 L 0.4552379474043846 0.6040668711066246 L 0.46132444590330124 0.6000000014901161 L 10.238675557076931 0.6000000014901161 L 10.244762055575848 0.6040668711066246 L 10.350000001490116 0.625 L 10.455237947404385 0.6040668711066246 L 10.544454365968704 0.5444543659687042 L 10.604066871106625 0.4552379474043846 L 10.625 0.3500000014901161 L 10.604066871106625 0.24476205557584763 L 10.544454365968704 0.15554563701152802 L 10.455237947404385 0.09593313187360764 L 10.350000001490116 0.07500000298023224 L 10.244762055575848 0.09593313187360764 L 10.244762055575848 0.09593313187360764 Z M 10.447545163333416 -0.4153926372528076 L 10.552783109247684 -0.3944595083594322 L 10.646579667925835 -0.36600664258003235 L 10.733023069798946 -0.3198016807436943 L 10.822239503264427 -0.26018916070461273 L 10.898007772862911 -0.1980077400803566 L 10.960189193487167 -0.12223946303129196 L 11.019801691174507 -0.033023037016391754 L 11.066006653010845 0.05342037230730057 L 11.094459511339664 0.14721688628196716 L 11.11539264023304 0.25245483219623566 L 11.125 0.3499999865889549 L 11.11539264023304 0.447545163333416 L 11.094459511339664 0.5527831092476845 L 11.066006638109684 0.6465796679258347 L 11.019801691174507 0.7330230474472046 L 10.960189193487167 0.8222394734621048 L 10.898007780313492 0.8980077430605888 L 10.822239473462105 0.9601891934871674 L 10.733023047447205 1.0198016911745071 L 10.646579638123512 1.0660066530108452 L 10.552783109247684 1.0944595113396645 L 10.447545163333416 1.1153926402330399 L 10.350000001490116 1.125 L 10.252454832196236 1.1153926402330399 L 10.175070807337761 1.1000000014901161 L 0.5249291881918907 1.1000000014901161 L 0.447545163333416 1.1153926402330399 L 0.3500000014901161 1.125 L 0.25245483219623566 1.1153926402330399 L 0.14721688628196716 1.0944595113396645 L 0.053420327603816986 1.0660066306591034 L -0.033023037016391754 1.0198016911745071 L -0.12223946303129196 0.9601891934871674 L -0.198007732629776 0.8980077803134918 L -0.26018916070461273 0.8222395032644272 L -0.3198016732931137 0.733023077249527 L -0.36600662767887115 0.6465796828269958 L -0.3944595083594322 0.5527831315994263 L -0.4153926372528076 0.447545163333416 L -0.42499999701976776 0.3500000014901161 L -0.4153926372528076 0.25245483219623566 L -0.3944595083594322 0.14721688628196716 L -0.36600662767887115 0.053420327603816986 L -0.3198016732931137 -0.03302306681871414 L -0.26018916070461273 -0.12223949283361435 L -0.1980077400803566 -0.1980077624320984 L -0.12223949283361435 -0.26018916070461273 L -0.03302306681871414 -0.3198016732931137 L 0.053420327603816986 -0.36600662767887115 L 0.14721687883138657 -0.3944595083594322 L 0.25245483219623566 -0.4153926372528076 L 0.3499999865889549 -0.42499999701976776 L 0.447545163333416 -0.4153926372528076 L 0.5249291881918907 -0.3999999985098839 L 10.175070807337761 -0.3999999985098839 L 10.252454832196236 -0.4153926372528076 L 10.349999986588955 -0.42499999701976776 L 10.447545163333416 -0.4153926372528076 L 10.447545163333416 -0.4153926372528076 Z" fill="none" fill-rule="nonzero" stroke="#00FFFF" stroke-width="0.1"/></g></g>
|
|
7
7
|
</g>
|
|
8
8
|
</svg>
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
<style></style><rect class="boundary" x="0" y="0" fill="#000" width="800" height="600" data-type="pcb_background" data-pcb-layer="global"/><rect class="pcb-boundary" fill="none" stroke="#fff" stroke-width="0.3" x="25" y="50" width="750" height="500" data-type="pcb_boundary" data-pcb-layer="global"/><path class="pcb-board" d="M 25 550 L 775 550 L 775 50 L 25 50 Z" fill="none" stroke="rgba(255, 255, 255, 0.5)" stroke-width="2.5" data-type="pcb_board" data-pcb-layer="board"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="175" y="262.5" width="50" height="75" data-type="pcb_smtpad" data-pcb-layer="top"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="575" y="262.5" width="50" height="75" data-type="pcb_smtpad" data-pcb-layer="top"/><path class="pcb-trace" stroke="rgb(200, 52, 52)" fill="none" d="M 225 300 L 575 300" stroke-width="12.5" stroke-linecap="round" stroke-linejoin="round" shape-rendering="crispEdges" data-type="pcb_trace" data-pcb-layer="top"/>
|
|
4
4
|
</g>
|
|
5
5
|
<g transform="translate(0, 600) scale(16, 16) translate(15.9, 18.4)">
|
|
6
|
-
<defs><pattern id="hatch-0.0050-45-true-
|
|
6
|
+
<defs><pattern id="hatch-0.0050-45-true-_2300FFFF-0.1000-0.80__stack1" patternUnits="userSpaceOnUse" width="0.005" height="0.005" patternTransform="rotate(45)"><path d="M -0.005 0 L 0.005 0 M 0 -0.005 L 0 0.005" stroke="#00FFFF" stroke-width="0.1" stroke-opacity="0.8"/></pattern></defs><rect x="-15.9" y="-18.4" width="50" height="40" fill="white"/><g transform="matrix(1 0 0 -1 0 3.200000000000003)"><g transform="matrix(1,0,0,1,0,0)"><path d="M -5.9 -8.4 L 24.1 -8.4 L 24.1 11.6 L -5.9 11.6 L -5.9 -8.4 L -5.9 -8.4 Z" fill="none" stroke="#FF0000" stroke-width="0.1" stroke-linecap="round" stroke-linejoin="round"/></g><g transform="matrix(1,0,0,1,0,0)"><path d="M 15.988675552865574 1.35 L 15.994762056099601 1.3459331285593963 L 16.1 1.3250000000000002 L 16.1 0.10000000000000009 L 18.1 0.10000000000000009 L 18.1 3.1 L 16.1 3.1 L 16.1 1.8750000000000004 L 15.994762056099601 1.854066871440604 L 15.988675552865574 1.85 L 2.211324447134427 1.85 L 2.2052379439003995 1.854066871440604 L 2.0999999999999996 1.875 L 2.0999999999999996 3.1 L 0.09999999999999964 3.1 L 0.09999999999999964 0.10000000000000009 L 2.0999999999999996 0.10000000000000009 L 2.0999999999999996 1.3250000000000002 L 2.2052379439003995 1.3459331285593963 L 2.2113244471344267 1.35 L 15.988675552865574 1.35 L 15.988675552865574 1.35" fill="none" stroke="#000000" stroke-width="0.1" stroke-linecap="round" stroke-linejoin="round"/></g><g><path d="M 0.10000000149011612 3.100000001490116 L 2.100000001490116 3.100000001490116 L 2.100000001490116 1.875 L 2.2052379474043846 1.8540668711066246 L 2.2113244459033012 1.8500000014901161 L 15.988675557076931 1.8500000014901161 L 15.994762055575848 1.8540668711066246 L 16.100000001490116 1.875 L 16.100000001490116 3.100000001490116 L 18.100000001490116 3.100000001490116 L 18.100000001490116 0.10000000149011612 L 16.100000001490116 0.10000000149011612 L 16.100000001490116 1.3250000029802322 L 15.994762055575848 1.3459331318736076 L 15.988675557076931 1.3500000014901161 L 2.2113244459033012 1.3500000014901161 L 2.2052379474043846 1.3459331318736076 L 2.100000001490116 1.3250000029802322 L 2.100000001490116 0.10000000149011612 L 0.10000000149011612 0.10000000149011612 L 0.10000000149011612 3.100000001490116 L 0.10000000149011612 3.100000001490116 Z M 2.256072260439396 -0.6846282184123993 L 2.406146749854088 -0.6391036286950111 L 2.5444561913609505 -0.5651756897568703 L 2.665685422718525 -0.4656854197382927 L 2.7651756927371025 -0.34445618838071823 L 2.8391036316752434 -0.2061467468738556 L 2.8846282213926315 -0.056072257459163666 L 2.899999998509884 0.10000000149011612 L 2.899999998509884 0.5499999970197678 L 15.299999997019768 0.5499999970197678 L 15.299999997019768 0.10000000149011612 L 15.3153717815876 -0.056072257459163666 L 15.360896371304989 -0.2061467468738556 L 15.43482431024313 -0.34445618838071823 L 15.534314580261707 -0.4656854197382927 L 15.655543811619282 -0.5651756897568703 L 15.793853253126144 -0.6391036286950111 L 15.943927742540836 -0.6846282184123993 L 16.100000001490116 -0.7000000029802322 L 18.100000001490116 -0.7000000029802322 L 18.256072260439396 -0.6846282184123993 L 18.406146749854088 -0.6391036286950111 L 18.54445619136095 -0.5651756897568703 L 18.665685422718525 -0.4656854197382927 L 18.765175692737103 -0.34445618838071823 L 18.839103631675243 -0.2061467468738556 L 18.88462822139263 -0.056072257459163666 L 18.899999998509884 0.10000000149011612 L 18.899999998509884 3.100000001490116 L 18.88462822139263 3.256072260439396 L 18.839103631675243 3.406146749854088 L 18.765175692737103 3.5444561913609505 L 18.665685422718525 3.665685422718525 L 18.54445619136095 3.7651756927371025 L 18.406146749854088 3.8391036316752434 L 18.256072260439396 3.8846282213926315 L 18.100000001490116 3.899999998509884 L 16.100000001490116 3.899999998509884 L 15.943927742540836 3.8846282213926315 L 15.793853253126144 3.8391036316752434 L 15.655543811619282 3.7651756927371025 L 15.534314580261707 3.665685422718525 L 15.43482431024313 3.5444561913609505 L 15.360896371304989 3.406146749854088 L 15.3153717815876 3.256072260439396 L 15.299999997019768 3.100000001490116 L 15.299999997019768 2.649999998509884 L 2.899999998509884 2.649999998509884 L 2.899999998509884 3.100000001490116 L 2.8846282213926315 3.256072260439396 L 2.8391036316752434 3.406146749854088 L 2.7651756927371025 3.5444561913609505 L 2.665685422718525 3.665685422718525 L 2.5444561913609505 3.7651756927371025 L 2.406146749854088 3.8391036316752434 L 2.256072260439396 3.8846282213926315 L 2.100000001490116 3.899999998509884 L 0.10000000149011612 3.899999998509884 L -0.056072257459163666 3.8846282213926315 L -0.2061467468738556 3.8391036316752434 L -0.34445618838071823 3.7651756927371025 L -0.4656854197382927 3.665685422718525 L -0.5651756897568703 3.5444561913609505 L -0.6391036286950111 3.406146749854088 L -0.6846282184123993 3.256072260439396 L -0.7000000029802322 3.100000001490116 L -0.7000000029802322 0.10000000149011612 L -0.6846282184123993 -0.056072257459163666 L -0.6391036286950111 -0.2061467468738556 L -0.5651756897568703 -0.34445618838071823 L -0.4656854197382927 -0.4656854197382927 L -0.34445618838071823 -0.5651756897568703 L -0.2061467468738556 -0.6391036286950111 L -0.056072257459163666 -0.6846282184123993 L 0.10000000149011612 -0.7000000029802322 L 2.100000001490116 -0.7000000029802322 L 2.256072260439396 -0.6846282184123993 L 2.256072260439396 -0.6846282184123993 Z" fill="url(#hatch-0.0050-45-true-_2300FFFF-0.1000-0.80__stack1)" fill-rule="nonzero" stroke="none"/><path d="M 0.10000000149011612 3.100000001490116 L 2.100000001490116 3.100000001490116 L 2.100000001490116 1.875 L 2.2052379474043846 1.8540668711066246 L 2.2113244459033012 1.8500000014901161 L 15.988675557076931 1.8500000014901161 L 15.994762055575848 1.8540668711066246 L 16.100000001490116 1.875 L 16.100000001490116 3.100000001490116 L 18.100000001490116 3.100000001490116 L 18.100000001490116 0.10000000149011612 L 16.100000001490116 0.10000000149011612 L 16.100000001490116 1.3250000029802322 L 15.994762055575848 1.3459331318736076 L 15.988675557076931 1.3500000014901161 L 2.2113244459033012 1.3500000014901161 L 2.2052379474043846 1.3459331318736076 L 2.100000001490116 1.3250000029802322 L 2.100000001490116 0.10000000149011612 L 0.10000000149011612 0.10000000149011612 L 0.10000000149011612 3.100000001490116 L 0.10000000149011612 3.100000001490116 Z M 2.256072260439396 -0.6846282184123993 L 2.406146749854088 -0.6391036286950111 L 2.5444561913609505 -0.5651756897568703 L 2.665685422718525 -0.4656854197382927 L 2.7651756927371025 -0.34445618838071823 L 2.8391036316752434 -0.2061467468738556 L 2.8846282213926315 -0.056072257459163666 L 2.899999998509884 0.10000000149011612 L 2.899999998509884 0.5499999970197678 L 15.299999997019768 0.5499999970197678 L 15.299999997019768 0.10000000149011612 L 15.3153717815876 -0.056072257459163666 L 15.360896371304989 -0.2061467468738556 L 15.43482431024313 -0.34445618838071823 L 15.534314580261707 -0.4656854197382927 L 15.655543811619282 -0.5651756897568703 L 15.793853253126144 -0.6391036286950111 L 15.943927742540836 -0.6846282184123993 L 16.100000001490116 -0.7000000029802322 L 18.100000001490116 -0.7000000029802322 L 18.256072260439396 -0.6846282184123993 L 18.406146749854088 -0.6391036286950111 L 18.54445619136095 -0.5651756897568703 L 18.665685422718525 -0.4656854197382927 L 18.765175692737103 -0.34445618838071823 L 18.839103631675243 -0.2061467468738556 L 18.88462822139263 -0.056072257459163666 L 18.899999998509884 0.10000000149011612 L 18.899999998509884 3.100000001490116 L 18.88462822139263 3.256072260439396 L 18.839103631675243 3.406146749854088 L 18.765175692737103 3.5444561913609505 L 18.665685422718525 3.665685422718525 L 18.54445619136095 3.7651756927371025 L 18.406146749854088 3.8391036316752434 L 18.256072260439396 3.8846282213926315 L 18.100000001490116 3.899999998509884 L 16.100000001490116 3.899999998509884 L 15.943927742540836 3.8846282213926315 L 15.793853253126144 3.8391036316752434 L 15.655543811619282 3.7651756927371025 L 15.534314580261707 3.665685422718525 L 15.43482431024313 3.5444561913609505 L 15.360896371304989 3.406146749854088 L 15.3153717815876 3.256072260439396 L 15.299999997019768 3.100000001490116 L 15.299999997019768 2.649999998509884 L 2.899999998509884 2.649999998509884 L 2.899999998509884 3.100000001490116 L 2.8846282213926315 3.256072260439396 L 2.8391036316752434 3.406146749854088 L 2.7651756927371025 3.5444561913609505 L 2.665685422718525 3.665685422718525 L 2.5444561913609505 3.7651756927371025 L 2.406146749854088 3.8391036316752434 L 2.256072260439396 3.8846282213926315 L 2.100000001490116 3.899999998509884 L 0.10000000149011612 3.899999998509884 L -0.056072257459163666 3.8846282213926315 L -0.2061467468738556 3.8391036316752434 L -0.34445618838071823 3.7651756927371025 L -0.4656854197382927 3.665685422718525 L -0.5651756897568703 3.5444561913609505 L -0.6391036286950111 3.406146749854088 L -0.6846282184123993 3.256072260439396 L -0.7000000029802322 3.100000001490116 L -0.7000000029802322 0.10000000149011612 L -0.6846282184123993 -0.056072257459163666 L -0.6391036286950111 -0.2061467468738556 L -0.5651756897568703 -0.34445618838071823 L -0.4656854197382927 -0.4656854197382927 L -0.34445618838071823 -0.5651756897568703 L -0.2061467468738556 -0.6391036286950111 L -0.056072257459163666 -0.6846282184123993 L 0.10000000149011612 -0.7000000029802322 L 2.100000001490116 -0.7000000029802322 L 2.256072260439396 -0.6846282184123993 L 2.256072260439396 -0.6846282184123993 Z" fill="none" fill-rule="nonzero" stroke="#00FFFF" stroke-width="0.1"/></g></g>
|
|
7
7
|
</g>
|
|
8
8
|
</svg>
|
|
@@ -27,13 +27,13 @@ test("applies custom laserProfile settings", async () => {
|
|
|
27
27
|
speed: 350,
|
|
28
28
|
numPasses: 150,
|
|
29
29
|
frequency: 25000,
|
|
30
|
-
pulseWidth:
|
|
30
|
+
pulseWidth: 2,
|
|
31
31
|
},
|
|
32
32
|
board: {
|
|
33
33
|
speed: 25,
|
|
34
34
|
numPasses: 120,
|
|
35
35
|
frequency: 21000,
|
|
36
|
-
pulseWidth: 1.
|
|
36
|
+
pulseWidth: 1.5,
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
})
|
|
@@ -49,21 +49,21 @@ test("applies custom laserProfile settings", async () => {
|
|
|
49
49
|
expect(topCopper.speed).toBe(350)
|
|
50
50
|
expect(topCopper.numPasses).toBe(150)
|
|
51
51
|
expect(topCopper.frequency).toBe(25000)
|
|
52
|
-
expect(topCopper.
|
|
52
|
+
expect(topCopper.qPulseWidth).toBe(2)
|
|
53
53
|
|
|
54
54
|
// Verify bottom copper settings (same as top)
|
|
55
55
|
const bottomCopper = cutSettings[1]!
|
|
56
56
|
expect(bottomCopper.speed).toBe(350)
|
|
57
57
|
expect(bottomCopper.numPasses).toBe(150)
|
|
58
58
|
expect(bottomCopper.frequency).toBe(25000)
|
|
59
|
-
expect(bottomCopper.
|
|
59
|
+
expect(bottomCopper.qPulseWidth).toBe(2)
|
|
60
60
|
|
|
61
61
|
// Verify through board settings
|
|
62
62
|
const throughBoard = cutSettings[2]!
|
|
63
63
|
expect(throughBoard.speed).toBe(25)
|
|
64
64
|
expect(throughBoard.numPasses).toBe(120)
|
|
65
65
|
expect(throughBoard.frequency).toBe(21000)
|
|
66
|
-
expect(throughBoard.
|
|
66
|
+
expect(throughBoard.qPulseWidth).toBe(1.5)
|
|
67
67
|
})
|
|
68
68
|
|
|
69
69
|
test("uses default laserProfile settings when not provided", async () => {
|
|
@@ -80,12 +80,12 @@ test("uses default laserProfile settings when not provided", async () => {
|
|
|
80
80
|
expect(topCopper.speed).toBe(300)
|
|
81
81
|
expect(topCopper.numPasses).toBe(100)
|
|
82
82
|
expect(topCopper.frequency).toBe(20000)
|
|
83
|
-
expect(topCopper.
|
|
83
|
+
expect(topCopper.qPulseWidth).toBe(1)
|
|
84
84
|
|
|
85
85
|
// Verify through board defaults
|
|
86
86
|
const throughBoard = cutSettings[2]!
|
|
87
87
|
expect(throughBoard.speed).toBe(20)
|
|
88
88
|
expect(throughBoard.numPasses).toBe(100)
|
|
89
89
|
expect(throughBoard.frequency).toBe(20000)
|
|
90
|
-
expect(throughBoard.
|
|
90
|
+
expect(throughBoard.qPulseWidth).toBe(1)
|
|
91
91
|
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg width="800" height="1400" viewBox="0 0 800 1400" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g transform="translate(0, 0)">
|
|
3
|
+
<style></style><rect class="boundary" x="0" y="0" fill="#000" width="800" height="600" data-type="pcb_background" data-pcb-layer="global"/><rect class="pcb-boundary" fill="none" stroke="#fff" stroke-width="0.3" x="127.27272727272725" y="27.272727272727252" width="545.4545454545455" height="545.4545454545455" data-type="pcb_boundary" data-pcb-layer="global"/><path class="pcb-board" d="M 127.27272727272725 572.7272727272727 L 672.7272727272727 572.7272727272727 L 672.7272727272727 27.272727272727252 L 127.27272727272725 27.272727272727252 Z" fill="none" stroke="rgba(255, 255, 255, 0.5)" stroke-width="2.7272727272727275" data-type="pcb_board" data-pcb-layer="board"/>
|
|
4
|
+
</g>
|
|
5
|
+
<g transform="translate(0, 600) scale(19.999999999254943, 19.999999999254943) translate(19.9, 19.9)">
|
|
6
|
+
<defs><pattern id="hatch-0.0050-45-true-_23C0C0C0-0.1000-0.80__stack1" patternUnits="userSpaceOnUse" width="0.005" height="0.005" patternTransform="rotate(45)"><path d="M -0.005 0 L 0.005 0 M 0 -0.005 L 0 0.005" stroke="#C0C0C0" stroke-width="0.1" stroke-opacity="0.8"/></pattern></defs><rect x="-19.9" y="-19.9" width="40.000000001490115" height="40.000000001490115" fill="white"/><g transform="matrix(1 0 0 -1 0 0.20000000149011754)"><g transform="matrix(1,0,0,1,0,0)"><path d="M -9.9 -9.9 L 10.1 -9.9 L 10.1 10.1 L -9.9 10.1 L -9.9 -9.9 L -9.9 -9.9 Z" fill="none" stroke="#FF0000" stroke-width="0.1" stroke-linecap="round" stroke-linejoin="round"/></g><g><path d="M 10.100000001490116 10.100000001490116 L -9.899999998509884 10.100000001490116 L -9.899999998509884 -9.899999998509884 L 10.100000001490116 -9.899999998509884 L 10.100000001490116 10.100000001490116 L 10.100000001490116 10.100000001490116 Z" fill="url(#hatch-0.0050-45-true-_23C0C0C0-0.1000-0.80__stack1)" fill-rule="nonzero" stroke="none"/><path d="M 10.100000001490116 10.100000001490116 L -9.899999998509884 10.100000001490116 L -9.899999998509884 -9.899999998509884 L 10.100000001490116 -9.899999998509884 L 10.100000001490116 10.100000001490116 L 10.100000001490116 10.100000001490116 Z" fill="none" fill-rule="nonzero" stroke="#C0C0C0" stroke-width="0.1"/></g></g>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { expect, test } from "bun:test"
|
|
2
|
+
import type { CircuitJson } from "circuit-json"
|
|
3
|
+
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
|
|
4
|
+
import { generateLightBurnSvg } from "lbrnts"
|
|
5
|
+
import { stackSvgsVertically } from "stack-svgs"
|
|
6
|
+
import { convertCircuitJsonToLbrn } from "../../../lib"
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Test basic oxidation cleaning layer functionality.
|
|
10
|
+
* The oxidation cleaning layer should fill the entire board area
|
|
11
|
+
* for laser ablation to clean oxidation from the copper surface.
|
|
12
|
+
*/
|
|
13
|
+
test("oxidation-cleaning-basic", async () => {
|
|
14
|
+
const circuitJson = [
|
|
15
|
+
{
|
|
16
|
+
type: "pcb_board",
|
|
17
|
+
pcb_board_id: "board_1",
|
|
18
|
+
width: 20,
|
|
19
|
+
height: 20,
|
|
20
|
+
center: { x: 0, y: 0 },
|
|
21
|
+
},
|
|
22
|
+
] as CircuitJson
|
|
23
|
+
|
|
24
|
+
const pcbSvg = await convertCircuitJsonToPcbSvg(circuitJson)
|
|
25
|
+
|
|
26
|
+
const project = await convertCircuitJsonToLbrn(circuitJson, {
|
|
27
|
+
includeOxidationCleaningLayer: true,
|
|
28
|
+
includeLayers: ["top"],
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
Bun.write(
|
|
32
|
+
"debug-output/oxidation-cleaning-basic.lbrn2",
|
|
33
|
+
project.getString(),
|
|
34
|
+
{ createPath: true },
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
const lbrnSvg = await generateLightBurnSvg(project)
|
|
38
|
+
|
|
39
|
+
expect(stackSvgsVertically([pcbSvg, lbrnSvg])).toMatchSvgSnapshot(
|
|
40
|
+
import.meta.filename,
|
|
41
|
+
)
|
|
42
|
+
})
|