circuit-json-to-lbrn 0.0.23 → 0.0.24
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/package.json +1 -1
- package/site/index.html +124 -38
- package/site/main.tsx +35 -3
package/package.json
CHANGED
package/site/index.html
CHANGED
|
@@ -61,44 +61,130 @@
|
|
|
61
61
|
|
|
62
62
|
<div id="optionsContainer" class="hidden bg-gray-800 rounded-lg p-6 mb-6">
|
|
63
63
|
<h3 class="text-lg font-semibold mb-4 text-blue-400">Conversion Options</h3>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
64
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
65
|
+
<div>
|
|
66
|
+
<label class="block text-sm font-medium text-gray-300 mb-2">
|
|
67
|
+
Origin X (mm)
|
|
68
|
+
</label>
|
|
69
|
+
<input
|
|
70
|
+
type="number"
|
|
71
|
+
id="originX"
|
|
72
|
+
value="0"
|
|
73
|
+
step="0.1"
|
|
74
|
+
class="w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
<div>
|
|
78
|
+
<label class="block text-sm font-medium text-gray-300 mb-2">
|
|
79
|
+
Origin Y (mm)
|
|
80
|
+
</label>
|
|
81
|
+
<input
|
|
82
|
+
type="number"
|
|
83
|
+
id="originY"
|
|
84
|
+
value="0"
|
|
85
|
+
step="0.1"
|
|
86
|
+
class="w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
<div>
|
|
90
|
+
<label class="block text-sm font-medium text-gray-300 mb-2">
|
|
91
|
+
Trace Margin (mm)
|
|
92
|
+
</label>
|
|
93
|
+
<input
|
|
94
|
+
type="number"
|
|
95
|
+
id="traceMargin"
|
|
96
|
+
value="0"
|
|
97
|
+
step="0.001"
|
|
98
|
+
class="w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
<div>
|
|
102
|
+
<label class="block text-sm font-medium text-gray-300 mb-2">
|
|
103
|
+
Soldermask Margin (mm)
|
|
104
|
+
</label>
|
|
105
|
+
<input
|
|
106
|
+
type="number"
|
|
107
|
+
id="soldermaskMargin"
|
|
108
|
+
value="0"
|
|
109
|
+
step="0.001"
|
|
110
|
+
class="w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
<div>
|
|
114
|
+
<label class="block text-sm font-medium text-gray-300 mb-2">
|
|
115
|
+
Laser Spot Size (mm)
|
|
116
|
+
</label>
|
|
117
|
+
<input
|
|
118
|
+
type="number"
|
|
119
|
+
id="laserSpotSize"
|
|
120
|
+
value="0.005"
|
|
121
|
+
step="0.001"
|
|
122
|
+
class="w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="md:col-span-2 grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
126
|
+
<label class="flex items-center cursor-pointer">
|
|
127
|
+
<input
|
|
128
|
+
type="checkbox"
|
|
129
|
+
id="includeCopper"
|
|
130
|
+
checked
|
|
131
|
+
class="w-5 h-5 text-blue-500 bg-gray-700 border-gray-600 rounded focus:ring-blue-500 focus:ring-2"
|
|
132
|
+
/>
|
|
133
|
+
<span class="ml-3 text-sm font-medium text-gray-300">
|
|
134
|
+
Include Copper
|
|
135
|
+
</span>
|
|
136
|
+
</label>
|
|
137
|
+
<label class="flex items-center cursor-pointer">
|
|
138
|
+
<input
|
|
139
|
+
type="checkbox"
|
|
140
|
+
id="includeSoldermask"
|
|
141
|
+
class="w-5 h-5 text-blue-500 bg-gray-700 border-gray-600 rounded focus:ring-blue-500 focus:ring-2"
|
|
142
|
+
/>
|
|
143
|
+
<span class="ml-3 text-sm font-medium text-gray-300">
|
|
144
|
+
Include Soldermask
|
|
145
|
+
</span>
|
|
146
|
+
</label>
|
|
147
|
+
<label class="flex items-center cursor-pointer">
|
|
148
|
+
<input
|
|
149
|
+
type="checkbox"
|
|
150
|
+
id="includeSilkscreen"
|
|
151
|
+
class="w-5 h-5 text-blue-500 bg-gray-700 border-gray-600 rounded focus:ring-blue-500 focus:ring-2"
|
|
152
|
+
/>
|
|
153
|
+
<span class="ml-3 text-sm font-medium text-gray-300">
|
|
154
|
+
Include Silkscreen Layer
|
|
155
|
+
</span>
|
|
156
|
+
</label>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="md:col-span-2">
|
|
159
|
+
<label class="block text-sm font-medium text-gray-300 mb-2">
|
|
160
|
+
Include Layers
|
|
161
|
+
</label>
|
|
162
|
+
<div class="flex gap-4">
|
|
163
|
+
<label class="flex items-center cursor-pointer">
|
|
164
|
+
<input
|
|
165
|
+
type="checkbox"
|
|
166
|
+
id="includeTopLayer"
|
|
167
|
+
checked
|
|
168
|
+
class="w-5 h-5 text-blue-500 bg-gray-700 border-gray-600 rounded focus:ring-blue-500 focus:ring-2"
|
|
169
|
+
/>
|
|
170
|
+
<span class="ml-3 text-sm font-medium text-gray-300">
|
|
171
|
+
Top
|
|
172
|
+
</span>
|
|
173
|
+
</label>
|
|
174
|
+
<label class="flex items-center cursor-pointer">
|
|
175
|
+
<input
|
|
176
|
+
type="checkbox"
|
|
177
|
+
id="includeBottomLayer"
|
|
178
|
+
checked
|
|
179
|
+
class="w-5 h-5 text-blue-500 bg-gray-700 border-gray-600 rounded focus:ring-blue-500 focus:ring-2"
|
|
180
|
+
/>
|
|
181
|
+
<span class="ml-3 text-sm font-medium text-gray-300">
|
|
182
|
+
Bottom
|
|
183
|
+
</span>
|
|
184
|
+
</label>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
102
188
|
<button
|
|
103
189
|
id="reconvertBtn"
|
|
104
190
|
class="mt-4 bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg transition-colors"
|
package/site/main.tsx
CHANGED
|
@@ -33,9 +33,30 @@ const optionsContainer = document.getElementById(
|
|
|
33
33
|
) as HTMLDivElement
|
|
34
34
|
const originXInput = document.getElementById("originX") as HTMLInputElement
|
|
35
35
|
const originYInput = document.getElementById("originY") as HTMLInputElement
|
|
36
|
+
const traceMarginInput = document.getElementById(
|
|
37
|
+
"traceMargin",
|
|
38
|
+
) as HTMLInputElement
|
|
39
|
+
const soldermaskMarginInput = document.getElementById(
|
|
40
|
+
"soldermaskMargin",
|
|
41
|
+
) as HTMLInputElement
|
|
42
|
+
const laserSpotSizeInput = document.getElementById(
|
|
43
|
+
"laserSpotSize",
|
|
44
|
+
) as HTMLInputElement
|
|
45
|
+
const includeCopperInput = document.getElementById(
|
|
46
|
+
"includeCopper",
|
|
47
|
+
) as HTMLInputElement
|
|
48
|
+
const includeSoldermaskInput = document.getElementById(
|
|
49
|
+
"includeSoldermask",
|
|
50
|
+
) as HTMLInputElement
|
|
36
51
|
const includeSilkscreenInput = document.getElementById(
|
|
37
52
|
"includeSilkscreen",
|
|
38
53
|
) as HTMLInputElement
|
|
54
|
+
const includeTopLayerInput = document.getElementById(
|
|
55
|
+
"includeTopLayer",
|
|
56
|
+
) as HTMLInputElement
|
|
57
|
+
const includeBottomLayerInput = document.getElementById(
|
|
58
|
+
"includeBottomLayer",
|
|
59
|
+
) as HTMLInputElement
|
|
39
60
|
const reconvertBtn = document.getElementById(
|
|
40
61
|
"reconvertBtn",
|
|
41
62
|
) as HTMLButtonElement
|
|
@@ -68,6 +89,15 @@ function getConversionOptions() {
|
|
|
68
89
|
x: parseFloat(originXInput.value) || 0,
|
|
69
90
|
y: parseFloat(originYInput.value) || 0,
|
|
70
91
|
},
|
|
92
|
+
includeCopper: includeCopperInput.checked,
|
|
93
|
+
includeSoldermask: includeSoldermaskInput.checked,
|
|
94
|
+
soldermaskMargin: parseFloat(soldermaskMarginInput.value) || 0,
|
|
95
|
+
includeLayers: [
|
|
96
|
+
...(includeTopLayerInput.checked ? ["top" as const] : []),
|
|
97
|
+
...(includeBottomLayerInput.checked ? ["bottom" as const] : []),
|
|
98
|
+
],
|
|
99
|
+
traceMargin: parseFloat(traceMarginInput.value) || 0,
|
|
100
|
+
laserSpotSize: parseFloat(laserSpotSizeInput.value) || 0.005,
|
|
71
101
|
}
|
|
72
102
|
}
|
|
73
103
|
|
|
@@ -131,9 +161,11 @@ async function convertAndDisplay() {
|
|
|
131
161
|
|
|
132
162
|
// Convert to LBRN
|
|
133
163
|
console.log("Converting to LBRN with options:", options)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
164
|
+
const { origin: _, ...conversionOptions } = options
|
|
165
|
+
currentLbrnProject = convertCircuitJsonToLbrn(
|
|
166
|
+
processedCircuitJson,
|
|
167
|
+
conversionOptions,
|
|
168
|
+
)
|
|
137
169
|
|
|
138
170
|
// Generate SVGs
|
|
139
171
|
console.log("Generating Circuit JSON SVG...")
|