@tscircuit/internal-dynamic-import 0.0.16 → 0.0.18
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/README.md +112 -14
- package/dist/index.d.ts +629 -3
- package/dist/index.js +80 -28
- package/dist/index.js.map +1 -1
- package/lib/create-importer.ts +27 -0
- package/lib/dynamic-import-resolver.ts +58 -0
- package/lib/dynamic-module-registry.ts +37 -0
- package/lib/import-urls.ts +45 -0
- package/lib/index.ts +46 -0
- package/lib/supported-modules.ts +88 -0
- package/lib/type-bundles/@tscircuit/circuit-json-schematic-placement-analysis.d.ts +593 -0
- package/lib/type-bundles/circuit-json-to-3d-png.d.ts +48 -0
- package/lib/type-bundles/circuit-json-to-bom-csv.d.ts +36 -0
- package/lib/type-bundles/circuit-json-to-bpc.d.ts +15 -0
- package/lib/type-bundles/circuit-json-to-connectivity-map.d.ts +44 -0
- package/lib/type-bundles/circuit-json-to-fdm-component-box.d.ts +160 -0
- package/lib/type-bundles/circuit-json-to-gerber.d.ts +672 -0
- package/lib/type-bundles/circuit-json-to-gltf.d.ts +273 -0
- package/lib/type-bundles/circuit-json-to-kicad.d.ts +392 -0
- package/lib/type-bundles/circuit-json-to-lbrn.d.ts +54 -0
- package/lib/type-bundles/circuit-json-to-pnp-csv.d.ts +15 -0
- package/lib/type-bundles/circuit-json-to-readable-netlist.d.ts +5 -0
- package/lib/type-bundles/circuit-json-to-simple-3d.d.ts +41 -0
- package/lib/type-bundles/circuit-json-to-spice.d.ts +242 -0
- package/lib/type-bundles/circuit-json-to-step.d.ts +28 -0
- package/lib/type-bundles/circuit-json-to-tscircuit.d.ts +14 -0
- package/lib/type-bundles/circuit-to-canvas.d.ts +646 -0
- package/lib/type-bundles/circuit-to-svg.d.ts +399 -0
- package/lib/type-bundles/kicad-to-circuit-json.d.ts +375 -0
- package/package.json +10 -3
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
import { LayerRef, AnyCircuitElement, PcbRenderLayer, Ring, NinePointAnchor, PcbPlatedHole, PCBVia, PcbHole, PcbSmtPad, PcbVia, PcbCutout, PcbSolderPaste, PcbTrace, PcbBoard, PcbPanel, PcbSilkscreenText, PcbSilkscreenRect, PcbSilkscreenCircle, PcbSilkscreenGraphic, PcbSilkscreenLine, PcbSilkscreenPath, PcbSilkscreenPill, PcbSilkscreenOval, PCBKeepout, PcbCopperPour, PcbCopperText, PcbFabricationNoteText, PcbFabricationNoteRect, PcbNoteRect, PcbFabricationNotePath, PcbNotePath, PcbNoteText, PcbNoteDimension, PcbFabricationNoteDimension, PcbCourtyardCircle } from 'circuit-json';
|
|
2
|
+
import { Matrix } from 'transformation-matrix';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Canvas context type that works with both browser and node-canvas.
|
|
6
|
+
* Uses a subset of CanvasRenderingContext2D methods that are common to both.
|
|
7
|
+
*/
|
|
8
|
+
interface CanvasContext {
|
|
9
|
+
beginPath(): void;
|
|
10
|
+
closePath(): void;
|
|
11
|
+
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
|
|
12
|
+
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
|
|
13
|
+
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number): void;
|
|
14
|
+
fill(fillRule?: "nonzero" | "evenodd"): void;
|
|
15
|
+
stroke(): void;
|
|
16
|
+
rect(x: number, y: number, w: number, h: number): void;
|
|
17
|
+
lineTo(x: number, y: number): void;
|
|
18
|
+
moveTo(x: number, y: number): void;
|
|
19
|
+
save(): void;
|
|
20
|
+
restore(): void;
|
|
21
|
+
clip(fillRule?: "nonzero" | "evenodd"): void;
|
|
22
|
+
translate(x: number, y: number): void;
|
|
23
|
+
rotate(angle: number): void;
|
|
24
|
+
scale(x: number, y: number): void;
|
|
25
|
+
globalCompositeOperation?: string;
|
|
26
|
+
fillStyle: string | CanvasGradient | CanvasPattern;
|
|
27
|
+
strokeStyle: string | CanvasGradient | CanvasPattern;
|
|
28
|
+
globalAlpha: number;
|
|
29
|
+
lineWidth: number;
|
|
30
|
+
lineCap: "butt" | "round" | "square";
|
|
31
|
+
lineJoin: "bevel" | "round" | "miter";
|
|
32
|
+
setLineDash(segments: number[]): void;
|
|
33
|
+
canvas: {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
};
|
|
37
|
+
fillText(text: string, x: number, y: number): void;
|
|
38
|
+
fillRect(x: number, y: number, width: number, height: number): void;
|
|
39
|
+
measureText?: (text: string) => {
|
|
40
|
+
width: number;
|
|
41
|
+
actualBoundingBoxAscent?: number;
|
|
42
|
+
actualBoundingBoxDescent?: number;
|
|
43
|
+
};
|
|
44
|
+
font: string;
|
|
45
|
+
textAlign: "start" | "end" | "left" | "right" | "center";
|
|
46
|
+
}
|
|
47
|
+
type CopperLayerName = LayerRef;
|
|
48
|
+
type CopperColorMap = Record<CopperLayerName, string> & {
|
|
49
|
+
[layer: string]: string;
|
|
50
|
+
};
|
|
51
|
+
interface PcbColorMap {
|
|
52
|
+
copper: CopperColorMap;
|
|
53
|
+
copperPour: {
|
|
54
|
+
top: string;
|
|
55
|
+
bottom: string;
|
|
56
|
+
};
|
|
57
|
+
drill: string;
|
|
58
|
+
silkscreen: {
|
|
59
|
+
top: string;
|
|
60
|
+
bottom: string;
|
|
61
|
+
};
|
|
62
|
+
boardOutline: string;
|
|
63
|
+
soldermask: {
|
|
64
|
+
top: string;
|
|
65
|
+
bottom: string;
|
|
66
|
+
};
|
|
67
|
+
soldermaskWithCopperUnderneath: {
|
|
68
|
+
top: string;
|
|
69
|
+
bottom: string;
|
|
70
|
+
};
|
|
71
|
+
soldermaskOverCopper: {
|
|
72
|
+
top: string;
|
|
73
|
+
bottom: string;
|
|
74
|
+
};
|
|
75
|
+
substrate: string;
|
|
76
|
+
courtyard: {
|
|
77
|
+
top: string;
|
|
78
|
+
bottom: string;
|
|
79
|
+
};
|
|
80
|
+
keepout: {
|
|
81
|
+
top: string;
|
|
82
|
+
bottom: string;
|
|
83
|
+
};
|
|
84
|
+
fabricationNote: string;
|
|
85
|
+
}
|
|
86
|
+
declare const DEFAULT_PCB_COLOR_MAP: PcbColorMap;
|
|
87
|
+
interface DrawerConfig {
|
|
88
|
+
colorOverrides?: Partial<PcbColorMap>;
|
|
89
|
+
}
|
|
90
|
+
interface CameraBounds {
|
|
91
|
+
minX: number;
|
|
92
|
+
maxX: number;
|
|
93
|
+
minY: number;
|
|
94
|
+
maxY: number;
|
|
95
|
+
}
|
|
96
|
+
interface DrawContext {
|
|
97
|
+
ctx: CanvasRenderingContext2D;
|
|
98
|
+
realToCanvasMat: Matrix;
|
|
99
|
+
colorMap: PcbColorMap;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface DrawElementsOptions {
|
|
103
|
+
layers?: PcbRenderLayer[];
|
|
104
|
+
/**
|
|
105
|
+
* Elements used only to find copper pours when clipping traces. This is
|
|
106
|
+
* useful when `elements` is a filtered subset, such as a trace-only render
|
|
107
|
+
* pass in an interactive viewer. Defaults to `elements`.
|
|
108
|
+
*/
|
|
109
|
+
clipContextElements?: AnyCircuitElement[];
|
|
110
|
+
/** Whether to render the soldermask layer. Defaults to false. */
|
|
111
|
+
drawSoldermask?: boolean;
|
|
112
|
+
/** Whether to render pcb_solder_paste elements. Defaults to false. */
|
|
113
|
+
drawSolderPaste?: boolean;
|
|
114
|
+
/** Render top solder-paste elements when drawSolderPaste is enabled. Defaults to true if both layer flags are unset. */
|
|
115
|
+
drawSolderPasteTop?: boolean;
|
|
116
|
+
/** Render bottom solder-paste elements when drawSolderPaste is enabled. */
|
|
117
|
+
drawSolderPasteBottom?: boolean;
|
|
118
|
+
/** Render top soldermask layer when drawSoldermask is enabled. Defaults to true if both layer flags are unset. */
|
|
119
|
+
drawSoldermaskTop?: boolean;
|
|
120
|
+
/** Render bottom soldermask layer when drawSoldermask is enabled. */
|
|
121
|
+
drawSoldermaskBottom?: boolean;
|
|
122
|
+
/** Whether to render the board material (substrate fill). Defaults to false. */
|
|
123
|
+
drawBoardMaterial?: boolean;
|
|
124
|
+
/** Minimum on-screen outline stroke width for pcb_board only. */
|
|
125
|
+
minBoardOutlineStrokePx?: number;
|
|
126
|
+
/** Whether to render pcb_note elements. Defaults to true. */
|
|
127
|
+
showPcbNotes?: boolean;
|
|
128
|
+
/** Clear drill holes and cutouts from the canvas instead of painting them with the drill color. Defaults to false. */
|
|
129
|
+
clearDrillHoles?: boolean;
|
|
130
|
+
}
|
|
131
|
+
interface CanvasLike {
|
|
132
|
+
getContext(contextId: "2d"): CanvasContext | null;
|
|
133
|
+
}
|
|
134
|
+
declare class CircuitToCanvasDrawer {
|
|
135
|
+
private ctx;
|
|
136
|
+
private colorMap;
|
|
137
|
+
realToCanvasMat: Matrix;
|
|
138
|
+
constructor(canvasOrContext: CanvasLike | CanvasContext);
|
|
139
|
+
configure(config: DrawerConfig): void;
|
|
140
|
+
setCameraBounds(bounds: CameraBounds): void;
|
|
141
|
+
drawElements(elements: AnyCircuitElement[], options?: DrawElementsOptions): void;
|
|
142
|
+
private clearDrillHoles;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface DrawArrowParams {
|
|
146
|
+
ctx: CanvasContext;
|
|
147
|
+
x: number;
|
|
148
|
+
y: number;
|
|
149
|
+
angle: number;
|
|
150
|
+
arrowSize: number;
|
|
151
|
+
color: string;
|
|
152
|
+
strokeWidth: number;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Draw an arrow at a point along a line
|
|
156
|
+
*/
|
|
157
|
+
declare function drawArrow(params: DrawArrowParams): void;
|
|
158
|
+
|
|
159
|
+
interface BrepShape {
|
|
160
|
+
outer_ring: Ring;
|
|
161
|
+
inner_rings?: Ring[];
|
|
162
|
+
}
|
|
163
|
+
interface AddBrepRingToPathParams {
|
|
164
|
+
ctx: CanvasContext;
|
|
165
|
+
ring: Ring;
|
|
166
|
+
realToCanvasMat: Matrix;
|
|
167
|
+
}
|
|
168
|
+
declare function addBrepRingToPath({ ctx, ring, realToCanvasMat, }: AddBrepRingToPathParams): void;
|
|
169
|
+
interface AddBrepShapeToPathParams {
|
|
170
|
+
ctx: CanvasContext;
|
|
171
|
+
shape: BrepShape;
|
|
172
|
+
realToCanvasMat: Matrix;
|
|
173
|
+
}
|
|
174
|
+
declare function addBrepShapeToPath({ ctx, shape, realToCanvasMat, }: AddBrepShapeToPathParams): void;
|
|
175
|
+
|
|
176
|
+
interface DrawCircleParams {
|
|
177
|
+
ctx: CanvasContext;
|
|
178
|
+
center: {
|
|
179
|
+
x: number;
|
|
180
|
+
y: number;
|
|
181
|
+
};
|
|
182
|
+
radius: number;
|
|
183
|
+
fill?: string;
|
|
184
|
+
realToCanvasMat: Matrix;
|
|
185
|
+
stroke?: string;
|
|
186
|
+
strokeWidth?: number;
|
|
187
|
+
isStrokeDashed?: boolean;
|
|
188
|
+
}
|
|
189
|
+
declare function drawCircle(params: DrawCircleParams): void;
|
|
190
|
+
|
|
191
|
+
interface DrawDimensionLineParams {
|
|
192
|
+
ctx: CanvasContext;
|
|
193
|
+
from: {
|
|
194
|
+
x: number;
|
|
195
|
+
y: number;
|
|
196
|
+
};
|
|
197
|
+
to: {
|
|
198
|
+
x: number;
|
|
199
|
+
y: number;
|
|
200
|
+
};
|
|
201
|
+
realToCanvasMat: Matrix;
|
|
202
|
+
color: string;
|
|
203
|
+
fontSize: number;
|
|
204
|
+
arrowSize?: number;
|
|
205
|
+
strokeWidth?: number;
|
|
206
|
+
text?: string;
|
|
207
|
+
textRotation?: number;
|
|
208
|
+
offset?: {
|
|
209
|
+
distance: number;
|
|
210
|
+
direction: {
|
|
211
|
+
x: number;
|
|
212
|
+
y: number;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
declare function drawDimensionLine(params: DrawDimensionLineParams): void;
|
|
217
|
+
|
|
218
|
+
interface DrawLineParams {
|
|
219
|
+
ctx: CanvasContext;
|
|
220
|
+
start: {
|
|
221
|
+
x: number;
|
|
222
|
+
y: number;
|
|
223
|
+
};
|
|
224
|
+
end: {
|
|
225
|
+
x: number;
|
|
226
|
+
y: number;
|
|
227
|
+
};
|
|
228
|
+
strokeWidth: number;
|
|
229
|
+
stroke: string;
|
|
230
|
+
realToCanvasMat: Matrix;
|
|
231
|
+
lineCap?: "butt" | "round" | "square";
|
|
232
|
+
}
|
|
233
|
+
declare function drawLine(params: DrawLineParams): void;
|
|
234
|
+
|
|
235
|
+
interface DrawOvalParams {
|
|
236
|
+
ctx: CanvasContext;
|
|
237
|
+
center: {
|
|
238
|
+
x: number;
|
|
239
|
+
y: number;
|
|
240
|
+
};
|
|
241
|
+
radius_x: number;
|
|
242
|
+
radius_y: number;
|
|
243
|
+
fill?: string;
|
|
244
|
+
stroke?: string;
|
|
245
|
+
strokeWidth?: number;
|
|
246
|
+
realToCanvasMat: Matrix;
|
|
247
|
+
rotation?: number;
|
|
248
|
+
}
|
|
249
|
+
declare function drawOval(params: DrawOvalParams): void;
|
|
250
|
+
|
|
251
|
+
interface DrawPathParams {
|
|
252
|
+
ctx: CanvasContext;
|
|
253
|
+
points: Array<{
|
|
254
|
+
x: number;
|
|
255
|
+
y: number;
|
|
256
|
+
}>;
|
|
257
|
+
fill?: string;
|
|
258
|
+
stroke?: string;
|
|
259
|
+
strokeWidth?: number;
|
|
260
|
+
minStrokePx?: number;
|
|
261
|
+
realToCanvasMat: Matrix;
|
|
262
|
+
closePath?: boolean;
|
|
263
|
+
}
|
|
264
|
+
declare function drawPath(params: DrawPathParams): void;
|
|
265
|
+
|
|
266
|
+
interface DrawPillParams {
|
|
267
|
+
ctx: CanvasContext;
|
|
268
|
+
center: {
|
|
269
|
+
x: number;
|
|
270
|
+
y: number;
|
|
271
|
+
};
|
|
272
|
+
width: number;
|
|
273
|
+
height: number;
|
|
274
|
+
fill?: string;
|
|
275
|
+
realToCanvasMat: Matrix;
|
|
276
|
+
rotation?: number;
|
|
277
|
+
stroke?: string;
|
|
278
|
+
strokeWidth?: number;
|
|
279
|
+
}
|
|
280
|
+
declare function drawPill(params: DrawPillParams): void;
|
|
281
|
+
|
|
282
|
+
interface DrawPolygonParams {
|
|
283
|
+
ctx: CanvasContext;
|
|
284
|
+
points: Array<{
|
|
285
|
+
x: number;
|
|
286
|
+
y: number;
|
|
287
|
+
}>;
|
|
288
|
+
fill: string;
|
|
289
|
+
realToCanvasMat: Matrix;
|
|
290
|
+
}
|
|
291
|
+
declare function drawPolygon(params: DrawPolygonParams): void;
|
|
292
|
+
|
|
293
|
+
interface DrawRectParams {
|
|
294
|
+
ctx: CanvasContext;
|
|
295
|
+
center: {
|
|
296
|
+
x: number;
|
|
297
|
+
y: number;
|
|
298
|
+
};
|
|
299
|
+
width: number;
|
|
300
|
+
height: number;
|
|
301
|
+
fill?: string;
|
|
302
|
+
realToCanvasMat: Matrix;
|
|
303
|
+
borderRadius?: number;
|
|
304
|
+
ccwRotationDegrees?: number;
|
|
305
|
+
stroke?: string;
|
|
306
|
+
strokeWidth?: number;
|
|
307
|
+
isStrokeDashed?: boolean;
|
|
308
|
+
lineJoin?: CanvasLineJoin;
|
|
309
|
+
}
|
|
310
|
+
declare function drawRect(params: DrawRectParams): void;
|
|
311
|
+
|
|
312
|
+
type AlphabetLayout = {
|
|
313
|
+
width: number;
|
|
314
|
+
height: number;
|
|
315
|
+
glyphWidth: number;
|
|
316
|
+
letterSpacing: number;
|
|
317
|
+
spaceWidth: number;
|
|
318
|
+
strokeWidth: number;
|
|
319
|
+
lineHeight: number;
|
|
320
|
+
lines: string[];
|
|
321
|
+
lineWidths: number[];
|
|
322
|
+
};
|
|
323
|
+
declare function getAlphabetLayout(text: string, fontSize: number): AlphabetLayout;
|
|
324
|
+
|
|
325
|
+
interface StrokeAlphabetTextParams {
|
|
326
|
+
ctx: CanvasContext;
|
|
327
|
+
text: string;
|
|
328
|
+
fontSize: number;
|
|
329
|
+
startX: number;
|
|
330
|
+
startY: number;
|
|
331
|
+
anchorAlignment?: NinePointAnchor;
|
|
332
|
+
}
|
|
333
|
+
declare function strokeAlphabetText(params: StrokeAlphabetTextParams): void;
|
|
334
|
+
interface DrawTextParams {
|
|
335
|
+
ctx: CanvasContext;
|
|
336
|
+
text: string;
|
|
337
|
+
x: number;
|
|
338
|
+
y: number;
|
|
339
|
+
fontSize: number;
|
|
340
|
+
color: string;
|
|
341
|
+
realToCanvasMat: Matrix;
|
|
342
|
+
anchorAlignment: NinePointAnchor;
|
|
343
|
+
rotation?: number;
|
|
344
|
+
mirrorX?: boolean;
|
|
345
|
+
knockout?: boolean;
|
|
346
|
+
knockoutPadding?: {
|
|
347
|
+
top?: number;
|
|
348
|
+
bottom?: number;
|
|
349
|
+
left?: number;
|
|
350
|
+
right?: number;
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
declare function drawText(params: DrawTextParams): void;
|
|
354
|
+
|
|
355
|
+
type AnchorAlignment = NinePointAnchor;
|
|
356
|
+
declare function getTextStartPosition(alignment: NinePointAnchor, layout: AlphabetLayout, fontSize: number): {
|
|
357
|
+
x: number;
|
|
358
|
+
y: number;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
interface DrawPcbPlatedHoleParams {
|
|
362
|
+
ctx: CanvasContext;
|
|
363
|
+
hole: PcbPlatedHole;
|
|
364
|
+
realToCanvasMat: Matrix;
|
|
365
|
+
colorMap: PcbColorMap;
|
|
366
|
+
soldermaskMargin?: number;
|
|
367
|
+
drawSoldermask?: boolean;
|
|
368
|
+
layer?: LayerRef;
|
|
369
|
+
}
|
|
370
|
+
declare function drawPcbPlatedHole(params: DrawPcbPlatedHoleParams): void;
|
|
371
|
+
|
|
372
|
+
interface DrawPcbViaParams {
|
|
373
|
+
ctx: CanvasContext;
|
|
374
|
+
via: PCBVia;
|
|
375
|
+
realToCanvasMat: Matrix;
|
|
376
|
+
colorMap: PcbColorMap;
|
|
377
|
+
layer?: LayerRef;
|
|
378
|
+
}
|
|
379
|
+
declare function drawPcbVia(params: DrawPcbViaParams): void;
|
|
380
|
+
|
|
381
|
+
interface DrawPcbHoleParams {
|
|
382
|
+
ctx: CanvasContext;
|
|
383
|
+
hole: PcbHole;
|
|
384
|
+
realToCanvasMat: Matrix;
|
|
385
|
+
colorMap: PcbColorMap;
|
|
386
|
+
soldermaskMargin?: number;
|
|
387
|
+
drawSoldermask?: boolean;
|
|
388
|
+
}
|
|
389
|
+
declare function drawPcbHole(params: DrawPcbHoleParams): void;
|
|
390
|
+
|
|
391
|
+
interface DrawPcbSmtPadParams {
|
|
392
|
+
ctx: CanvasContext;
|
|
393
|
+
pad: PcbSmtPad;
|
|
394
|
+
realToCanvasMat: Matrix;
|
|
395
|
+
colorMap: PcbColorMap;
|
|
396
|
+
holes?: PcbHole[];
|
|
397
|
+
platedHoles?: PcbPlatedHole[];
|
|
398
|
+
vias?: PcbVia[];
|
|
399
|
+
cutouts?: PcbCutout[];
|
|
400
|
+
}
|
|
401
|
+
declare function drawPcbSmtPad(params: DrawPcbSmtPadParams): void;
|
|
402
|
+
|
|
403
|
+
interface DrawPcbSolderPasteParams {
|
|
404
|
+
ctx: CanvasContext;
|
|
405
|
+
solderPaste: PcbSolderPaste;
|
|
406
|
+
realToCanvasMat: Matrix;
|
|
407
|
+
}
|
|
408
|
+
declare function drawPcbSolderPaste(params: DrawPcbSolderPasteParams): void;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Draws a soldermask ring for rectangular shapes with negative margin
|
|
412
|
+
* (soldermask appears inside the pad boundary)
|
|
413
|
+
*/
|
|
414
|
+
declare function drawSoldermaskRingForRect(ctx: CanvasContext, center: {
|
|
415
|
+
x: number;
|
|
416
|
+
y: number;
|
|
417
|
+
}, width: number, height: number, margin: number, borderRadius: number, rotation: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string, asymmetricMargins?: {
|
|
418
|
+
left: number;
|
|
419
|
+
right: number;
|
|
420
|
+
top: number;
|
|
421
|
+
bottom: number;
|
|
422
|
+
}): void;
|
|
423
|
+
/**
|
|
424
|
+
* Draws a soldermask ring for circular shapes with negative margin
|
|
425
|
+
* (soldermask appears inside the pad boundary)
|
|
426
|
+
*/
|
|
427
|
+
declare function drawSoldermaskRingForCircle(ctx: CanvasContext, center: {
|
|
428
|
+
x: number;
|
|
429
|
+
y: number;
|
|
430
|
+
}, radius: number, margin: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string): void;
|
|
431
|
+
/**
|
|
432
|
+
* Draws a soldermask ring for pill shapes with negative margin
|
|
433
|
+
* (soldermask appears inside the pad boundary)
|
|
434
|
+
*/
|
|
435
|
+
declare function drawSoldermaskRingForPill(ctx: CanvasContext, center: {
|
|
436
|
+
x: number;
|
|
437
|
+
y: number;
|
|
438
|
+
}, width: number, height: number, margin: number, rotation: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string): void;
|
|
439
|
+
/**
|
|
440
|
+
* Draws a soldermask ring for oval shapes with negative margin
|
|
441
|
+
* (soldermask appears inside the hole boundary)
|
|
442
|
+
*/
|
|
443
|
+
declare function drawSoldermaskRingForOval(ctx: CanvasContext, center: {
|
|
444
|
+
x: number;
|
|
445
|
+
y: number;
|
|
446
|
+
}, radius_x: number, radius_y: number, margin: number, rotation: number, realToCanvasMat: Matrix, soldermaskColor: string, holeColor: string): void;
|
|
447
|
+
|
|
448
|
+
interface DrawPcbTraceParams {
|
|
449
|
+
ctx: CanvasContext;
|
|
450
|
+
trace: PcbTrace;
|
|
451
|
+
realToCanvasMat: Matrix;
|
|
452
|
+
colorMap: PcbColorMap;
|
|
453
|
+
vias?: PcbVia[];
|
|
454
|
+
platedHoles?: PcbPlatedHole[];
|
|
455
|
+
layer?: LayerRef;
|
|
456
|
+
}
|
|
457
|
+
declare function drawPcbTrace(params: DrawPcbTraceParams): void;
|
|
458
|
+
|
|
459
|
+
interface DrawPcbBoardParams {
|
|
460
|
+
ctx: CanvasContext;
|
|
461
|
+
board: PcbBoard;
|
|
462
|
+
realToCanvasMat: Matrix;
|
|
463
|
+
colorMap: PcbColorMap;
|
|
464
|
+
drawBoardMaterial: boolean;
|
|
465
|
+
minBoardOutlineStrokePx?: number;
|
|
466
|
+
}
|
|
467
|
+
declare function drawPcbBoard(params: DrawPcbBoardParams): void;
|
|
468
|
+
|
|
469
|
+
interface DrawPcbPanelParams {
|
|
470
|
+
ctx: CanvasContext;
|
|
471
|
+
panel: PcbPanel;
|
|
472
|
+
realToCanvasMat: Matrix;
|
|
473
|
+
colorMap: PcbColorMap;
|
|
474
|
+
drawBoardMaterial: boolean;
|
|
475
|
+
}
|
|
476
|
+
declare function drawPcbPanelElement(params: DrawPcbPanelParams): void;
|
|
477
|
+
|
|
478
|
+
interface DrawPcbSilkscreenTextParams {
|
|
479
|
+
ctx: CanvasContext;
|
|
480
|
+
text: PcbSilkscreenText;
|
|
481
|
+
realToCanvasMat: Matrix;
|
|
482
|
+
colorMap: PcbColorMap;
|
|
483
|
+
}
|
|
484
|
+
declare function drawPcbSilkscreenText(params: DrawPcbSilkscreenTextParams): void;
|
|
485
|
+
|
|
486
|
+
interface DrawPcbSilkscreenRectParams {
|
|
487
|
+
ctx: CanvasContext;
|
|
488
|
+
rect: PcbSilkscreenRect;
|
|
489
|
+
realToCanvasMat: Matrix;
|
|
490
|
+
colorMap: PcbColorMap;
|
|
491
|
+
}
|
|
492
|
+
declare function drawPcbSilkscreenRect(params: DrawPcbSilkscreenRectParams): void;
|
|
493
|
+
|
|
494
|
+
interface DrawPcbSilkscreenCircleParams {
|
|
495
|
+
ctx: CanvasContext;
|
|
496
|
+
circle: PcbSilkscreenCircle;
|
|
497
|
+
realToCanvasMat: Matrix;
|
|
498
|
+
colorMap: PcbColorMap;
|
|
499
|
+
}
|
|
500
|
+
declare function drawPcbSilkscreenCircle(params: DrawPcbSilkscreenCircleParams): void;
|
|
501
|
+
|
|
502
|
+
interface DrawPcbSilkscreenGraphicParams {
|
|
503
|
+
ctx: CanvasContext;
|
|
504
|
+
graphic: PcbSilkscreenGraphic;
|
|
505
|
+
realToCanvasMat: Matrix;
|
|
506
|
+
colorMap: PcbColorMap;
|
|
507
|
+
}
|
|
508
|
+
declare function drawPcbSilkscreenGraphic(params: DrawPcbSilkscreenGraphicParams): void;
|
|
509
|
+
|
|
510
|
+
interface DrawPcbSilkscreenLineParams {
|
|
511
|
+
ctx: CanvasContext;
|
|
512
|
+
line: PcbSilkscreenLine;
|
|
513
|
+
realToCanvasMat: Matrix;
|
|
514
|
+
colorMap: PcbColorMap;
|
|
515
|
+
}
|
|
516
|
+
declare function drawPcbSilkscreenLine(params: DrawPcbSilkscreenLineParams): void;
|
|
517
|
+
|
|
518
|
+
interface DrawPcbSilkscreenPathParams {
|
|
519
|
+
ctx: CanvasContext;
|
|
520
|
+
path: PcbSilkscreenPath;
|
|
521
|
+
realToCanvasMat: Matrix;
|
|
522
|
+
colorMap: PcbColorMap;
|
|
523
|
+
}
|
|
524
|
+
declare function drawPcbSilkscreenPath(params: DrawPcbSilkscreenPathParams): void;
|
|
525
|
+
|
|
526
|
+
interface DrawPcbSilkscreenPillParams {
|
|
527
|
+
ctx: CanvasContext;
|
|
528
|
+
pill: PcbSilkscreenPill;
|
|
529
|
+
realToCanvasMat: Matrix;
|
|
530
|
+
colorMap: PcbColorMap;
|
|
531
|
+
}
|
|
532
|
+
declare function drawPcbSilkscreenPill(params: DrawPcbSilkscreenPillParams): void;
|
|
533
|
+
|
|
534
|
+
interface DrawPcbSilkscreenOvalParams {
|
|
535
|
+
ctx: CanvasContext;
|
|
536
|
+
oval: PcbSilkscreenOval;
|
|
537
|
+
realToCanvasMat: Matrix;
|
|
538
|
+
colorMap: PcbColorMap;
|
|
539
|
+
}
|
|
540
|
+
declare function drawPcbSilkscreenOval(params: DrawPcbSilkscreenOvalParams): void;
|
|
541
|
+
|
|
542
|
+
interface DrawPcbCutoutParams {
|
|
543
|
+
ctx: CanvasContext;
|
|
544
|
+
cutout: PcbCutout;
|
|
545
|
+
realToCanvasMat: Matrix;
|
|
546
|
+
colorMap: PcbColorMap;
|
|
547
|
+
}
|
|
548
|
+
declare function drawPcbCutout(params: DrawPcbCutoutParams): void;
|
|
549
|
+
|
|
550
|
+
interface DrawPcbKeepoutParams {
|
|
551
|
+
ctx: CanvasContext;
|
|
552
|
+
keepout: PCBKeepout;
|
|
553
|
+
realToCanvasMat: Matrix;
|
|
554
|
+
colorMap: PcbColorMap;
|
|
555
|
+
}
|
|
556
|
+
declare function drawPcbKeepout(params: DrawPcbKeepoutParams): void;
|
|
557
|
+
|
|
558
|
+
interface DrawPcbCopperPourParams {
|
|
559
|
+
ctx: CanvasContext;
|
|
560
|
+
pour: PcbCopperPour;
|
|
561
|
+
realToCanvasMat: Matrix;
|
|
562
|
+
colorMap: PcbColorMap;
|
|
563
|
+
}
|
|
564
|
+
declare function drawPcbCopperPour(params: DrawPcbCopperPourParams): void;
|
|
565
|
+
|
|
566
|
+
interface DrawPcbCopperTextParams {
|
|
567
|
+
ctx: CanvasContext;
|
|
568
|
+
text: PcbCopperText;
|
|
569
|
+
realToCanvasMat: Matrix;
|
|
570
|
+
colorMap: PcbColorMap;
|
|
571
|
+
}
|
|
572
|
+
declare function drawPcbCopperText(params: DrawPcbCopperTextParams): void;
|
|
573
|
+
|
|
574
|
+
interface DrawPcbFabricationNoteTextParams {
|
|
575
|
+
ctx: CanvasContext;
|
|
576
|
+
text: PcbFabricationNoteText;
|
|
577
|
+
realToCanvasMat: Matrix;
|
|
578
|
+
colorMap: PcbColorMap;
|
|
579
|
+
}
|
|
580
|
+
declare function drawPcbFabricationNoteText(params: DrawPcbFabricationNoteTextParams): void;
|
|
581
|
+
|
|
582
|
+
interface DrawPcbFabricationNoteRectParams {
|
|
583
|
+
ctx: CanvasContext;
|
|
584
|
+
rect: PcbFabricationNoteRect;
|
|
585
|
+
realToCanvasMat: Matrix;
|
|
586
|
+
colorMap: PcbColorMap;
|
|
587
|
+
}
|
|
588
|
+
declare function drawPcbFabricationNoteRect(params: DrawPcbFabricationNoteRectParams): void;
|
|
589
|
+
|
|
590
|
+
interface DrawPcbNoteRectParams {
|
|
591
|
+
ctx: CanvasContext;
|
|
592
|
+
rect: PcbNoteRect;
|
|
593
|
+
realToCanvasMat: Matrix;
|
|
594
|
+
colorMap: PcbColorMap;
|
|
595
|
+
}
|
|
596
|
+
declare function drawPcbNoteRect(params: DrawPcbNoteRectParams): void;
|
|
597
|
+
|
|
598
|
+
interface DrawPcbFabricationNotePathParams {
|
|
599
|
+
ctx: CanvasContext;
|
|
600
|
+
path: PcbFabricationNotePath;
|
|
601
|
+
realToCanvasMat: Matrix;
|
|
602
|
+
colorMap: PcbColorMap;
|
|
603
|
+
}
|
|
604
|
+
declare function drawPcbFabricationNotePath(params: DrawPcbFabricationNotePathParams): void;
|
|
605
|
+
|
|
606
|
+
interface DrawPcbNotePathParams {
|
|
607
|
+
ctx: CanvasContext;
|
|
608
|
+
path: PcbNotePath;
|
|
609
|
+
realToCanvasMat: Matrix;
|
|
610
|
+
colorMap: PcbColorMap;
|
|
611
|
+
}
|
|
612
|
+
declare function drawPcbNotePath(params: DrawPcbNotePathParams): void;
|
|
613
|
+
|
|
614
|
+
interface DrawPcbNoteTextParams {
|
|
615
|
+
ctx: CanvasContext;
|
|
616
|
+
text: PcbNoteText;
|
|
617
|
+
realToCanvasMat: Matrix;
|
|
618
|
+
colorMap: PcbColorMap;
|
|
619
|
+
}
|
|
620
|
+
declare function drawPcbNoteText(params: DrawPcbNoteTextParams): void;
|
|
621
|
+
|
|
622
|
+
interface DrawPcbNoteDimensionParams {
|
|
623
|
+
ctx: CanvasContext;
|
|
624
|
+
pcbNoteDimension: PcbNoteDimension;
|
|
625
|
+
realToCanvasMat: Matrix;
|
|
626
|
+
colorMap: PcbColorMap;
|
|
627
|
+
}
|
|
628
|
+
declare function drawPcbNoteDimension(params: DrawPcbNoteDimensionParams): void;
|
|
629
|
+
|
|
630
|
+
interface DrawPcbFabricationNoteDimensionParams {
|
|
631
|
+
ctx: CanvasContext;
|
|
632
|
+
pcbFabricationNoteDimension: PcbFabricationNoteDimension;
|
|
633
|
+
realToCanvasMat: Matrix;
|
|
634
|
+
colorMap: PcbColorMap;
|
|
635
|
+
}
|
|
636
|
+
declare function drawPcbFabricationNoteDimension(params: DrawPcbFabricationNoteDimensionParams): void;
|
|
637
|
+
|
|
638
|
+
interface DrawPcbCourtyardCircleParams {
|
|
639
|
+
ctx: CanvasContext;
|
|
640
|
+
circle: PcbCourtyardCircle;
|
|
641
|
+
realToCanvasMat: Matrix;
|
|
642
|
+
colorMap: PcbColorMap;
|
|
643
|
+
}
|
|
644
|
+
declare function drawPcbCourtyardCircle(params: DrawPcbCourtyardCircleParams): void;
|
|
645
|
+
|
|
646
|
+
export { type AddBrepRingToPathParams, type AddBrepShapeToPathParams, type AlphabetLayout, type AnchorAlignment, type BrepShape, type CameraBounds, type CanvasContext, CircuitToCanvasDrawer, type CopperColorMap, type CopperLayerName, DEFAULT_PCB_COLOR_MAP, type DrawArrowParams, type DrawCircleParams, type DrawContext, type DrawDimensionLineParams, type DrawElementsOptions, type DrawLineParams, type DrawOvalParams, type DrawPathParams, type DrawPcbBoardParams, type DrawPcbCopperPourParams, type DrawPcbCopperTextParams, type DrawPcbCourtyardCircleParams, type DrawPcbCutoutParams, type DrawPcbFabricationNoteDimensionParams, type DrawPcbFabricationNotePathParams, type DrawPcbFabricationNoteRectParams, type DrawPcbFabricationNoteTextParams, type DrawPcbHoleParams, type DrawPcbKeepoutParams, type DrawPcbNoteDimensionParams, type DrawPcbNotePathParams, type DrawPcbNoteRectParams, type DrawPcbNoteTextParams, type DrawPcbPanelParams, type DrawPcbPlatedHoleParams, type DrawPcbSilkscreenCircleParams, type DrawPcbSilkscreenGraphicParams, type DrawPcbSilkscreenLineParams, type DrawPcbSilkscreenOvalParams, type DrawPcbSilkscreenPathParams, type DrawPcbSilkscreenPillParams, type DrawPcbSilkscreenRectParams, type DrawPcbSilkscreenTextParams, type DrawPcbSmtPadParams, type DrawPcbSolderPasteParams, type DrawPcbTraceParams, type DrawPcbViaParams, type DrawPillParams, type DrawPolygonParams, type DrawRectParams, type DrawTextParams, type DrawerConfig, type PcbColorMap, addBrepRingToPath, addBrepShapeToPath, drawArrow, drawCircle, drawDimensionLine, drawLine, drawOval, drawPath, drawPcbBoard, drawPcbCopperPour, drawPcbCopperText, drawPcbCourtyardCircle, drawPcbCutout, drawPcbFabricationNoteDimension, drawPcbFabricationNotePath, drawPcbFabricationNoteRect, drawPcbFabricationNoteText, drawPcbHole, drawPcbKeepout, drawPcbNoteDimension, drawPcbNotePath, drawPcbNoteRect, drawPcbNoteText, drawPcbPanelElement, drawPcbPlatedHole, drawPcbSilkscreenCircle, drawPcbSilkscreenGraphic, drawPcbSilkscreenLine, drawPcbSilkscreenOval, drawPcbSilkscreenPath, drawPcbSilkscreenPill, drawPcbSilkscreenRect, drawPcbSilkscreenText, drawPcbSmtPad, drawPcbSolderPaste, drawPcbTrace, drawPcbVia, drawPill, drawPolygon, drawRect, drawSoldermaskRingForCircle, drawSoldermaskRingForOval, drawSoldermaskRingForPill, drawSoldermaskRingForRect, drawText, getAlphabetLayout, getTextStartPosition, strokeAlphabetText };
|