circuit-to-canvas 0.0.30 → 0.0.32

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnyCircuitElement, PcbRenderLayer, NinePointAnchor, PcbPlatedHole, PCBVia, PCBHole, PcbSmtPad, PCBTrace, PcbBoard, PcbSilkscreenText, PcbSilkscreenRect, PcbSilkscreenCircle, PcbSilkscreenLine, PcbSilkscreenPath, PcbSilkscreenPill, PcbCutout, PcbCopperPour, PcbCopperText, PcbFabricationNoteText, PcbFabricationNoteRect, PcbNoteRect, PcbFabricationNotePath, PcbNotePath, PcbNoteText, PcbNoteDimension } from 'circuit-json';
1
+ import { AnyCircuitElement, PcbRenderLayer, NinePointAnchor, PcbPlatedHole, PCBVia, PCBHole, PcbSmtPad, PCBTrace, PcbBoard, PcbSilkscreenText, PcbSilkscreenRect, PcbSilkscreenCircle, PcbSilkscreenLine, PcbSilkscreenPath, PcbSilkscreenPill, PcbSilkscreenOval, PcbCutout, PcbCopperPour, PcbCopperText, PcbFabricationNoteText, PcbFabricationNoteRect, PcbNoteRect, PcbFabricationNotePath, PcbNotePath, PcbNoteText, PcbNoteDimension } from 'circuit-json';
2
2
  import { Matrix } from 'transformation-matrix';
3
3
 
