circuit-to-canvas 0.0.45 → 0.0.47
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.js +530 -163
- package/lib/drawer/CircuitToCanvasDrawer.ts +1 -5
- package/lib/drawer/elements/pcb-hole.ts +248 -61
- package/lib/drawer/elements/pcb-plated-hole.ts +234 -107
- package/lib/drawer/elements/pcb-smtpad.ts +43 -21
- package/lib/drawer/elements/soldermask-margin.ts +130 -0
- package/package.json +1 -1
- package/tests/board-snapshot/__snapshots__/usb-c-flashlight-board.snap.png +0 -0
- package/tests/elements/__snapshots__/board-with-elements.snap.png +0 -0
- package/tests/elements/__snapshots__/custom-outline-board.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-board.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-comprehensive-soldermask-margin.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-fabrication-note-dimension.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-hole-soldermask-margin.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-keepout-layer-filter.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-keepout-multiple-layers.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-keepout-rect-and-circle.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-keepout-with-group-id.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-note-dimension-with-offset.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-plated-hole-soldermask-margin.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-silkscreen-oval.snap.png +0 -0
- package/tests/elements/__snapshots__/pcb-smtpad-soldermask-margin.snap.png +0 -0
- package/tests/elements/pcb-comprehensive-soldermask-margin.test.ts +1281 -0
- package/tests/elements/pcb-hole-soldermask-margin.test.ts +5 -5
- package/tests/elements/pcb-plated-hole-soldermask-margin.test.ts +8 -8
- package/tests/elements/pcb-smtpad-soldermask-margin.test.ts +0 -6
- package/tests/shapes/__snapshots__/dimension-line.snap.png +0 -0
|
@@ -26,7 +26,7 @@ test("draw holes with positive soldermask margins", async () => {
|
|
|
26
26
|
x: -4,
|
|
27
27
|
y: 2,
|
|
28
28
|
hole_diameter: 1.0,
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
soldermask_margin: 0.2,
|
|
31
31
|
},
|
|
32
32
|
// Square with positive margin
|
|
@@ -37,7 +37,7 @@ test("draw holes with positive soldermask margins", async () => {
|
|
|
37
37
|
x: -1,
|
|
38
38
|
y: 2,
|
|
39
39
|
hole_diameter: 1.0,
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
soldermask_margin: 0.15,
|
|
42
42
|
},
|
|
43
43
|
// Oval with positive margin
|
|
@@ -49,7 +49,7 @@ test("draw holes with positive soldermask margins", async () => {
|
|
|
49
49
|
y: 2,
|
|
50
50
|
hole_width: 1.5,
|
|
51
51
|
hole_height: 0.8,
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
soldermask_margin: 0.1,
|
|
54
54
|
},
|
|
55
55
|
// Rect with positive margin
|
|
@@ -61,7 +61,7 @@ test("draw holes with positive soldermask margins", async () => {
|
|
|
61
61
|
y: 2,
|
|
62
62
|
hole_width: 1.6,
|
|
63
63
|
hole_height: 1.1,
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
soldermask_margin: 0.15,
|
|
66
66
|
},
|
|
67
67
|
// Pill with positive margin
|
|
@@ -73,7 +73,7 @@ test("draw holes with positive soldermask margins", async () => {
|
|
|
73
73
|
y: 0,
|
|
74
74
|
hole_width: 2.0,
|
|
75
75
|
hole_height: 0.8,
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
soldermask_margin: 0.1,
|
|
78
78
|
},
|
|
79
79
|
// Silkscreen labels for positive margin holes
|
|
@@ -29,7 +29,7 @@ test("draw plated holes with positive and negative soldermask margins", async ()
|
|
|
29
29
|
outer_diameter: 2,
|
|
30
30
|
hole_diameter: 1,
|
|
31
31
|
layers: ["top", "bottom"],
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
soldermask_margin: 0.2,
|
|
34
34
|
},
|
|
35
35
|
// Circle with negative margin (spacing around copper, copper visible)
|
|
@@ -42,7 +42,7 @@ test("draw plated holes with positive and negative soldermask margins", async ()
|
|
|
42
42
|
outer_diameter: 2,
|
|
43
43
|
hole_diameter: 1,
|
|
44
44
|
layers: ["top", "bottom"],
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
soldermask_margin: -0.15,
|
|
47
47
|
},
|
|
48
48
|
// Oval with positive margin
|
|
@@ -58,7 +58,7 @@ test("draw plated holes with positive and negative soldermask margins", async ()
|
|
|
58
58
|
hole_height: 0.8,
|
|
59
59
|
layers: ["top", "bottom"],
|
|
60
60
|
ccw_rotation: 0,
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
soldermask_margin: 0.15,
|
|
63
63
|
},
|
|
64
64
|
// Oval with negative margin
|
|
@@ -74,7 +74,7 @@ test("draw plated holes with positive and negative soldermask margins", async ()
|
|
|
74
74
|
hole_height: 0.8,
|
|
75
75
|
layers: ["top", "bottom"],
|
|
76
76
|
ccw_rotation: 0,
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
soldermask_margin: -0.2,
|
|
79
79
|
},
|
|
80
80
|
// Pill with positive margin
|
|
@@ -90,7 +90,7 @@ test("draw plated holes with positive and negative soldermask margins", async ()
|
|
|
90
90
|
hole_height: 1,
|
|
91
91
|
layers: ["top", "bottom"],
|
|
92
92
|
ccw_rotation: 0,
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
soldermask_margin: 0.1,
|
|
95
95
|
},
|
|
96
96
|
// Pill with negative margin
|
|
@@ -106,7 +106,7 @@ test("draw plated holes with positive and negative soldermask margins", async ()
|
|
|
106
106
|
hole_height: 1,
|
|
107
107
|
layers: ["top", "bottom"],
|
|
108
108
|
ccw_rotation: 0,
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
soldermask_margin: -0.12,
|
|
111
111
|
},
|
|
112
112
|
// Rectangular pad with circular hole - positive margin
|
|
@@ -121,7 +121,7 @@ test("draw plated holes with positive and negative soldermask margins", async ()
|
|
|
121
121
|
rect_border_radius: 0.2,
|
|
122
122
|
hole_diameter: 1,
|
|
123
123
|
layers: ["top", "bottom"],
|
|
124
|
-
|
|
124
|
+
|
|
125
125
|
soldermask_margin: 0.15,
|
|
126
126
|
},
|
|
127
127
|
// Rectangular pad with circular hole - negative margin
|
|
@@ -136,7 +136,7 @@ test("draw plated holes with positive and negative soldermask margins", async ()
|
|
|
136
136
|
rect_border_radius: 0.2,
|
|
137
137
|
hole_diameter: 1,
|
|
138
138
|
layers: ["top", "bottom"],
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
soldermask_margin: -0.1,
|
|
141
141
|
},
|
|
142
142
|
// Silkscreen labels for positive margin holes (top row)
|
|
@@ -28,7 +28,6 @@ test("draw smt pads with positive and negative soldermask margins", async () =>
|
|
|
28
28
|
y: 2,
|
|
29
29
|
width: 1.6,
|
|
30
30
|
height: 1.1,
|
|
31
|
-
is_covered_with_solder_mask: true,
|
|
32
31
|
soldermask_margin: 0.2,
|
|
33
32
|
},
|
|
34
33
|
// Rectangle with negative margin (spacing around copper, copper visible)
|
|
@@ -41,7 +40,6 @@ test("draw smt pads with positive and negative soldermask margins", async () =>
|
|
|
41
40
|
y: -2,
|
|
42
41
|
width: 1.6,
|
|
43
42
|
height: 1.1,
|
|
44
|
-
is_covered_with_solder_mask: true,
|
|
45
43
|
soldermask_margin: -0.15,
|
|
46
44
|
},
|
|
47
45
|
// Circle with positive margin
|
|
@@ -53,7 +51,6 @@ test("draw smt pads with positive and negative soldermask margins", async () =>
|
|
|
53
51
|
x: 0,
|
|
54
52
|
y: 2,
|
|
55
53
|
radius: 0.75,
|
|
56
|
-
is_covered_with_solder_mask: true,
|
|
57
54
|
soldermask_margin: 0.15,
|
|
58
55
|
},
|
|
59
56
|
// Circle with negative margin
|
|
@@ -65,7 +62,6 @@ test("draw smt pads with positive and negative soldermask margins", async () =>
|
|
|
65
62
|
x: 0,
|
|
66
63
|
y: -2,
|
|
67
64
|
radius: 0.75,
|
|
68
|
-
is_covered_with_solder_mask: true,
|
|
69
65
|
soldermask_margin: -0.2,
|
|
70
66
|
},
|
|
71
67
|
// Pill with positive margin
|
|
@@ -79,7 +75,6 @@ test("draw smt pads with positive and negative soldermask margins", async () =>
|
|
|
79
75
|
width: 2.4,
|
|
80
76
|
height: 1,
|
|
81
77
|
radius: 0.5,
|
|
82
|
-
is_covered_with_solder_mask: true,
|
|
83
78
|
soldermask_margin: 0.1,
|
|
84
79
|
},
|
|
85
80
|
// Pill with negative margin
|
|
@@ -93,7 +88,6 @@ test("draw smt pads with positive and negative soldermask margins", async () =>
|
|
|
93
88
|
width: 2.4,
|
|
94
89
|
height: 1,
|
|
95
90
|
radius: 0.5,
|
|
96
|
-
is_covered_with_solder_mask: true,
|
|
97
91
|
soldermask_margin: -0.12,
|
|
98
92
|
},
|
|
99
93
|
// Silkscreen labels for positive margin pads (top row)
|
|
Binary file
|