4
4
  /**
@@ -99,6 +99,7 @@ declare class CircuitToCanvasDrawer {
99
99
  configure(config: DrawerConfig): void;
100
100
  setCameraBounds(bounds: CameraBounds): void;
101
101
  drawElements(elements: AnyCircuitElement[], options?: DrawElementsOptions): void;
102
+ private drawBoardWithSoldermask;
102
103
  private drawElement;
103
104
  }
104
105
 
@@ -138,9 +139,11 @@ interface DrawOvalParams {
138
139
  x: number;
139
140
  y: number;
140
141
  };
141
- width: number;
142
- height: number;
143
- fill: string;
142
+ radius_x: number;
143
+ radius_y: number;
144
+ fill?: string;
145
+ stroke?: string;
146
+ strokeWidth?: number;
144
147
  realToCanvasMat: Matrix;
145
148
  rotation?: number;
146
149
  }
@@ -287,6 +290,31 @@ interface DrawPcbSmtPadParams {
287
290
  }
288
291
  declare function drawPcbSmtPad(params: DrawPcbSmtPadParams): void;
289
292
 
293
+ /**
294
+ * Draws a soldermask ring for rectangular shapes with negative margin
295
+ * (soldermask appears inside the pad boundary)
296
+ */
297
+ declare function drawSoldermaskRingForRect(ctx: CanvasContext, center: {
298
+ x: number;
299
+ y: number;
300
+ }, width: number, height: number, margin: number, borderRadius: number, rotation: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string): void;
301
+ /**
302
+ * Draws a soldermask ring for circular shapes with negative margin
303
+ * (soldermask appears inside the pad boundary)
304
+ */
305
+ declare function drawSoldermaskRingForCircle(ctx: CanvasContext, center: {
306
+ x: number;
307
+ y: number;
308
+ }, radius: number, margin: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string): void;
309
+ /**
310
+ * Draws a soldermask ring for pill shapes with negative margin
311
+ * (soldermask appears inside the pad boundary)
312
+ */
313
+ declare function drawSoldermaskRingForPill(ctx: CanvasContext, center: {
314
+ x: number;
315
+ y: number;
316
+ }, width: number, height: number, margin: number, rotation: number, realToCanvasMat: Matrix, soldermaskColor: string, padColor: string): void;
317
+
290
318
  interface DrawPcbTraceParams {
291
319
  ctx: CanvasContext;
292
320
  trace: PCBTrace;
@@ -351,6 +379,14 @@ interface DrawPcbSilkscreenPillParams {
351
379
  }
352
380
  declare function drawPcbSilkscreenPill(params: DrawPcbSilkscreenPillParams): void;
353
381
 
382
+ interface DrawPcbSilkscreenOvalParams {
383
+ ctx: CanvasContext;
384
+ oval: PcbSilkscreenOval;
385
+ realToCanvasMat: Matrix;
386
+ colorMap: PcbColorMap;
387
+ }
388
+ declare function drawPcbSilkscreenOval(params: DrawPcbSilkscreenOvalParams): void;
389
+
354
390
  interface DrawPcbCutoutParams {
355
391
  ctx: CanvasContext;
356
392
  cutout: PcbCutout;
@@ -431,4 +467,4 @@ interface DrawPcbNoteDimensionParams {
431
467
  }
432
468
  declare function drawPcbNoteDimension(params: DrawPcbNoteDimensionParams): void;
433
469
 
434
- export { type AlphabetLayout, type AnchorAlignment, type CameraBounds, type CanvasContext, CircuitToCanvasDrawer, type CopperColorMap, type CopperLayerName, DEFAULT_PCB_COLOR_MAP, type DrawArrowParams, type DrawCircleParams, type DrawContext, type DrawElementsOptions, type DrawLineParams, type DrawOvalParams, type DrawPathParams, type DrawPcbBoardParams, type DrawPcbCopperPourParams, type DrawPcbCopperTextParams, type DrawPcbCutoutParams, type DrawPcbFabricationNotePathParams, type DrawPcbFabricationNoteRectParams, type DrawPcbFabricationNoteTextParams, type DrawPcbHoleParams, type DrawPcbNoteDimensionParams, type DrawPcbNotePathParams, type DrawPcbNoteRectParams, type DrawPcbNoteTextParams, type DrawPcbPlatedHoleParams, type DrawPcbSilkscreenCircleParams, type DrawPcbSilkscreenLineParams, type DrawPcbSilkscreenPathParams, type DrawPcbSilkscreenPillParams, type DrawPcbSilkscreenRectParams, type DrawPcbSilkscreenTextParams, type DrawPcbSmtPadParams, type DrawPcbTraceParams, type DrawPcbViaParams, type DrawPillParams, type DrawPolygonParams, type DrawRectParams, type DrawTextParams, type DrawerConfig, type PcbColorMap, drawArrow, drawCircle, drawLine, drawOval, drawPath, drawPcbBoard, drawPcbCopperPour, drawPcbCopperText, drawPcbCutout, drawPcbFabricationNotePath, drawPcbFabricationNoteRect, drawPcbFabricationNoteText, drawPcbHole, drawPcbNoteDimension, drawPcbNotePath, drawPcbNoteRect, drawPcbNoteText, drawPcbPlatedHole, drawPcbSilkscreenCircle, drawPcbSilkscreenLine, drawPcbSilkscreenPath, drawPcbSilkscreenPill, drawPcbSilkscreenRect, drawPcbSilkscreenText, drawPcbSmtPad, drawPcbTrace, drawPcbVia, drawPill, drawPolygon, drawRect, drawText, getAlphabetLayout, getTextStartPosition, strokeAlphabetText };
470
+ export { type AlphabetLayout, type AnchorAlignment, type CameraBounds, type CanvasContext, CircuitToCanvasDrawer, type CopperColorMap, type CopperLayerName, DEFAULT_PCB_COLOR_MAP, type DrawArrowParams, type DrawCircleParams, type DrawContext, type DrawElementsOptions, type DrawLineParams, type DrawOvalParams, type DrawPathParams, type DrawPcbBoardParams, type DrawPcbCopperPourParams, type DrawPcbCopperTextParams, type DrawPcbCutoutParams, type DrawPcbFabricationNotePathParams, type DrawPcbFabricationNoteRectParams, type DrawPcbFabricationNoteTextParams, type DrawPcbHoleParams, type DrawPcbNoteDimensionParams, type DrawPcbNotePathParams, type DrawPcbNoteRectParams, type DrawPcbNoteTextParams, type DrawPcbPlatedHoleParams, type DrawPcbSilkscreenCircleParams, type DrawPcbSilkscreenLineParams, type DrawPcbSilkscreenOvalParams, type DrawPcbSilkscreenPathParams, type DrawPcbSilkscreenPillParams, type DrawPcbSilkscreenRectParams, type DrawPcbSilkscreenTextParams, type DrawPcbSmtPadParams, type DrawPcbTraceParams, type DrawPcbViaParams, type DrawPillParams, type DrawPolygonParams, type DrawRectParams, type DrawTextParams, type DrawerConfig, type PcbColorMap, drawArrow, drawCircle, drawLine, drawOval, drawPath, drawPcbBoard, drawPcbCopperPour, drawPcbCopperText, drawPcbCutout, drawPcbFabricationNotePath, drawPcbFabricationNoteRect, drawPcbFabricationNoteText, drawPcbHole, drawPcbNoteDimension, drawPcbNotePath, drawPcbNoteRect, drawPcbNoteText, drawPcbPlatedHole, drawPcbSilkscreenCircle, drawPcbSilkscreenLine, drawPcbSilkscreenOval, drawPcbSilkscreenPath, drawPcbSilkscreenPill, drawPcbSilkscreenRect, drawPcbSilkscreenText, drawPcbSmtPad, drawPcbTrace, drawPcbVia, drawPill, drawPolygon, drawRect, drawSoldermaskRingForCircle, drawSoldermaskRingForPill, drawSoldermaskRingForRect, drawText, getAlphabetLayout, getTextStartPosition, strokeAlphabetText };