@tscircuit/cli 0.1.1161 → 0.1.1162
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/cli/main.js +360 -311
- package/dist/lib/index.js +62 -13
- package/package.json +2 -2
package/dist/cli/main.js
CHANGED
|
@@ -34156,7 +34156,7 @@ function parseAndConvertSiUnit(v3) {
|
|
|
34156
34156
|
value: conversionFactor * Number.parseFloat(numberPart)
|
|
34157
34157
|
};
|
|
34158
34158
|
}
|
|
34159
|
-
function
|
|
34159
|
+
function applyToPoint20(matrix, point2) {
|
|
34160
34160
|
return Array.isArray(point2) ? [
|
|
34161
34161
|
matrix.a * point2[0] + matrix.c * point2[1] + matrix.e,
|
|
34162
34162
|
matrix.b * point2[0] + matrix.d * point2[1] + matrix.f
|
|
@@ -36772,25 +36772,25 @@ var __create3, __defProp3, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf3,
|
|
|
36772
36772
|
throw new Error(`Invalid sideOrDir: ${sideOrDir}`);
|
|
36773
36773
|
}, transformSchematicElement = (elm, matrix) => {
|
|
36774
36774
|
if (elm.type === "schematic_component") {
|
|
36775
|
-
elm.center =
|
|
36775
|
+
elm.center = applyToPoint20(matrix, elm.center);
|
|
36776
36776
|
} else if (elm.type === "schematic_port") {
|
|
36777
|
-
elm.center =
|
|
36777
|
+
elm.center = applyToPoint20(matrix, elm.center);
|
|
36778
36778
|
if (elm.facing_direction) {
|
|
36779
36779
|
elm.facing_direction = rotateDirection(elm.facing_direction, -(Math.atan2(matrix.b, matrix.a) / Math.PI) * 2);
|
|
36780
36780
|
}
|
|
36781
36781
|
} else if (elm.type === "schematic_text") {
|
|
36782
|
-
elm.position =
|
|
36782
|
+
elm.position = applyToPoint20(matrix, elm.position);
|
|
36783
36783
|
} else if (elm.type === "schematic_trace") {
|
|
36784
36784
|
const anyElm = elm;
|
|
36785
36785
|
anyElm.route = (anyElm.route ?? []).map((rp2) => {
|
|
36786
|
-
const tp2 =
|
|
36786
|
+
const tp2 = applyToPoint20(matrix, rp2);
|
|
36787
36787
|
rp2.x = tp2.x;
|
|
36788
36788
|
rp2.y = tp2.y;
|
|
36789
36789
|
return rp2;
|
|
36790
36790
|
});
|
|
36791
36791
|
if (Array.isArray(anyElm.junctions)) {
|
|
36792
36792
|
anyElm.junctions = anyElm.junctions.map((j2) => {
|
|
36793
|
-
const tp2 =
|
|
36793
|
+
const tp2 = applyToPoint20(matrix, j2);
|
|
36794
36794
|
j2.x = tp2.x;
|
|
36795
36795
|
j2.y = tp2.y;
|
|
36796
36796
|
return j2;
|
|
@@ -36798,18 +36798,18 @@ var __create3, __defProp3, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf3,
|
|
|
36798
36798
|
}
|
|
36799
36799
|
if (Array.isArray(anyElm.edges)) {
|
|
36800
36800
|
anyElm.edges = anyElm.edges.map((e2) => {
|
|
36801
|
-
e2.from =
|
|
36802
|
-
e2.to =
|
|
36801
|
+
e2.from = applyToPoint20(matrix, e2.from);
|
|
36802
|
+
e2.to = applyToPoint20(matrix, e2.to);
|
|
36803
36803
|
return e2;
|
|
36804
36804
|
});
|
|
36805
36805
|
}
|
|
36806
36806
|
} else if (elm.type === "schematic_box") {
|
|
36807
|
-
const { x: x3, y } =
|
|
36807
|
+
const { x: x3, y } = applyToPoint20(matrix, { x: elm.x, y: elm.y });
|
|
36808
36808
|
elm.x = x3;
|
|
36809
36809
|
elm.y = y;
|
|
36810
36810
|
} else if (elm.type === "schematic_line") {
|
|
36811
|
-
const { x: x12, y: y12 } =
|
|
36812
|
-
const { x: x22, y: y22 } =
|
|
36811
|
+
const { x: x12, y: y12 } = applyToPoint20(matrix, { x: elm.x1, y: elm.y1 });
|
|
36812
|
+
const { x: x22, y: y22 } = applyToPoint20(matrix, { x: elm.x2, y: elm.y2 });
|
|
36813
36813
|
elm.x1 = x12;
|
|
36814
36814
|
elm.y1 = y12;
|
|
36815
36815
|
elm.x2 = x22;
|
|
@@ -36822,7 +36822,7 @@ var __create3, __defProp3, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf3,
|
|
|
36822
36822
|
const tsr = decomposeTSR(matrix);
|
|
36823
36823
|
const flipPadWidthHeight = Math.round(tsr.rotation.angle / (Math.PI / 2)) % 2 === 1;
|
|
36824
36824
|
if (elm.type === "pcb_plated_hole" || elm.type === "pcb_hole" || elm.type === "pcb_via" || elm.type === "pcb_smtpad" || elm.type === "pcb_port") {
|
|
36825
|
-
const { x: x3, y } =
|
|
36825
|
+
const { x: x3, y } = applyToPoint20(matrix, {
|
|
36826
36826
|
x: Number(elm.x),
|
|
36827
36827
|
y: Number(elm.y)
|
|
36828
36828
|
});
|
|
@@ -36830,7 +36830,7 @@ var __create3, __defProp3, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf3,
|
|
|
36830
36830
|
elm.y = y;
|
|
36831
36831
|
if (elm.type === "pcb_smtpad" && elm.shape === "polygon" && Array.isArray(elm.points)) {
|
|
36832
36832
|
elm.points = elm.points.map((point2) => {
|
|
36833
|
-
const tp2 =
|
|
36833
|
+
const tp2 = applyToPoint20(matrix, { x: point2.x, y: point2.y });
|
|
36834
36834
|
return {
|
|
36835
36835
|
x: tp2.x,
|
|
36836
36836
|
y: tp2.y
|
|
@@ -36838,13 +36838,13 @@ var __create3, __defProp3, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf3,
|
|
|
36838
36838
|
});
|
|
36839
36839
|
}
|
|
36840
36840
|
} else if (elm.type === "pcb_keepout" || elm.type === "pcb_board") {
|
|
36841
|
-
elm.center =
|
|
36841
|
+
elm.center = applyToPoint20(matrix, elm.center);
|
|
36842
36842
|
} else if (elm.type === "pcb_silkscreen_text" || elm.type === "pcb_fabrication_note_text" || elm.type === "pcb_note_text") {
|
|
36843
|
-
elm.anchor_position =
|
|
36843
|
+
elm.anchor_position = applyToPoint20(matrix, elm.anchor_position);
|
|
36844
36844
|
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect" || elm.type === "pcb_courtyard_rect" || elm.type === "pcb_courtyard_circle") {
|
|
36845
|
-
elm.center =
|
|
36845
|
+
elm.center = applyToPoint20(matrix, elm.center);
|
|
36846
36846
|
} else if (elm.type === "pcb_component") {
|
|
36847
|
-
elm.center =
|
|
36847
|
+
elm.center = applyToPoint20(matrix, elm.center);
|
|
36848
36848
|
elm.rotation = elm.rotation + tsr.rotation.angle / Math.PI * 180;
|
|
36849
36849
|
elm.rotation = elm.rotation % 360;
|
|
36850
36850
|
if (flipPadWidthHeight) {
|
|
@@ -36852,21 +36852,21 @@ var __create3, __defProp3, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf3,
|
|
|
36852
36852
|
}
|
|
36853
36853
|
} else if (elm.type === "pcb_courtyard_outline") {
|
|
36854
36854
|
elm.outline = elm.outline.map((p) => {
|
|
36855
|
-
const tp2 =
|
|
36855
|
+
const tp2 = applyToPoint20(matrix, p);
|
|
36856
36856
|
p.x = tp2.x;
|
|
36857
36857
|
p.y = tp2.y;
|
|
36858
36858
|
return p;
|
|
36859
36859
|
});
|
|
36860
36860
|
} else if (elm.type === "pcb_courtyard_polygon") {
|
|
36861
36861
|
elm.points = elm.points.map((p) => {
|
|
36862
|
-
const tp2 =
|
|
36862
|
+
const tp2 = applyToPoint20(matrix, p);
|
|
36863
36863
|
p.x = tp2.x;
|
|
36864
36864
|
p.y = tp2.y;
|
|
36865
36865
|
return p;
|
|
36866
36866
|
});
|
|
36867
36867
|
} else if (elm.type === "pcb_silkscreen_path" || elm.type === "pcb_trace" || elm.type === "pcb_fabrication_note_path" || elm.type === "pcb_note_path") {
|
|
36868
36868
|
elm.route = elm.route.map((rp2) => {
|
|
36869
|
-
const tp2 =
|
|
36869
|
+
const tp2 = applyToPoint20(matrix, rp2);
|
|
36870
36870
|
rp2.x = tp2.x;
|
|
36871
36871
|
rp2.y = tp2.y;
|
|
36872
36872
|
return rp2;
|
|
@@ -36874,14 +36874,14 @@ var __create3, __defProp3, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf3,
|
|
|
36874
36874
|
} else if (elm.type === "pcb_silkscreen_line" || elm.type === "pcb_note_line") {
|
|
36875
36875
|
const p12 = { x: elm.x1, y: elm.y1 };
|
|
36876
36876
|
const p22 = { x: elm.x2, y: elm.y2 };
|
|
36877
|
-
const p1t =
|
|
36878
|
-
const p2t =
|
|
36877
|
+
const p1t = applyToPoint20(matrix, p12);
|
|
36878
|
+
const p2t = applyToPoint20(matrix, p22);
|
|
36879
36879
|
elm.x1 = p1t.x;
|
|
36880
36880
|
elm.y1 = p1t.y;
|
|
36881
36881
|
elm.x2 = p2t.x;
|
|
36882
36882
|
elm.y2 = p2t.y;
|
|
36883
36883
|
} else if (elm.type === "cad_component") {
|
|
36884
|
-
const newPos =
|
|
36884
|
+
const newPos = applyToPoint20(matrix, {
|
|
36885
36885
|
x: elm.position.x,
|
|
36886
36886
|
y: elm.position.y
|
|
36887
36887
|
});
|
|
@@ -46663,7 +46663,7 @@ function createSvgObjectsFromPcbTraceError(pcbTraceError, circuitJson, ctx) {
|
|
|
46663
46663
|
return createSvgObjectsForViaTraceError(pcbTraceError, via, ctx);
|
|
46664
46664
|
}
|
|
46665
46665
|
if (pcbTraceError.center) {
|
|
46666
|
-
const screenCenter =
|
|
46666
|
+
const screenCenter = applyToPoint20(transform2, {
|
|
46667
46667
|
x: pcbTraceError.center.x,
|
|
46668
46668
|
y: pcbTraceError.center.y
|
|
46669
46669
|
});
|
|
@@ -46708,11 +46708,11 @@ function createSvgObjectsFromPcbTraceError(pcbTraceError, circuitJson, ctx) {
|
|
|
46708
46708
|
} else
|
|
46709
46709
|
return [];
|
|
46710
46710
|
}
|
|
46711
|
-
const screenPort1 =
|
|
46711
|
+
const screenPort1 = applyToPoint20(transform2, {
|
|
46712
46712
|
x: port1.x,
|
|
46713
46713
|
y: port1.y
|
|
46714
46714
|
});
|
|
46715
|
-
const screenPort2 =
|
|
46715
|
+
const screenPort2 = applyToPoint20(transform2, {
|
|
46716
46716
|
x: port2.x,
|
|
46717
46717
|
y: port2.y
|
|
46718
46718
|
});
|
|
@@ -46796,11 +46796,11 @@ function createSvgObjectsFromPcbTraceError(pcbTraceError, circuitJson, ctx) {
|
|
|
46796
46796
|
function createSvgObjectsForViaTraceError(pcbTraceError, via, ctx) {
|
|
46797
46797
|
const { transform: transform2 } = ctx;
|
|
46798
46798
|
if (pcbTraceError.center && via) {
|
|
46799
|
-
const screenCenter =
|
|
46799
|
+
const screenCenter = applyToPoint20(transform2, {
|
|
46800
46800
|
x: pcbTraceError.center.x,
|
|
46801
46801
|
y: pcbTraceError.center.y
|
|
46802
46802
|
});
|
|
46803
|
-
const screenVia =
|
|
46803
|
+
const screenVia = applyToPoint20(transform2, {
|
|
46804
46804
|
x: via.x,
|
|
46805
46805
|
y: via.y
|
|
46806
46806
|
});
|
|
@@ -46974,7 +46974,7 @@ function createSvgObjectsFromPcbFootprintOverlapError(error, circuitJson, ctx) {
|
|
|
46974
46974
|
if (filteredReferencedElements.length > 0) {
|
|
46975
46975
|
const centerX = filteredReferencedElements.reduce((sum, el2) => sum + el2.x, 0) / filteredReferencedElements.length;
|
|
46976
46976
|
const centerY = filteredReferencedElements.reduce((sum, el2) => sum + el2.y, 0) / filteredReferencedElements.length;
|
|
46977
|
-
const screenCenter =
|
|
46977
|
+
const screenCenter = applyToPoint20(transform2, { x: centerX, y: centerY });
|
|
46978
46978
|
svgObjects.push({
|
|
46979
46979
|
name: "rect",
|
|
46980
46980
|
type: "element",
|
|
@@ -47012,7 +47012,7 @@ function createSvgObjectsFromPcbFootprintOverlapError(error, circuitJson, ctx) {
|
|
|
47012
47012
|
value: ""
|
|
47013
47013
|
});
|
|
47014
47014
|
for (const element of filteredReferencedElements) {
|
|
47015
|
-
const screenPos =
|
|
47015
|
+
const screenPos = applyToPoint20(transform2, { x: element.x, y: element.y });
|
|
47016
47016
|
svgObjects.push({
|
|
47017
47017
|
name: "rect",
|
|
47018
47018
|
type: "element",
|
|
@@ -47064,7 +47064,7 @@ function createSvgObjectsFromPcbCourtyardOverlapError(error, circuitJson, ctx) {
|
|
|
47064
47064
|
return [];
|
|
47065
47065
|
const midX = componentCenters.reduce((s, c) => s + c.x, 0) / componentCenters.length;
|
|
47066
47066
|
const midY = componentCenters.reduce((s, c) => s + c.y, 0) / componentCenters.length;
|
|
47067
|
-
const screenMid =
|
|
47067
|
+
const screenMid = applyToPoint20(transform2, { x: midX, y: midY });
|
|
47068
47068
|
svgObjects.push({
|
|
47069
47069
|
name: "rect",
|
|
47070
47070
|
type: "element",
|
|
@@ -47106,7 +47106,7 @@ function createSvgObjectsFromPcbCourtyardOverlapError(error, circuitJson, ctx) {
|
|
|
47106
47106
|
value: ""
|
|
47107
47107
|
});
|
|
47108
47108
|
for (const center of componentCenters) {
|
|
47109
|
-
const screenPos =
|
|
47109
|
+
const screenPos = applyToPoint20(transform2, center);
|
|
47110
47110
|
svgObjects.push({
|
|
47111
47111
|
name: "rect",
|
|
47112
47112
|
type: "element",
|
|
@@ -47125,7 +47125,7 @@ function createSvgObjectsFromPcbCourtyardOverlapError(error, circuitJson, ctx) {
|
|
|
47125
47125
|
});
|
|
47126
47126
|
}
|
|
47127
47127
|
if (componentCenters.length === 2) {
|
|
47128
|
-
const mapped = componentCenters.map((c) =>
|
|
47128
|
+
const mapped = componentCenters.map((c) => applyToPoint20(transform2, c));
|
|
47129
47129
|
const s12 = mapped[0];
|
|
47130
47130
|
const s2 = mapped[1];
|
|
47131
47131
|
svgObjects.push({
|
|
@@ -47180,8 +47180,8 @@ function createSvgObjectsFromPcbComponentOutsideBoardError(error, circuitJson, c
|
|
|
47180
47180
|
const bounds = getComponentBounds(error, circuitJson);
|
|
47181
47181
|
if (!bounds)
|
|
47182
47182
|
return [];
|
|
47183
|
-
const topLeft =
|
|
47184
|
-
const bottomRight =
|
|
47183
|
+
const topLeft = applyToPoint20(transform2, { x: bounds.min_x, y: bounds.min_y });
|
|
47184
|
+
const bottomRight = applyToPoint20(transform2, {
|
|
47185
47185
|
x: bounds.max_x,
|
|
47186
47186
|
y: bounds.max_y
|
|
47187
47187
|
});
|
|
@@ -47255,7 +47255,7 @@ function createSvgObjectsFromPcbFabricationNotePath(fabNotePath, ctx) {
|
|
|
47255
47255
|
const lastPoint = fabNotePath.route[fabNotePath.route.length - 1];
|
|
47256
47256
|
const isClosed = firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y;
|
|
47257
47257
|
const path42 = fabNotePath.route.slice(0, isClosed ? -1 : undefined).map((point2, index) => {
|
|
47258
|
-
const [x3, y] =
|
|
47258
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
47259
47259
|
return index === 0 ? `M ${x3} ${y}` : `L ${x3} ${y}`;
|
|
47260
47260
|
}).join(" ") + (isClosed ? " Z" : "");
|
|
47261
47261
|
return [
|
|
@@ -47294,7 +47294,7 @@ function createSvgObjectsFromPcbFabricationNoteText(pcbFabNoteText, ctx) {
|
|
|
47294
47294
|
debugPcb(`[pcb_fabrication_note_text] Invalid anchor_position for "${pcbFabNoteText.pcb_fabrication_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(anchor_position)}`);
|
|
47295
47295
|
return [];
|
|
47296
47296
|
}
|
|
47297
|
-
const [transformedX, transformedY] =
|
|
47297
|
+
const [transformedX, transformedY] = applyToPoint20(transform2, [
|
|
47298
47298
|
anchor_position.x,
|
|
47299
47299
|
anchor_position.y
|
|
47300
47300
|
]);
|
|
@@ -47373,11 +47373,11 @@ function createSvgObjectsFromPcbFabricationNoteRect(fabricationNoteRect, ctx) {
|
|
|
47373
47373
|
}
|
|
47374
47374
|
const halfWidth = width / 2;
|
|
47375
47375
|
const halfHeight = height / 2;
|
|
47376
|
-
const [topLeftX, topLeftY] =
|
|
47376
|
+
const [topLeftX, topLeftY] = applyToPoint20(transform2, [
|
|
47377
47377
|
center.x - halfWidth,
|
|
47378
47378
|
center.y + halfHeight
|
|
47379
47379
|
]);
|
|
47380
|
-
const [bottomRightX, bottomRightY] =
|
|
47380
|
+
const [bottomRightX, bottomRightY] = applyToPoint20(transform2, [
|
|
47381
47381
|
center.x + halfWidth,
|
|
47382
47382
|
center.y - halfHeight
|
|
47383
47383
|
]);
|
|
@@ -47524,11 +47524,11 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
|
|
|
47524
47524
|
y: toBase.y - perpendicular.y * arrowHalfWidth
|
|
47525
47525
|
})
|
|
47526
47526
|
];
|
|
47527
|
-
const [lineStartX, lineStartY] =
|
|
47527
|
+
const [lineStartX, lineStartY] = applyToPoint20(transform2, [
|
|
47528
47528
|
fromBase.x,
|
|
47529
47529
|
fromBase.y
|
|
47530
47530
|
]);
|
|
47531
|
-
const [lineEndX, lineEndY] =
|
|
47531
|
+
const [lineEndX, lineEndY] = applyToPoint20(transform2, [toBase.x, toBase.y]);
|
|
47532
47532
|
const strokeWidth = arrowSize / 5 * Math.abs(transform2.a);
|
|
47533
47533
|
const lineColor = color || "rgba(255,255,255,0.5)";
|
|
47534
47534
|
const extensionDirection = hasOffsetDirection && (Math.abs(normalizedOffsetDirection.x) > Number.EPSILON || Math.abs(normalizedOffsetDirection.y) > Number.EPSILON) ? normalizedOffsetDirection : perpendicular;
|
|
@@ -47538,8 +47538,8 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
|
|
|
47538
47538
|
x: anchor.x + extensionDirection.x * extensionLength,
|
|
47539
47539
|
y: anchor.y + extensionDirection.y * extensionLength
|
|
47540
47540
|
};
|
|
47541
|
-
const [startX, startY] =
|
|
47542
|
-
const [endX, endY] =
|
|
47541
|
+
const [startX, startY] = applyToPoint20(transform2, [anchor.x, anchor.y]);
|
|
47542
|
+
const [endX, endY] = applyToPoint20(transform2, [endPoint.x, endPoint.y]);
|
|
47543
47543
|
return {
|
|
47544
47544
|
name: "path",
|
|
47545
47545
|
type: "element",
|
|
@@ -47560,11 +47560,11 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
|
|
|
47560
47560
|
x: (from.x + to2.x) / 2 + offsetVector.x,
|
|
47561
47561
|
y: (from.y + to2.y) / 2 + offsetVector.y
|
|
47562
47562
|
};
|
|
47563
|
-
const [screenFromX, screenFromY] =
|
|
47563
|
+
const [screenFromX, screenFromY] = applyToPoint20(transform2, [
|
|
47564
47564
|
fromOffset.x,
|
|
47565
47565
|
fromOffset.y
|
|
47566
47566
|
]);
|
|
47567
|
-
const [screenToX, screenToY] =
|
|
47567
|
+
const [screenToX, screenToY] = applyToPoint20(transform2, [
|
|
47568
47568
|
toOffset.x,
|
|
47569
47569
|
toOffset.y
|
|
47570
47570
|
]);
|
|
@@ -47594,7 +47594,7 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
|
|
|
47594
47594
|
x: midPoint.x + perpendicular.x * textOffset,
|
|
47595
47595
|
y: midPoint.y + perpendicular.y * textOffset
|
|
47596
47596
|
};
|
|
47597
|
-
const [textX, textY] =
|
|
47597
|
+
const [textX, textY] = applyToPoint20(transform2, [textPoint.x, textPoint.y]);
|
|
47598
47598
|
const transformedFontSize = font_size * Math.abs(transform2.a);
|
|
47599
47599
|
const children = [
|
|
47600
47600
|
...extensionSegments,
|
|
@@ -47681,7 +47681,7 @@ function createSvgObjectsFromPcbFabricationNoteDimension(dimension, ctx) {
|
|
|
47681
47681
|
}
|
|
47682
47682
|
];
|
|
47683
47683
|
function toScreen(point2) {
|
|
47684
|
-
const [x3, y] =
|
|
47684
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
47685
47685
|
return { x: x3, y };
|
|
47686
47686
|
}
|
|
47687
47687
|
}
|
|
@@ -47762,11 +47762,11 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
|
|
|
47762
47762
|
y: toBase.y - perpendicular.y * arrowHalfWidth
|
|
47763
47763
|
})
|
|
47764
47764
|
];
|
|
47765
|
-
const [lineStartX, lineStartY] =
|
|
47765
|
+
const [lineStartX, lineStartY] = applyToPoint20(transform2, [
|
|
47766
47766
|
fromBase.x,
|
|
47767
47767
|
fromBase.y
|
|
47768
47768
|
]);
|
|
47769
|
-
const [lineEndX, lineEndY] =
|
|
47769
|
+
const [lineEndX, lineEndY] = applyToPoint20(transform2, [toBase.x, toBase.y]);
|
|
47770
47770
|
const strokeWidth = arrow_size / 5 * Math.abs(transform2.a);
|
|
47771
47771
|
const lineColor = color || colorMap.board.user_2;
|
|
47772
47772
|
const extensionDirection = hasOffsetDirection && (Math.abs(normalizedOffsetDirection.x) > Number.EPSILON || Math.abs(normalizedOffsetDirection.y) > Number.EPSILON) ? normalizedOffsetDirection : perpendicular;
|
|
@@ -47776,8 +47776,8 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
|
|
|
47776
47776
|
x: anchor.x + extensionDirection.x * extensionLength,
|
|
47777
47777
|
y: anchor.y + extensionDirection.y * extensionLength
|
|
47778
47778
|
};
|
|
47779
|
-
const [startX, startY] =
|
|
47780
|
-
const [endX, endY] =
|
|
47779
|
+
const [startX, startY] = applyToPoint20(transform2, [anchor.x, anchor.y]);
|
|
47780
|
+
const [endX, endY] = applyToPoint20(transform2, [endPoint.x, endPoint.y]);
|
|
47781
47781
|
return {
|
|
47782
47782
|
name: "path",
|
|
47783
47783
|
type: "element",
|
|
@@ -47798,11 +47798,11 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
|
|
|
47798
47798
|
x: (from.x + to2.x) / 2 + offsetVector.x,
|
|
47799
47799
|
y: (from.y + to2.y) / 2 + offsetVector.y
|
|
47800
47800
|
};
|
|
47801
|
-
const [screenFromX, screenFromY] =
|
|
47801
|
+
const [screenFromX, screenFromY] = applyToPoint20(transform2, [
|
|
47802
47802
|
fromOffset.x,
|
|
47803
47803
|
fromOffset.y
|
|
47804
47804
|
]);
|
|
47805
|
-
const [screenToX, screenToY] =
|
|
47805
|
+
const [screenToX, screenToY] = applyToPoint20(transform2, [
|
|
47806
47806
|
toOffset.x,
|
|
47807
47807
|
toOffset.y
|
|
47808
47808
|
]);
|
|
@@ -47832,7 +47832,7 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
|
|
|
47832
47832
|
x: midPoint.x + perpendicular.x * textOffset,
|
|
47833
47833
|
y: midPoint.y + perpendicular.y * textOffset
|
|
47834
47834
|
};
|
|
47835
|
-
const [textX, textY] =
|
|
47835
|
+
const [textX, textY] = applyToPoint20(transform2, [textPoint.x, textPoint.y]);
|
|
47836
47836
|
const transformedFontSize = font_size * Math.abs(transform2.a);
|
|
47837
47837
|
const children = [
|
|
47838
47838
|
...extensionSegments,
|
|
@@ -47915,7 +47915,7 @@ function createSvgObjectsFromPcbNoteDimension(dimension, ctx) {
|
|
|
47915
47915
|
}
|
|
47916
47916
|
];
|
|
47917
47917
|
function toScreen(point2) {
|
|
47918
|
-
const [x3, y] =
|
|
47918
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
47919
47919
|
return { x: x3, y };
|
|
47920
47920
|
}
|
|
47921
47921
|
}
|
|
@@ -47936,7 +47936,7 @@ function createSvgObjectsFromPcbNoteText(note, ctx) {
|
|
|
47936
47936
|
debugPcb(`[pcb_note_text] Invalid text for "${note.pcb_note_text_id}": expected non-empty string, got ${JSON.stringify(text)}`);
|
|
47937
47937
|
return [];
|
|
47938
47938
|
}
|
|
47939
|
-
const [x3, y] =
|
|
47939
|
+
const [x3, y] = applyToPoint20(transform2, [anchor_position.x, anchor_position.y]);
|
|
47940
47940
|
const transformedFontSize = font_size * Math.abs(transform2.a);
|
|
47941
47941
|
let textAnchor = "middle";
|
|
47942
47942
|
let dominantBaseline = "central";
|
|
@@ -48031,11 +48031,11 @@ function createSvgObjectsFromPcbNoteRect(noteRect, ctx) {
|
|
|
48031
48031
|
}
|
|
48032
48032
|
const halfWidth = width / 2;
|
|
48033
48033
|
const halfHeight = height / 2;
|
|
48034
|
-
const [topLeftX, topLeftY] =
|
|
48034
|
+
const [topLeftX, topLeftY] = applyToPoint20(transform2, [
|
|
48035
48035
|
center.x - halfWidth,
|
|
48036
48036
|
center.y + halfHeight
|
|
48037
48037
|
]);
|
|
48038
|
-
const [bottomRightX, bottomRightY] =
|
|
48038
|
+
const [bottomRightX, bottomRightY] = applyToPoint20(transform2, [
|
|
48039
48039
|
center.x + halfWidth,
|
|
48040
48040
|
center.y - halfHeight
|
|
48041
48041
|
]);
|
|
@@ -48104,7 +48104,7 @@ function createSvgObjectsFromPcbNotePath(notePath, ctx) {
|
|
|
48104
48104
|
}
|
|
48105
48105
|
}
|
|
48106
48106
|
const pathD = notePath.route.map((point2, index) => {
|
|
48107
|
-
const [x3, y] =
|
|
48107
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
48108
48108
|
return index === 0 ? `M ${x3} ${y}` : `L ${x3} ${y}`;
|
|
48109
48109
|
}).join(" ");
|
|
48110
48110
|
const strokeWidth = notePath.stroke_width * Math.abs(transform2.a);
|
|
@@ -48133,8 +48133,8 @@ function createSvgObjectsFromPcbNoteLine(noteLine, ctx) {
|
|
|
48133
48133
|
debugPcb(`[pcb_note_line] Invalid coordinates for "${noteLine.pcb_note_line_id}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(x12)}, y1=${JSON.stringify(y12)}, x2=${JSON.stringify(x22)}, y2=${JSON.stringify(y22)}`);
|
|
48134
48134
|
return [];
|
|
48135
48135
|
}
|
|
48136
|
-
const [startX, startY] =
|
|
48137
|
-
const [endX, endY] =
|
|
48136
|
+
const [startX, startY] = applyToPoint20(transform2, [x12, y12]);
|
|
48137
|
+
const [endX, endY] = applyToPoint20(transform2, [x22, y22]);
|
|
48138
48138
|
const baseStrokeWidth = typeof stroke_width === "number" ? stroke_width : 0;
|
|
48139
48139
|
const transformedStrokeWidth = baseStrokeWidth * Math.abs(transform2.a);
|
|
48140
48140
|
const attributes = {
|
|
@@ -48166,7 +48166,7 @@ function createSvgObjectsFromPcbNoteLine(noteLine, ctx) {
|
|
|
48166
48166
|
}
|
|
48167
48167
|
function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
|
|
48168
48168
|
const { transform: transform2, colorMap: colorMap2, showSolderMask } = ctx;
|
|
48169
|
-
const [x3, y] =
|
|
48169
|
+
const [x3, y] = applyToPoint20(transform2, [hole.x, hole.y]);
|
|
48170
48170
|
const layer = Array.isArray(hole.layers) && hole.layers[0] || hole.layer || "top";
|
|
48171
48171
|
const maskLayer = layer;
|
|
48172
48172
|
const isCoveredWithSolderMask = Boolean(hole.is_covered_with_solder_mask);
|
|
@@ -48464,7 +48464,7 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
|
|
|
48464
48464
|
const xStr = rotation2 ? (-scaledRectPadWidth / 2).toString() : (x3 - scaledRectPadWidth / 2).toString();
|
|
48465
48465
|
const yStr = rotation2 ? (-scaledRectPadHeight / 2).toString() : (y - scaledRectPadHeight / 2).toString();
|
|
48466
48466
|
const holeRadius = scaledHoleDiameter / 2;
|
|
48467
|
-
const [holeCx, holeCy] =
|
|
48467
|
+
const [holeCx, holeCy] = applyToPoint20(transform2, [
|
|
48468
48468
|
h.x + (h.hole_offset_x ?? 0),
|
|
48469
48469
|
h.y + (h.hole_offset_y ?? 0)
|
|
48470
48470
|
]);
|
|
@@ -48627,7 +48627,7 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
|
|
|
48627
48627
|
const pillHoleWithOffsets = pillHole;
|
|
48628
48628
|
const holeOffsetX = pillHoleWithOffsets.hole_offset_x ?? 0;
|
|
48629
48629
|
const holeOffsetY = pillHoleWithOffsets.hole_offset_y ?? 0;
|
|
48630
|
-
const [holeCenterX, holeCenterY] =
|
|
48630
|
+
const [holeCenterX, holeCenterY] = applyToPoint20(transform2, [
|
|
48631
48631
|
pillHole.x + holeOffsetX,
|
|
48632
48632
|
pillHole.y + holeOffsetY
|
|
48633
48633
|
]);
|
|
@@ -48766,7 +48766,7 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
|
|
|
48766
48766
|
const rotatedHoleWithOffsets = rotatedHole;
|
|
48767
48767
|
const holeOffsetX = rotatedHoleWithOffsets.hole_offset_x ?? 0;
|
|
48768
48768
|
const holeOffsetY = rotatedHoleWithOffsets.hole_offset_y ?? 0;
|
|
48769
|
-
const [holeCenterX, holeCenterY] =
|
|
48769
|
+
const [holeCenterX, holeCenterY] = applyToPoint20(transform2, [
|
|
48770
48770
|
rotatedHole.x + holeOffsetX,
|
|
48771
48771
|
rotatedHole.y + holeOffsetY
|
|
48772
48772
|
]);
|
|
@@ -48905,9 +48905,9 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
|
|
|
48905
48905
|
const padOutline = polygonHole.pad_outline || [];
|
|
48906
48906
|
const holeX = polygonHole.x ?? 0;
|
|
48907
48907
|
const holeY = polygonHole.y ?? 0;
|
|
48908
|
-
const padPoints = padOutline.map((point2) =>
|
|
48908
|
+
const padPoints = padOutline.map((point2) => applyToPoint20(transform2, [holeX + point2.x, holeY + point2.y]));
|
|
48909
48909
|
const padPointsString = padPoints.map((p) => p.join(",")).join(" ");
|
|
48910
|
-
const [holeCenterX, holeCenterY] =
|
|
48910
|
+
const [holeCenterX, holeCenterY] = applyToPoint20(transform2, [
|
|
48911
48911
|
holeX + polygonHole.hole_offset_x,
|
|
48912
48912
|
holeY + polygonHole.hole_offset_y
|
|
48913
48913
|
]);
|
|
@@ -49018,7 +49018,7 @@ function createSvgObjectsFromPcbSilkscreenPath(silkscreenPath, ctx) {
|
|
|
49018
49018
|
if (!silkscreenPath.route || !Array.isArray(silkscreenPath.route))
|
|
49019
49019
|
return [];
|
|
49020
49020
|
let path42 = silkscreenPath.route.map((point2, index) => {
|
|
49021
|
-
const [x3, y] =
|
|
49021
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
49022
49022
|
return index === 0 ? `M ${x3} ${y}` : `L ${x3} ${y}`;
|
|
49023
49023
|
}).join(" ");
|
|
49024
49024
|
const firstPoint = silkscreenPath.route[0];
|
|
@@ -49128,7 +49128,7 @@ function createSvgObjectsFromPcbSilkscreenText(pcbSilkscreenText, ctx) {
|
|
|
49128
49128
|
debugPcb(`[pcb_silkscreen_text] Invalid anchor_position for "${pcbSilkscreenText.pcb_silkscreen_text_id}": expected {x: number, y: number}, got ${JSON.stringify(anchor_position)}`);
|
|
49129
49129
|
return [];
|
|
49130
49130
|
}
|
|
49131
|
-
const [transformedX, transformedY] =
|
|
49131
|
+
const [transformedX, transformedY] = applyToPoint20(transform2, [
|
|
49132
49132
|
anchor_position.x,
|
|
49133
49133
|
anchor_position.y
|
|
49134
49134
|
]);
|
|
@@ -49336,7 +49336,7 @@ function createSvgObjectsFromPcbSilkscreenRect(pcbSilkscreenRect, ctx) {
|
|
|
49336
49336
|
debugPcb(`[pcb_silkscreen_rect] Invalid data for "${pcb_silkscreen_rect_id}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(center)}, width=${JSON.stringify(width)}, height=${JSON.stringify(height)}`);
|
|
49337
49337
|
return [];
|
|
49338
49338
|
}
|
|
49339
|
-
const [transformedX, transformedY] =
|
|
49339
|
+
const [transformedX, transformedY] = applyToPoint20(transform2, [
|
|
49340
49340
|
center.x,
|
|
49341
49341
|
center.y
|
|
49342
49342
|
]);
|
|
@@ -49486,7 +49486,7 @@ function createSvgObjectsFromPcbCopperText(pcbCopperText, ctx) {
|
|
|
49486
49486
|
return [];
|
|
49487
49487
|
if (!anchor_position)
|
|
49488
49488
|
return [];
|
|
49489
|
-
const [ax2, ay2] =
|
|
49489
|
+
const [ax2, ay2] = applyToPoint20(transform2, [
|
|
49490
49490
|
anchor_position.x,
|
|
49491
49491
|
anchor_position.y
|
|
49492
49492
|
]);
|
|
@@ -49643,7 +49643,7 @@ function createSvgObjectsFromPcbSilkscreenCircle(pcbSilkscreenCircle, ctx) {
|
|
|
49643
49643
|
console.error("Invalid PCB Silkscreen Circle data:", { center, radius });
|
|
49644
49644
|
return [];
|
|
49645
49645
|
}
|
|
49646
|
-
const [transformedX, transformedY] =
|
|
49646
|
+
const [transformedX, transformedY] = applyToPoint20(transform2, [
|
|
49647
49647
|
center.x,
|
|
49648
49648
|
center.y
|
|
49649
49649
|
]);
|
|
@@ -49686,8 +49686,8 @@ function createSvgObjectsFromPcbSilkscreenLine(pcbSilkscreenLine, ctx) {
|
|
|
49686
49686
|
debugPcb(`[pcb_silkscreen_line] Invalid coordinates for "${pcb_silkscreen_line_id}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(x12)}, y1=${JSON.stringify(y12)}, x2=${JSON.stringify(x22)}, y2=${JSON.stringify(y22)}`);
|
|
49687
49687
|
return [];
|
|
49688
49688
|
}
|
|
49689
|
-
const [transformedX1, transformedY1] =
|
|
49690
|
-
const [transformedX2, transformedY2] =
|
|
49689
|
+
const [transformedX1, transformedY1] = applyToPoint20(transform2, [x12, y12]);
|
|
49690
|
+
const [transformedX2, transformedY2] = applyToPoint20(transform2, [x22, y22]);
|
|
49691
49691
|
const transformedStrokeWidth = stroke_width * Math.abs(transform2.a);
|
|
49692
49692
|
const color = layer === "bottom" ? colorMap2.silkscreen.bottom : colorMap2.silkscreen.top;
|
|
49693
49693
|
return [
|
|
@@ -49722,7 +49722,7 @@ function createSvgObjectsFromPcbSilkscreenPill(pcbSilkscreenPill, ctx) {
|
|
|
49722
49722
|
} = pcbSilkscreenPill;
|
|
49723
49723
|
if (layerFilter && layer !== layerFilter)
|
|
49724
49724
|
return [];
|
|
49725
|
-
const [transformedX, transformedY] =
|
|
49725
|
+
const [transformedX, transformedY] = applyToPoint20(transform2, [
|
|
49726
49726
|
center.x,
|
|
49727
49727
|
center.y
|
|
49728
49728
|
]);
|
|
@@ -49772,7 +49772,7 @@ function createSvgObjectsFromPcbSilkscreenOval(pcbSilkscreenOval, ctx) {
|
|
|
49772
49772
|
debugPcb(`[pcb_silkscreen_oval] Invalid data for "${pcb_silkscreen_oval_id}": expected center {x: number, y: number}, radius_x: number, radius_y: number, got center=${JSON.stringify(center)}, radius_x=${JSON.stringify(radius_x)}, radius_y=${JSON.stringify(radius_y)}`);
|
|
49773
49773
|
return [];
|
|
49774
49774
|
}
|
|
49775
|
-
const [transformedX, transformedY] =
|
|
49775
|
+
const [transformedX, transformedY] = applyToPoint20(transform2, [
|
|
49776
49776
|
center.x,
|
|
49777
49777
|
center.y
|
|
49778
49778
|
]);
|
|
@@ -49819,7 +49819,7 @@ function createSvgObjectsFromPcbCourtyardRect(pcbCourtyardRect, ctx) {
|
|
|
49819
49819
|
debugPcb(`[pcb_courtyard_rect] Invalid data for "${pcb_courtyard_rect_id}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(center)}, width=${JSON.stringify(width)}, height=${JSON.stringify(height)}`);
|
|
49820
49820
|
return [];
|
|
49821
49821
|
}
|
|
49822
|
-
const [transformedX, transformedY] =
|
|
49822
|
+
const [transformedX, transformedY] = applyToPoint20(transform2, [
|
|
49823
49823
|
center.x,
|
|
49824
49824
|
center.y
|
|
49825
49825
|
]);
|
|
@@ -49869,7 +49869,7 @@ function createSvgObjectsFromPcbCourtyardPolygon(pcbCourtyardPolygon, ctx) {
|
|
|
49869
49869
|
debugPcb(`[pcb_courtyard_polygon] Invalid data for "${pcb_courtyard_polygon_id}": expected non-empty array of points, got ${JSON.stringify(points)}`);
|
|
49870
49870
|
return [];
|
|
49871
49871
|
}
|
|
49872
|
-
const transformedPoints = points.map((p) =>
|
|
49872
|
+
const transformedPoints = points.map((p) => applyToPoint20(transform2, [p.x, p.y]));
|
|
49873
49873
|
const pointsString = transformedPoints.map((p) => `${p[0]},${p[1]}`).join(" ");
|
|
49874
49874
|
const transformedStrokeWidth = 0.05 * Math.abs(transform2.a);
|
|
49875
49875
|
const strokeColor = color ?? (layer === "bottom" ? colorMap2.courtyard.bottom : colorMap2.courtyard.top);
|
|
@@ -49901,7 +49901,7 @@ function createSvgObjectsFromPcbCourtyardOutline(pcbCourtyardOutline, ctx) {
|
|
|
49901
49901
|
debugPcb(`[pcb_courtyard_outline] Invalid data for "${pcb_courtyard_outline_id}": expected non-empty array of points, got ${JSON.stringify(outline)}`);
|
|
49902
49902
|
return [];
|
|
49903
49903
|
}
|
|
49904
|
-
const transformedPoints = outline.map((p) =>
|
|
49904
|
+
const transformedPoints = outline.map((p) => applyToPoint20(transform2, [p.x, p.y]));
|
|
49905
49905
|
const pointsString = transformedPoints.map((p) => `${p[0]},${p[1]}`).join(" ");
|
|
49906
49906
|
const transformedStrokeWidth = 0.05 * Math.abs(transform2.a);
|
|
49907
49907
|
const strokeColor = layer === "bottom" ? colorMap2.courtyard.bottom : colorMap2.courtyard.top;
|
|
@@ -49938,7 +49938,7 @@ function createSvgObjectsFromPcbCourtyardCircle(pcbCourtyardCircle, ctx) {
|
|
|
49938
49938
|
console.error(`[pcb_courtyard_circle] Invalid data for "${pcb_courtyard_circle_id}": expected center {x: number, y: number}, radius: number, got center=${JSON.stringify(center)}, radius=${JSON.stringify(radius)}`);
|
|
49939
49939
|
return [];
|
|
49940
49940
|
}
|
|
49941
|
-
const [transformedX, transformedY] =
|
|
49941
|
+
const [transformedX, transformedY] = applyToPoint20(transform2, [
|
|
49942
49942
|
center.x,
|
|
49943
49943
|
center.y
|
|
49944
49944
|
]);
|
|
@@ -49983,8 +49983,8 @@ function createSvgObjectsFromPcbTrace(trace, ctx) {
|
|
|
49983
49983
|
if (start.is_inside_copper_pour === true && end.is_inside_copper_pour === true) {
|
|
49984
49984
|
continue;
|
|
49985
49985
|
}
|
|
49986
|
-
const startPoint =
|
|
49987
|
-
const endPoint =
|
|
49986
|
+
const startPoint = applyToPoint20(transform2, [start.x, start.y]);
|
|
49987
|
+
const endPoint = applyToPoint20(transform2, [end.x, end.y]);
|
|
49988
49988
|
const layer = "layer" in start ? start.layer : ("layer" in end) ? end.layer : null;
|
|
49989
49989
|
if (!layer)
|
|
49990
49990
|
continue;
|
|
@@ -50050,7 +50050,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
|
|
|
50050
50050
|
if (pad.shape === "rect" || pad.shape === "rotated_rect") {
|
|
50051
50051
|
const width = pad.width * Math.abs(transform2.a);
|
|
50052
50052
|
const height = pad.height * Math.abs(transform2.d);
|
|
50053
|
-
const [x3, y] =
|
|
50053
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
50054
50054
|
const cornerRadiusValue = pad.corner_radius ?? pad.rect_border_radius ?? 0;
|
|
50055
50055
|
const scaledBorderRadius = cornerRadiusValue * Math.abs(transform2.a);
|
|
50056
50056
|
const m = {
|
|
@@ -50300,7 +50300,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
|
|
|
50300
50300
|
const width = pad.width * Math.abs(transform2.a);
|
|
50301
50301
|
const height = pad.height * Math.abs(transform2.d);
|
|
50302
50302
|
const radius = pad.radius * Math.abs(transform2.a);
|
|
50303
|
-
const [x3, y] =
|
|
50303
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
50304
50304
|
const rotationTransformAttributes = isRotated ? {
|
|
50305
50305
|
transform: `translate(${x3} ${y}) rotate(${-(pad.ccw_rotation ?? 0)})`
|
|
50306
50306
|
} : undefined;
|
|
@@ -50418,7 +50418,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
|
|
|
50418
50418
|
}
|
|
50419
50419
|
if (pad.shape === "circle") {
|
|
50420
50420
|
const radius = pad.radius * Math.abs(transform2.a);
|
|
50421
|
-
const [x3, y] =
|
|
50421
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
50422
50422
|
const padElement = {
|
|
50423
50423
|
name: "circle",
|
|
50424
50424
|
type: "element",
|
|
@@ -50507,7 +50507,7 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
|
|
|
50507
50507
|
return [substrateElement, padElement];
|
|
50508
50508
|
}
|
|
50509
50509
|
if (pad.shape === "polygon") {
|
|
50510
|
-
const points = (pad.points ?? []).map((point2) =>
|
|
50510
|
+
const points = (pad.points ?? []).map((point2) => applyToPoint20(transform2, [point2.x, point2.y]));
|
|
50511
50511
|
const padElement = {
|
|
50512
50512
|
name: "polygon",
|
|
50513
50513
|
type: "element",
|
|
@@ -50615,11 +50615,11 @@ function createAnchorOffsetIndicators(params2) {
|
|
|
50615
50615
|
displayYOffset
|
|
50616
50616
|
} = params2;
|
|
50617
50617
|
const objects = [];
|
|
50618
|
-
const [screenGroupAnchorX, screenGroupAnchorY] =
|
|
50618
|
+
const [screenGroupAnchorX, screenGroupAnchorY] = applyToPoint20(transform2, [
|
|
50619
50619
|
groupAnchorPosition.x,
|
|
50620
50620
|
groupAnchorPosition.y
|
|
50621
50621
|
]);
|
|
50622
|
-
const [screenComponentX, screenComponentY] =
|
|
50622
|
+
const [screenComponentX, screenComponentY] = applyToPoint20(transform2, [
|
|
50623
50623
|
componentPosition.x,
|
|
50624
50624
|
componentPosition.y
|
|
50625
50625
|
]);
|
|
@@ -50955,25 +50955,25 @@ function createSvgObjectsFromPcbBoard(pcbBoard, ctx) {
|
|
|
50955
50955
|
let path42;
|
|
50956
50956
|
if (outline && Array.isArray(outline) && outline.length >= 3) {
|
|
50957
50957
|
path42 = outline.map((point2, index) => {
|
|
50958
|
-
const [x3, y] =
|
|
50958
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
50959
50959
|
return index === 0 ? `M ${x3} ${y}` : `L ${x3} ${y}`;
|
|
50960
50960
|
}).join(" ");
|
|
50961
50961
|
} else {
|
|
50962
50962
|
const halfWidth = width / 2;
|
|
50963
50963
|
const halfHeight = height / 2;
|
|
50964
|
-
const topLeft =
|
|
50964
|
+
const topLeft = applyToPoint20(transform2, [
|
|
50965
50965
|
center.x - halfWidth,
|
|
50966
50966
|
center.y - halfHeight
|
|
50967
50967
|
]);
|
|
50968
|
-
const topRight =
|
|
50968
|
+
const topRight = applyToPoint20(transform2, [
|
|
50969
50969
|
center.x + halfWidth,
|
|
50970
50970
|
center.y - halfHeight
|
|
50971
50971
|
]);
|
|
50972
|
-
const bottomRight =
|
|
50972
|
+
const bottomRight = applyToPoint20(transform2, [
|
|
50973
50973
|
center.x + halfWidth,
|
|
50974
50974
|
center.y + halfHeight
|
|
50975
50975
|
]);
|
|
50976
|
-
const bottomLeft =
|
|
50976
|
+
const bottomLeft = applyToPoint20(transform2, [
|
|
50977
50977
|
center.x - halfWidth,
|
|
50978
50978
|
center.y + halfHeight
|
|
50979
50979
|
]);
|
|
@@ -51041,19 +51041,19 @@ function createSvgObjectsFromPcbPanel(pcbPanel, ctx) {
|
|
|
51041
51041
|
const center = pcbPanel.center ?? { x: width / 2, y: height / 2 };
|
|
51042
51042
|
const halfWidth = width / 2;
|
|
51043
51043
|
const halfHeight = height / 2;
|
|
51044
|
-
const topLeft =
|
|
51044
|
+
const topLeft = applyToPoint20(transform2, [
|
|
51045
51045
|
center.x - halfWidth,
|
|
51046
51046
|
center.y - halfHeight
|
|
51047
51047
|
]);
|
|
51048
|
-
const topRight =
|
|
51048
|
+
const topRight = applyToPoint20(transform2, [
|
|
51049
51049
|
center.x + halfWidth,
|
|
51050
51050
|
center.y - halfHeight
|
|
51051
51051
|
]);
|
|
51052
|
-
const bottomRight =
|
|
51052
|
+
const bottomRight = applyToPoint20(transform2, [
|
|
51053
51053
|
center.x + halfWidth,
|
|
51054
51054
|
center.y + halfHeight
|
|
51055
51055
|
]);
|
|
51056
|
-
const bottomLeft =
|
|
51056
|
+
const bottomLeft = applyToPoint20(transform2, [
|
|
51057
51057
|
center.x - halfWidth,
|
|
51058
51058
|
center.y + halfHeight
|
|
51059
51059
|
]);
|
|
@@ -51080,7 +51080,7 @@ function createSvgObjectsFromPcbPanel(pcbPanel, ctx) {
|
|
|
51080
51080
|
}
|
|
51081
51081
|
function createSvgObjectsFromPcbVia(hole, ctx) {
|
|
51082
51082
|
const { transform: transform2, colorMap: colorMap2 } = ctx;
|
|
51083
|
-
const [x3, y] =
|
|
51083
|
+
const [x3, y] = applyToPoint20(transform2, [hole.x, hole.y]);
|
|
51084
51084
|
const scaledOuterWidth = hole.outer_diameter * Math.abs(transform2.a);
|
|
51085
51085
|
const scaledOuterHeight = hole.outer_diameter * Math.abs(transform2.a);
|
|
51086
51086
|
const scaledHoleWidth = hole.hole_diameter * Math.abs(transform2.a);
|
|
@@ -51127,7 +51127,7 @@ function createSvgObjectsFromPcbVia(hole, ctx) {
|
|
|
51127
51127
|
function createSvgObjectsFromPcbHole(hole, ctx) {
|
|
51128
51128
|
const { transform: transform2, colorMap: colorMap2, showSolderMask } = ctx;
|
|
51129
51129
|
const layer = ctx.layer ?? "top";
|
|
51130
|
-
const [x3, y] =
|
|
51130
|
+
const [x3, y] = applyToPoint20(transform2, [hole.x, hole.y]);
|
|
51131
51131
|
const isCoveredWithSolderMask = Boolean(hole.is_covered_with_solder_mask);
|
|
51132
51132
|
const soldermaskMargin = (hole.soldermask_margin ?? 0) * Math.abs(transform2.a);
|
|
51133
51133
|
const shouldShowSolderMask = showSolderMask && isCoveredWithSolderMask && soldermaskMargin !== 0;
|
|
@@ -51625,11 +51625,11 @@ function createSvgObjectsForRatsNest(circuitJson, ctx) {
|
|
|
51625
51625
|
});
|
|
51626
51626
|
const svgObjects = [];
|
|
51627
51627
|
for (const line of ratsNestLines) {
|
|
51628
|
-
const transformedStart =
|
|
51628
|
+
const transformedStart = applyToPoint20(transform2, [
|
|
51629
51629
|
line.startPoint.x,
|
|
51630
51630
|
line.startPoint.y
|
|
51631
51631
|
]);
|
|
51632
|
-
const transformedEnd =
|
|
51632
|
+
const transformedEnd = applyToPoint20(transform2, [
|
|
51633
51633
|
line.endPoint.x,
|
|
51634
51634
|
line.endPoint.y
|
|
51635
51635
|
]);
|
|
@@ -51658,7 +51658,7 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
|
|
|
51658
51658
|
const { transform: transform2, colorMap: colorMap2 } = ctx;
|
|
51659
51659
|
if (cutout.shape === "rect") {
|
|
51660
51660
|
const rectCutout = cutout;
|
|
51661
|
-
const [cx2, cy2] =
|
|
51661
|
+
const [cx2, cy2] = applyToPoint20(transform2, [
|
|
51662
51662
|
rectCutout.center.x,
|
|
51663
51663
|
rectCutout.center.y
|
|
51664
51664
|
]);
|
|
@@ -51698,7 +51698,7 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
|
|
|
51698
51698
|
}
|
|
51699
51699
|
if (cutout.shape === "circle") {
|
|
51700
51700
|
const circleCutout = cutout;
|
|
51701
|
-
const [cx2, cy2] =
|
|
51701
|
+
const [cx2, cy2] = applyToPoint20(transform2, [
|
|
51702
51702
|
circleCutout.center.x,
|
|
51703
51703
|
circleCutout.center.y
|
|
51704
51704
|
]);
|
|
@@ -51725,7 +51725,7 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
|
|
|
51725
51725
|
const polygonCutout = cutout;
|
|
51726
51726
|
if (!polygonCutout.points || polygonCutout.points.length === 0)
|
|
51727
51727
|
return [];
|
|
51728
|
-
const transformedPoints = polygonCutout.points.map((p) =>
|
|
51728
|
+
const transformedPoints = polygonCutout.points.map((p) => applyToPoint20(transform2, [p.x, p.y]));
|
|
51729
51729
|
const pointsString = transformedPoints.map((p) => `${p[0]},${p[1]}`).join(" ");
|
|
51730
51730
|
return [
|
|
51731
51731
|
{
|
|
@@ -51753,7 +51753,7 @@ function createSvgObjectsFromPcbCutoutPath(cutoutPath, ctx) {
|
|
|
51753
51753
|
const lastPoint = cutoutPath.route[cutoutPath.route.length - 1];
|
|
51754
51754
|
const isClosed = firstPoint && lastPoint && firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y;
|
|
51755
51755
|
const path42 = cutoutPath.route.slice(0, isClosed ? -1 : undefined).map((point2, index) => {
|
|
51756
|
-
const [x3, y] =
|
|
51756
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
51757
51757
|
return index === 0 ? `M ${x3} ${y}` : `L ${x3} ${y}`;
|
|
51758
51758
|
}).join(" ") + (isClosed ? " Z" : "");
|
|
51759
51759
|
return [
|
|
@@ -51855,7 +51855,7 @@ function createSvgObjectsFromPcbKeepout(keepout, ctx) {
|
|
|
51855
51855
|
}
|
|
51856
51856
|
if (keepout.shape === "rect") {
|
|
51857
51857
|
const rectKeepout = keepout;
|
|
51858
|
-
const [cx2, cy2] =
|
|
51858
|
+
const [cx2, cy2] = applyToPoint20(transform2, [
|
|
51859
51859
|
rectKeepout.center.x,
|
|
51860
51860
|
rectKeepout.center.y
|
|
51861
51861
|
]);
|
|
@@ -51894,7 +51894,7 @@ function createSvgObjectsFromPcbKeepout(keepout, ctx) {
|
|
|
51894
51894
|
});
|
|
51895
51895
|
} else if (keepout.shape === "circle") {
|
|
51896
51896
|
const circleKeepout = keepout;
|
|
51897
|
-
const [cx2, cy2] =
|
|
51897
|
+
const [cx2, cy2] = applyToPoint20(transform2, [
|
|
51898
51898
|
circleKeepout.center.x,
|
|
51899
51899
|
circleKeepout.center.y
|
|
51900
51900
|
]);
|
|
@@ -51933,7 +51933,7 @@ function ringToPathD(vertices, transform2) {
|
|
|
51933
51933
|
if (vertices.length === 0)
|
|
51934
51934
|
return "";
|
|
51935
51935
|
const transformedVertices = vertices.map((v3) => {
|
|
51936
|
-
const [x3, y] =
|
|
51936
|
+
const [x3, y] = applyToPoint20(transform2, [v3.x, v3.y]);
|
|
51937
51937
|
return { ...v3, x: x3, y };
|
|
51938
51938
|
});
|
|
51939
51939
|
let d = `M ${transformedVertices[0].x} ${transformedVertices[0].y}`;
|
|
@@ -52018,7 +52018,7 @@ function createSvgObjectsFromPcbCopperPour(pour, ctx) {
|
|
|
52018
52018
|
const maskOverlayColor = layer === "bottom" ? colorMap2.soldermaskOverCopper.bottom : colorMap2.soldermaskOverCopper.top;
|
|
52019
52019
|
const maskOverlayOpacity = "0.9";
|
|
52020
52020
|
if (pour.shape === "rect") {
|
|
52021
|
-
const [cx2, cy2] =
|
|
52021
|
+
const [cx2, cy2] = applyToPoint20(transform2, [pour.center.x, pour.center.y]);
|
|
52022
52022
|
const scaledWidth = pour.width * Math.abs(transform2.a);
|
|
52023
52023
|
const scaledHeight = pour.height * Math.abs(transform2.d);
|
|
52024
52024
|
const svgRotation = -(pour.rotation ?? 0);
|
|
@@ -52068,7 +52068,7 @@ function createSvgObjectsFromPcbCopperPour(pour, ctx) {
|
|
|
52068
52068
|
if (pour.shape === "polygon") {
|
|
52069
52069
|
if (!pour.points || pour.points.length === 0)
|
|
52070
52070
|
return [];
|
|
52071
|
-
const transformedPoints = pour.points.map((p) =>
|
|
52071
|
+
const transformedPoints = pour.points.map((p) => applyToPoint20(transform2, [p.x, p.y]));
|
|
52072
52072
|
const pointsString = transformedPoints.map((p) => `${p[0]},${p[1]}`).join(" ");
|
|
52073
52073
|
const copperPolygon = {
|
|
52074
52074
|
name: "polygon",
|
|
@@ -52277,7 +52277,7 @@ function createMajorGridPatternChildren(cellSize, majorCellSize, lineColor, majo
|
|
|
52277
52277
|
function createSvgObjectsFromPcbComponent(component, ctx) {
|
|
52278
52278
|
const { transform: transform2, circuitJson } = ctx;
|
|
52279
52279
|
const { center, width, height, rotation: rotation2 = 0 } = component;
|
|
52280
|
-
const [x3, y] =
|
|
52280
|
+
const [x3, y] = applyToPoint20(transform2, [center.x, center.y]);
|
|
52281
52281
|
const scaledWidth = width * Math.abs(transform2.a);
|
|
52282
52282
|
const scaledHeight = height * Math.abs(transform2.d);
|
|
52283
52283
|
const transformStr = `translate(${x3}, ${y}) rotate(${-rotation2}) scale(1, -1)`;
|
|
@@ -52380,7 +52380,7 @@ function createSvgObjectsFromPcbGroup(pcbGroup, ctx) {
|
|
|
52380
52380
|
}
|
|
52381
52381
|
if (outline && outline.length >= 3 && outline.every((point2) => point2 && typeof point2.x === "number" && typeof point2.y === "number")) {
|
|
52382
52382
|
const path42 = outline.map((point2, index) => {
|
|
52383
|
-
const [x3, y] =
|
|
52383
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
52384
52384
|
return index === 0 ? `M ${x3} ${y}` : `L ${x3} ${y}`;
|
|
52385
52385
|
}).join(" ");
|
|
52386
52386
|
svgObjects.push({
|
|
@@ -52401,11 +52401,11 @@ function createSvgObjectsFromPcbGroup(pcbGroup, ctx) {
|
|
|
52401
52401
|
}
|
|
52402
52402
|
const halfWidth = width / 2;
|
|
52403
52403
|
const halfHeight = height / 2;
|
|
52404
|
-
const [topLeftX, topLeftY] =
|
|
52404
|
+
const [topLeftX, topLeftY] = applyToPoint20(transform2, [
|
|
52405
52405
|
center.x - halfWidth,
|
|
52406
52406
|
center.y + halfHeight
|
|
52407
52407
|
]);
|
|
52408
|
-
const [bottomRightX, bottomRightY] =
|
|
52408
|
+
const [bottomRightX, bottomRightY] = applyToPoint20(transform2, [
|
|
52409
52409
|
center.x + halfWidth,
|
|
52410
52410
|
center.y - halfHeight
|
|
52411
52411
|
]);
|
|
@@ -53307,8 +53307,8 @@ function createSvgObjects({
|
|
|
53307
53307
|
}
|
|
53308
53308
|
}
|
|
53309
53309
|
function createSvgObjectFromPcbBoundary(transform2, minX, minY, maxX, maxY) {
|
|
53310
|
-
const [x12, y12] =
|
|
53311
|
-
const [x22, y22] =
|
|
53310
|
+
const [x12, y12] = applyToPoint20(transform2, [minX, minY]);
|
|
53311
|
+
const [x22, y22] = applyToPoint20(transform2, [maxX, maxY]);
|
|
53312
53312
|
const width = Math.abs(x22 - x12);
|
|
53313
53313
|
const height = Math.abs(y22 - y12);
|
|
53314
53314
|
const x3 = Math.min(x12, x22);
|
|
@@ -53337,25 +53337,25 @@ function createSvgObjectsFromAssemblyBoard(pcbBoard, transform2, style = {}) {
|
|
|
53337
53337
|
let path42;
|
|
53338
53338
|
if (outline && Array.isArray(outline) && outline.length >= 3) {
|
|
53339
53339
|
path42 = outline.map((point2, index) => {
|
|
53340
|
-
const [x3, y] =
|
|
53340
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
53341
53341
|
return index === 0 ? `M ${x3} ${y}` : `L ${x3} ${y}`;
|
|
53342
53342
|
}).join(" ");
|
|
53343
53343
|
} else {
|
|
53344
53344
|
const halfWidth = width / 2;
|
|
53345
53345
|
const halfHeight = height / 2;
|
|
53346
|
-
const topLeft =
|
|
53346
|
+
const topLeft = applyToPoint20(transform2, [
|
|
53347
53347
|
center.x - halfWidth,
|
|
53348
53348
|
center.y - halfHeight
|
|
53349
53349
|
]);
|
|
53350
|
-
const topRight =
|
|
53350
|
+
const topRight = applyToPoint20(transform2, [
|
|
53351
53351
|
center.x + halfWidth,
|
|
53352
53352
|
center.y - halfHeight
|
|
53353
53353
|
]);
|
|
53354
|
-
const bottomRight =
|
|
53354
|
+
const bottomRight = applyToPoint20(transform2, [
|
|
53355
53355
|
center.x + halfWidth,
|
|
53356
53356
|
center.y + halfHeight
|
|
53357
53357
|
]);
|
|
53358
|
-
const bottomLeft =
|
|
53358
|
+
const bottomLeft = applyToPoint20(transform2, [
|
|
53359
53359
|
center.x - halfWidth,
|
|
53360
53360
|
center.y + halfHeight
|
|
53361
53361
|
]);
|
|
@@ -53385,8 +53385,8 @@ function createSvgObjectsFromAssemblyComponent(params2, ctx) {
|
|
|
53385
53385
|
const { center, width, height, rotation: rotation2 = 0, layer = "top" } = elm;
|
|
53386
53386
|
if (!center || typeof width !== "number" || typeof height !== "number")
|
|
53387
53387
|
return null;
|
|
53388
|
-
const [x3, y] =
|
|
53389
|
-
const [pinX, pinY] =
|
|
53388
|
+
const [x3, y] = applyToPoint20(transform2, [center.x, center.y]);
|
|
53389
|
+
const [pinX, pinY] = applyToPoint20(transform2, [portPosition.x, portPosition.y]);
|
|
53390
53390
|
const scaledWidth = width * Math.abs(transform2.a);
|
|
53391
53391
|
const scaledHeight = height * Math.abs(transform2.d);
|
|
53392
53392
|
const isTopLayer = layer === "top";
|
|
@@ -53524,7 +53524,7 @@ function getRectPathData(w3, h, rotation2) {
|
|
|
53524
53524
|
}
|
|
53525
53525
|
function createSvgObjectsFromAssemblyHole(hole, ctx) {
|
|
53526
53526
|
const { transform: transform2 } = ctx;
|
|
53527
|
-
const [x3, y] =
|
|
53527
|
+
const [x3, y] = applyToPoint20(transform2, [hole.x, hole.y]);
|
|
53528
53528
|
if (hole.hole_shape === "circle" || hole.hole_shape === "square") {
|
|
53529
53529
|
const scaledDiameter = hole.hole_diameter * Math.abs(transform2.a);
|
|
53530
53530
|
const radius = scaledDiameter / 2;
|
|
@@ -53588,7 +53588,7 @@ function createSvgObjectsFromAssemblyHole(hole, ctx) {
|
|
|
53588
53588
|
}
|
|
53589
53589
|
function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
|
|
53590
53590
|
const { transform: transform2 } = ctx;
|
|
53591
|
-
const [x3, y] =
|
|
53591
|
+
const [x3, y] = applyToPoint20(transform2, [hole.x, hole.y]);
|
|
53592
53592
|
if (hole.shape === "pill") {
|
|
53593
53593
|
const scaledOuterWidth = hole.outer_width * Math.abs(transform2.a);
|
|
53594
53594
|
const scaledOuterHeight = hole.outer_height * Math.abs(transform2.a);
|
|
@@ -53682,7 +53682,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
|
|
|
53682
53682
|
const scaledRectBorderRadius = (circularHole.rect_border_radius ?? 0) * Math.abs(transform2.a);
|
|
53683
53683
|
const rectCcwRotation = circularHole.rect_ccw_rotation ?? 0;
|
|
53684
53684
|
const holeRadius = scaledHoleDiameter / 2;
|
|
53685
|
-
const [holeCx, holeCy] =
|
|
53685
|
+
const [holeCx, holeCy] = applyToPoint20(transform2, [
|
|
53686
53686
|
circularHole.x + circularHole.hole_offset_x,
|
|
53687
53687
|
circularHole.y + circularHole.hole_offset_y
|
|
53688
53688
|
]);
|
|
@@ -53744,7 +53744,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
|
|
|
53744
53744
|
const pillHoleWithOffsets = pillHole;
|
|
53745
53745
|
const holeOffsetX = pillHoleWithOffsets.hole_offset_x ?? 0;
|
|
53746
53746
|
const holeOffsetY = pillHoleWithOffsets.hole_offset_y ?? 0;
|
|
53747
|
-
const [holeCenterX, holeCenterY] =
|
|
53747
|
+
const [holeCenterX, holeCenterY] = applyToPoint20(transform2, [
|
|
53748
53748
|
pillHole.x + holeOffsetX,
|
|
53749
53749
|
pillHole.y + holeOffsetY
|
|
53750
53750
|
]);
|
|
@@ -53804,7 +53804,7 @@ function createSvgObjectsFromAssemblyPlatedHole(hole, ctx) {
|
|
|
53804
53804
|
const rotatedHoleWithOffsets = rotatedHole;
|
|
53805
53805
|
const holeOffsetX = rotatedHoleWithOffsets.hole_offset_x ?? 0;
|
|
53806
53806
|
const holeOffsetY = rotatedHoleWithOffsets.hole_offset_y ?? 0;
|
|
53807
|
-
const [holeCenterX, holeCenterY] =
|
|
53807
|
+
const [holeCenterX, holeCenterY] = applyToPoint20(transform2, [
|
|
53808
53808
|
rotatedHole.x + holeOffsetX,
|
|
53809
53809
|
rotatedHole.y + holeOffsetY
|
|
53810
53810
|
]);
|
|
@@ -53863,7 +53863,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
|
|
|
53863
53863
|
if (pad.shape === "rect" || pad.shape === "rotated_rect") {
|
|
53864
53864
|
const width = pad.width * Math.abs(transform2.a);
|
|
53865
53865
|
const height = pad.height * Math.abs(transform2.d);
|
|
53866
|
-
const [x3, y] =
|
|
53866
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
53867
53867
|
const scaledBorderRadius = (pad.rect_border_radius ?? 0) * Math.abs(transform2.a);
|
|
53868
53868
|
if (pad.shape === "rotated_rect" && pad.ccw_rotation) {
|
|
53869
53869
|
return [
|
|
@@ -53915,7 +53915,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
|
|
|
53915
53915
|
const width = pad.width * Math.abs(transform2.a);
|
|
53916
53916
|
const height = pad.height * Math.abs(transform2.d);
|
|
53917
53917
|
const radius = pad.radius * Math.abs(transform2.a);
|
|
53918
|
-
const [x3, y] =
|
|
53918
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
53919
53919
|
return [
|
|
53920
53920
|
{
|
|
53921
53921
|
name: "rect",
|
|
@@ -53938,7 +53938,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
|
|
|
53938
53938
|
}
|
|
53939
53939
|
if (pad.shape === "circle") {
|
|
53940
53940
|
const radius = pad.radius * Math.abs(transform2.a);
|
|
53941
|
-
const [x3, y] =
|
|
53941
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
53942
53942
|
return [
|
|
53943
53943
|
{
|
|
53944
53944
|
name: "circle",
|
|
@@ -53957,7 +53957,7 @@ function createSvgObjectsFromAssemblySmtPad(pad, ctx) {
|
|
|
53957
53957
|
];
|
|
53958
53958
|
}
|
|
53959
53959
|
if (pad.shape === "polygon") {
|
|
53960
|
-
const points = (pad.points ?? []).map((point2) =>
|
|
53960
|
+
const points = (pad.points ?? []).map((point2) => applyToPoint20(transform2, [point2.x, point2.y]));
|
|
53961
53961
|
return [
|
|
53962
53962
|
{
|
|
53963
53963
|
name: "polygon",
|
|
@@ -54117,8 +54117,8 @@ function createSvgObjects2(elm, ctx, soup) {
|
|
|
54117
54117
|
}
|
|
54118
54118
|
}
|
|
54119
54119
|
function createSvgObjectFromAssemblyBoundary(transform2, minX, minY, maxX, maxY) {
|
|
54120
|
-
const [x12, y12] =
|
|
54121
|
-
const [x22, y22] =
|
|
54120
|
+
const [x12, y12] = applyToPoint20(transform2, [minX, minY]);
|
|
54121
|
+
const [x22, y22] = applyToPoint20(transform2, [maxX, maxY]);
|
|
54122
54122
|
const width = Math.abs(x22 - x12);
|
|
54123
54123
|
const height = Math.abs(y22 - y12);
|
|
54124
54124
|
const x3 = Math.min(x12, x22);
|
|
@@ -54145,25 +54145,25 @@ function createSvgObjectsFromPinoutBoard(pcbBoard, ctx) {
|
|
|
54145
54145
|
let path42;
|
|
54146
54146
|
if (outline && Array.isArray(outline) && outline.length >= 3) {
|
|
54147
54147
|
path42 = outline.map((point2, index) => {
|
|
54148
|
-
const [x3, y] =
|
|
54148
|
+
const [x3, y] = applyToPoint20(transform2, [point2.x, point2.y]);
|
|
54149
54149
|
return index === 0 ? `M ${x3} ${y}` : `L ${x3} ${y}`;
|
|
54150
54150
|
}).join(" ");
|
|
54151
54151
|
} else {
|
|
54152
54152
|
const halfWidth = width / 2;
|
|
54153
54153
|
const halfHeight = height / 2;
|
|
54154
|
-
const topLeft =
|
|
54154
|
+
const topLeft = applyToPoint20(transform2, [
|
|
54155
54155
|
center.x - halfWidth,
|
|
54156
54156
|
center.y - halfHeight
|
|
54157
54157
|
]);
|
|
54158
|
-
const topRight =
|
|
54158
|
+
const topRight = applyToPoint20(transform2, [
|
|
54159
54159
|
center.x + halfWidth,
|
|
54160
54160
|
center.y - halfHeight
|
|
54161
54161
|
]);
|
|
54162
|
-
const bottomRight =
|
|
54162
|
+
const bottomRight = applyToPoint20(transform2, [
|
|
54163
54163
|
center.x + halfWidth,
|
|
54164
54164
|
center.y + halfHeight
|
|
54165
54165
|
]);
|
|
54166
|
-
const bottomLeft =
|
|
54166
|
+
const bottomLeft = applyToPoint20(transform2, [
|
|
54167
54167
|
center.x - halfWidth,
|
|
54168
54168
|
center.y + halfHeight
|
|
54169
54169
|
]);
|
|
@@ -54181,10 +54181,10 @@ function createSvgObjectsFromPinoutBoard(pcbBoard, ctx) {
|
|
|
54181
54181
|
const halfWidth = width2 / 2;
|
|
54182
54182
|
const halfHeight = height2 / 2;
|
|
54183
54183
|
const [tl2, tr2, br2, bl2] = [
|
|
54184
|
-
|
|
54185
|
-
|
|
54186
|
-
|
|
54187
|
-
|
|
54184
|
+
applyToPoint20(transform2, [x3 - halfWidth, y - halfHeight]),
|
|
54185
|
+
applyToPoint20(transform2, [x3 + halfWidth, y - halfHeight]),
|
|
54186
|
+
applyToPoint20(transform2, [x3 + halfWidth, y + halfHeight]),
|
|
54187
|
+
applyToPoint20(transform2, [x3 - halfWidth, y + halfHeight])
|
|
54188
54188
|
];
|
|
54189
54189
|
path42 += ` M ${tl2[0]} ${tl2[1]} L ${tr2[0]} ${tr2[1]} L ${br2[0]} ${br2[1]} L ${bl2[0]} ${bl2[1]} Z`;
|
|
54190
54190
|
} else if (cutout.shape === "circle") {}
|
|
@@ -54237,7 +54237,7 @@ function createSvgObjectsFromPinoutComponent(elm, ctx) {
|
|
|
54237
54237
|
if (!center || typeof width !== "number" || typeof height !== "number" || width === 0 || height === 0) {
|
|
54238
54238
|
return [];
|
|
54239
54239
|
}
|
|
54240
|
-
const [x3, y] =
|
|
54240
|
+
const [x3, y] = applyToPoint20(transform2, [center.x, center.y]);
|
|
54241
54241
|
const scaledWidth = width * Math.abs(transform2.a);
|
|
54242
54242
|
const scaledHeight = height * Math.abs(transform2.d);
|
|
54243
54243
|
const transformStr = `translate(${x3}, ${y})`;
|
|
@@ -54298,7 +54298,7 @@ function createSvgObjectsFromPinoutComponent(elm, ctx) {
|
|
|
54298
54298
|
}
|
|
54299
54299
|
function createSvgObjectsFromPinoutHole(hole, ctx) {
|
|
54300
54300
|
const { transform: transform2 } = ctx;
|
|
54301
|
-
const [x3, y] =
|
|
54301
|
+
const [x3, y] = applyToPoint20(transform2, [hole.x, hole.y]);
|
|
54302
54302
|
if (hole.hole_shape === "circle" || hole.hole_shape === "square") {
|
|
54303
54303
|
const scaledDiameter = hole.hole_diameter * Math.abs(transform2.a);
|
|
54304
54304
|
const radius = scaledDiameter / 2;
|
|
@@ -54362,7 +54362,7 @@ function createSvgObjectsFromPinoutHole(hole, ctx) {
|
|
|
54362
54362
|
}
|
|
54363
54363
|
function createSvgObjectsFromPinoutPlatedHole(hole, ctx) {
|
|
54364
54364
|
const { transform: transform2 } = ctx;
|
|
54365
|
-
const [x3, y] =
|
|
54365
|
+
const [x3, y] = applyToPoint20(transform2, [hole.x, hole.y]);
|
|
54366
54366
|
if (hole.shape === "pill") {
|
|
54367
54367
|
const scaledOuterWidth = hole.outer_width * Math.abs(transform2.a);
|
|
54368
54368
|
const scaledOuterHeight = hole.outer_height * Math.abs(transform2.a);
|
|
@@ -54594,7 +54594,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
|
|
|
54594
54594
|
if (pad.shape === "rect" || pad.shape === "rotated_rect") {
|
|
54595
54595
|
const width = pad.width * Math.abs(transform2.a);
|
|
54596
54596
|
const height = pad.height * Math.abs(transform2.d);
|
|
54597
|
-
const [x3, y] =
|
|
54597
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
54598
54598
|
if (pad.shape === "rotated_rect" && pad.ccw_rotation) {
|
|
54599
54599
|
return [
|
|
54600
54600
|
{
|
|
@@ -54637,7 +54637,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
|
|
|
54637
54637
|
const width = pad.width * Math.abs(transform2.a);
|
|
54638
54638
|
const height = pad.height * Math.abs(transform2.d);
|
|
54639
54639
|
const radius = pad.radius * Math.abs(transform2.a);
|
|
54640
|
-
const [x3, y] =
|
|
54640
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
54641
54641
|
return [
|
|
54642
54642
|
{
|
|
54643
54643
|
name: "rect",
|
|
@@ -54660,7 +54660,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
|
|
|
54660
54660
|
}
|
|
54661
54661
|
if (pad.shape === "circle") {
|
|
54662
54662
|
const radius = pad.radius * Math.abs(transform2.a);
|
|
54663
|
-
const [x3, y] =
|
|
54663
|
+
const [x3, y] = applyToPoint20(transform2, [pad.x, pad.y]);
|
|
54664
54664
|
return [
|
|
54665
54665
|
{
|
|
54666
54666
|
name: "circle",
|
|
@@ -54679,7 +54679,7 @@ function createSvgObjectsFromPinoutSmtPad(pad, ctx) {
|
|
|
54679
54679
|
];
|
|
54680
54680
|
}
|
|
54681
54681
|
if (pad.shape === "polygon") {
|
|
54682
|
-
const points = (pad.points ?? []).map((point2) =>
|
|
54682
|
+
const points = (pad.points ?? []).map((point2) => applyToPoint20(transform2, [point2.x, point2.y]));
|
|
54683
54683
|
return [
|
|
54684
54684
|
{
|
|
54685
54685
|
name: "polygon",
|
|
@@ -54764,7 +54764,7 @@ function createSvgObjectsFromPinoutPort(pcb_port2, ctx) {
|
|
|
54764
54764
|
if (!label_info)
|
|
54765
54765
|
return [];
|
|
54766
54766
|
const { text: label, aliases, elbow_end, label_pos, edge } = label_info;
|
|
54767
|
-
const [port_x, port_y] =
|
|
54767
|
+
const [port_x, port_y] = applyToPoint20(ctx.transform, [pcb_port2.x, pcb_port2.y]);
|
|
54768
54768
|
const start_facing_direction = edge === "left" ? "x-" : edge === "right" ? "x+" : edge === "top" ? "y-" : "y+";
|
|
54769
54769
|
const end_facing_direction = edge === "left" ? "x+" : edge === "right" ? "x-" : edge === "top" ? "y+" : "y-";
|
|
54770
54770
|
const elbow_path = calculateElbow({
|
|
@@ -54914,7 +54914,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
|
|
|
54914
54914
|
const other_pins = pinout_labels.filter((l) => Math.abs(l.pcb_port.x - primary_x) >= 0.2);
|
|
54915
54915
|
const mapToEdgePort = (pinout_label) => ({
|
|
54916
54916
|
pcb_port: pinout_label.pcb_port,
|
|
54917
|
-
y:
|
|
54917
|
+
y: applyToPoint20(transform2, [
|
|
54918
54918
|
pinout_label.pcb_port.x,
|
|
54919
54919
|
pinout_label.pcb_port.y
|
|
54920
54920
|
])[1],
|
|
@@ -54929,7 +54929,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
|
|
|
54929
54929
|
} else {
|
|
54930
54930
|
edge_ports = pinout_labels.map((pinout_label) => ({
|
|
54931
54931
|
pcb_port: pinout_label.pcb_port,
|
|
54932
|
-
y:
|
|
54932
|
+
y: applyToPoint20(transform2, [
|
|
54933
54933
|
pinout_label.pcb_port.x,
|
|
54934
54934
|
pinout_label.pcb_port.y
|
|
54935
54935
|
])[1],
|
|
@@ -54938,7 +54938,7 @@ function calculateVerticalEdgeLabels(edge, pinout_labels, {
|
|
|
54938
54938
|
}
|
|
54939
54939
|
if (edge_ports.length === 0)
|
|
54940
54940
|
return;
|
|
54941
|
-
const board_edge_x =
|
|
54941
|
+
const board_edge_x = applyToPoint20(transform2, [
|
|
54942
54942
|
edge === "left" ? board_bounds.minX : board_bounds.maxX,
|
|
54943
54943
|
0
|
|
54944
54944
|
])[0];
|
|
@@ -55285,7 +55285,7 @@ function drawSchematicGrid(params2) {
|
|
|
55285
55285
|
const labelCells = params2.labelCells ?? false;
|
|
55286
55286
|
const gridLines = [];
|
|
55287
55287
|
const transformPoint = (x3, y) => {
|
|
55288
|
-
const [transformedX, transformedY] =
|
|
55288
|
+
const [transformedX, transformedY] = applyToPoint20(params2.transform, [x3, y]);
|
|
55289
55289
|
return { x: transformedX, y: transformedY };
|
|
55290
55290
|
};
|
|
55291
55291
|
for (let x3 = Math.floor(minX);x3 <= Math.ceil(maxX); x3 += cellSize) {
|
|
@@ -55369,10 +55369,10 @@ function drawSchematicLabeledPoints(params2) {
|
|
|
55369
55369
|
const { points, transform: transform2 } = params2;
|
|
55370
55370
|
const labeledPointsGroup = [];
|
|
55371
55371
|
for (const point2 of points) {
|
|
55372
|
-
const [x12, y12] =
|
|
55373
|
-
const [x22, y22] =
|
|
55374
|
-
const [x3, y32] =
|
|
55375
|
-
const [x4, y4] =
|
|
55372
|
+
const [x12, y12] = applyToPoint20(transform2, [point2.x - 0.1, point2.y - 0.1]);
|
|
55373
|
+
const [x22, y22] = applyToPoint20(transform2, [point2.x + 0.1, point2.y + 0.1]);
|
|
55374
|
+
const [x3, y32] = applyToPoint20(transform2, [point2.x - 0.1, point2.y + 0.1]);
|
|
55375
|
+
const [x4, y4] = applyToPoint20(transform2, [point2.x + 0.1, point2.y - 0.1]);
|
|
55376
55376
|
labeledPointsGroup.push({
|
|
55377
55377
|
name: "path",
|
|
55378
55378
|
type: "element",
|
|
@@ -55383,7 +55383,7 @@ function drawSchematicLabeledPoints(params2) {
|
|
|
55383
55383
|
"stroke-opacity": "0.7"
|
|
55384
55384
|
}
|
|
55385
55385
|
});
|
|
55386
|
-
const [labelX, labelY] =
|
|
55386
|
+
const [labelX, labelY] = applyToPoint20(transform2, [
|
|
55387
55387
|
point2.x + 0.15,
|
|
55388
55388
|
point2.y - 0.15
|
|
55389
55389
|
]);
|
|
@@ -55600,7 +55600,7 @@ function createSvgObjectsFromSchVoltageProbe({
|
|
|
55600
55600
|
transform: transform2,
|
|
55601
55601
|
colorMap: colorMap2
|
|
55602
55602
|
}) {
|
|
55603
|
-
const [screenX, screenY] =
|
|
55603
|
+
const [screenX, screenY] = applyToPoint20(transform2, [
|
|
55604
55604
|
probe.position.x,
|
|
55605
55605
|
probe.position.y
|
|
55606
55606
|
]);
|
|
@@ -55777,11 +55777,11 @@ function createSvgObjectsFromSchDebugObject({
|
|
|
55777
55777
|
transform: transform2
|
|
55778
55778
|
}) {
|
|
55779
55779
|
if (debugObject.shape === "rect") {
|
|
55780
|
-
let [screenLeft, screenTop] =
|
|
55780
|
+
let [screenLeft, screenTop] = applyToPoint20(transform2, [
|
|
55781
55781
|
debugObject.center.x - debugObject.size.width / 2,
|
|
55782
55782
|
debugObject.center.y - debugObject.size.height / 2
|
|
55783
55783
|
]);
|
|
55784
|
-
let [screenRight, screenBottom] =
|
|
55784
|
+
let [screenRight, screenBottom] = applyToPoint20(transform2, [
|
|
55785
55785
|
debugObject.center.x + debugObject.size.width / 2,
|
|
55786
55786
|
debugObject.center.y + debugObject.size.height / 2
|
|
55787
55787
|
]);
|
|
@@ -55791,7 +55791,7 @@ function createSvgObjectsFromSchDebugObject({
|
|
|
55791
55791
|
];
|
|
55792
55792
|
const width = Math.abs(screenRight - screenLeft);
|
|
55793
55793
|
const height = Math.abs(screenBottom - screenTop);
|
|
55794
|
-
const [screenCenterX, screenCenterY] =
|
|
55794
|
+
const [screenCenterX, screenCenterY] = applyToPoint20(transform2, [
|
|
55795
55795
|
debugObject.center.x,
|
|
55796
55796
|
debugObject.center.y
|
|
55797
55797
|
]);
|
|
@@ -55837,11 +55837,11 @@ function createSvgObjectsFromSchDebugObject({
|
|
|
55837
55837
|
];
|
|
55838
55838
|
}
|
|
55839
55839
|
if (debugObject.shape === "line") {
|
|
55840
|
-
const [screenStartX, screenStartY] =
|
|
55840
|
+
const [screenStartX, screenStartY] = applyToPoint20(transform2, [
|
|
55841
55841
|
debugObject.start.x,
|
|
55842
55842
|
debugObject.start.y
|
|
55843
55843
|
]);
|
|
55844
|
-
const [screenEndX, screenEndY] =
|
|
55844
|
+
const [screenEndX, screenEndY] = applyToPoint20(transform2, [
|
|
55845
55845
|
debugObject.end.x,
|
|
55846
55846
|
debugObject.end.y
|
|
55847
55847
|
]);
|
|
@@ -55904,11 +55904,11 @@ function createSchematicTrace({
|
|
|
55904
55904
|
const edge = edges[edgeIndex];
|
|
55905
55905
|
if (edge.is_crossing)
|
|
55906
55906
|
continue;
|
|
55907
|
-
const [screenFromX, screenFromY] =
|
|
55907
|
+
const [screenFromX, screenFromY] = applyToPoint20(transform2, [
|
|
55908
55908
|
edge.from.x,
|
|
55909
55909
|
edge.from.y
|
|
55910
55910
|
]);
|
|
55911
|
-
const [screenToX, screenToY] =
|
|
55911
|
+
const [screenToX, screenToY] = applyToPoint20(transform2, [
|
|
55912
55912
|
edge.to.x,
|
|
55913
55913
|
edge.to.y
|
|
55914
55914
|
]);
|
|
@@ -55953,11 +55953,11 @@ function createSchematicTrace({
|
|
|
55953
55953
|
for (const edge of edges) {
|
|
55954
55954
|
if (!edge.is_crossing)
|
|
55955
55955
|
continue;
|
|
55956
|
-
const [screenFromX, screenFromY] =
|
|
55956
|
+
const [screenFromX, screenFromY] = applyToPoint20(transform2, [
|
|
55957
55957
|
edge.from.x,
|
|
55958
55958
|
edge.from.y
|
|
55959
55959
|
]);
|
|
55960
|
-
const [screenToX, screenToY] =
|
|
55960
|
+
const [screenToX, screenToY] = applyToPoint20(transform2, [
|
|
55961
55961
|
edge.to.x,
|
|
55962
55962
|
edge.to.y
|
|
55963
55963
|
]);
|
|
@@ -56001,7 +56001,7 @@ function createSchematicTrace({
|
|
|
56001
56001
|
}
|
|
56002
56002
|
if (trace.junctions) {
|
|
56003
56003
|
for (const junction of trace.junctions) {
|
|
56004
|
-
const [screenX, screenY] =
|
|
56004
|
+
const [screenX, screenY] = applyToPoint20(transform2, [
|
|
56005
56005
|
junction.x,
|
|
56006
56006
|
junction.y
|
|
56007
56007
|
]);
|
|
@@ -56058,8 +56058,8 @@ function createSvgObjectsFromSchematicLine({
|
|
|
56058
56058
|
transform: transform2,
|
|
56059
56059
|
colorMap: colorMap2
|
|
56060
56060
|
}) {
|
|
56061
|
-
const p12 =
|
|
56062
|
-
const p22 =
|
|
56061
|
+
const p12 = applyToPoint20(transform2, { x: schLine.x1, y: schLine.y1 });
|
|
56062
|
+
const p22 = applyToPoint20(transform2, { x: schLine.x2, y: schLine.y2 });
|
|
56063
56063
|
const strokeWidth = schLine.stroke_width ?? 0.02;
|
|
56064
56064
|
const transformedStrokeWidth = Math.abs(transform2.a) * strokeWidth;
|
|
56065
56065
|
return [
|
|
@@ -56091,7 +56091,7 @@ function createSvgObjectsFromSchematicCircle({
|
|
|
56091
56091
|
transform: transform2,
|
|
56092
56092
|
colorMap: colorMap2
|
|
56093
56093
|
}) {
|
|
56094
|
-
const center =
|
|
56094
|
+
const center = applyToPoint20(transform2, schCircle.center);
|
|
56095
56095
|
const transformedRadius = Math.abs(transform2.a) * schCircle.radius;
|
|
56096
56096
|
const strokeWidth = schCircle.stroke_width ?? 0.02;
|
|
56097
56097
|
const transformedStrokeWidth = Math.abs(transform2.a) * strokeWidth;
|
|
@@ -56124,7 +56124,7 @@ function createSvgObjectsFromSchematicRect({
|
|
|
56124
56124
|
transform: transform2,
|
|
56125
56125
|
colorMap: colorMap2
|
|
56126
56126
|
}) {
|
|
56127
|
-
const center =
|
|
56127
|
+
const center = applyToPoint20(transform2, schRect.center);
|
|
56128
56128
|
const transformedWidth = Math.abs(transform2.a) * schRect.width;
|
|
56129
56129
|
const transformedHeight = Math.abs(transform2.d) * schRect.height;
|
|
56130
56130
|
const strokeWidth = schRect.stroke_width ?? 0.02;
|
|
@@ -56163,7 +56163,7 @@ function createSvgObjectsFromSchematicArc({
|
|
|
56163
56163
|
transform: transform2,
|
|
56164
56164
|
colorMap: colorMap2
|
|
56165
56165
|
}) {
|
|
56166
|
-
const center =
|
|
56166
|
+
const center = applyToPoint20(transform2, schArc.center);
|
|
56167
56167
|
const transformedRadius = Math.abs(transform2.a) * schArc.radius;
|
|
56168
56168
|
const strokeWidth = schArc.stroke_width ?? 0.02;
|
|
56169
56169
|
const transformedStrokeWidth = Math.abs(transform2.a) * strokeWidth;
|
|
@@ -56216,7 +56216,7 @@ function createSvgObjectsFromSchematicPath({
|
|
|
56216
56216
|
if (!schPath.points || schPath.points.length < 2) {
|
|
56217
56217
|
return [];
|
|
56218
56218
|
}
|
|
56219
|
-
const transformedPoints = schPath.points.map((p) =>
|
|
56219
|
+
const transformedPoints = schPath.points.map((p) => applyToPoint20(transform2, { x: p.x, y: p.y }));
|
|
56220
56220
|
const pathD = transformedPoints.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
|
|
56221
56221
|
return [
|
|
56222
56222
|
{
|
|
@@ -57163,7 +57163,7 @@ function createSvgObjectsFromSolderPaste(solderPaste, ctx) {
|
|
|
57163
57163
|
const { transform: transform2, layer: layerFilter } = ctx;
|
|
57164
57164
|
if (layerFilter && solderPaste.layer !== layerFilter)
|
|
57165
57165
|
return [];
|
|
57166
|
-
const [x3, y] =
|
|
57166
|
+
const [x3, y] = applyToPoint20(transform2, [solderPaste.x, solderPaste.y]);
|
|
57167
57167
|
if (solderPaste.shape === "rect" || solderPaste.shape === "rotated_rect") {
|
|
57168
57168
|
const width = solderPaste.width * Math.abs(transform2.a);
|
|
57169
57169
|
const height = solderPaste.height * Math.abs(transform2.d);
|
|
@@ -57372,8 +57372,8 @@ function createSvgObjects4({ elm, ctx }) {
|
|
|
57372
57372
|
}
|
|
57373
57373
|
}
|
|
57374
57374
|
function createSvgObjectFromPcbBoundary2(transform2, minX, minY, maxX, maxY) {
|
|
57375
|
-
const [x12, y12] =
|
|
57376
|
-
const [x22, y22] =
|
|
57375
|
+
const [x12, y12] = applyToPoint20(transform2, [minX, minY]);
|
|
57376
|
+
const [x22, y22] = applyToPoint20(transform2, [maxX, maxY]);
|
|
57377
57377
|
const width = Math.abs(x22 - x12);
|
|
57378
57378
|
const height = Math.abs(y22 - y12);
|
|
57379
57379
|
const x3 = Math.min(x12, x22);
|
|
@@ -57690,7 +57690,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57690
57690
|
realCenter,
|
|
57691
57691
|
realToScreenTransform
|
|
57692
57692
|
}) => {
|
|
57693
|
-
const screenCenter =
|
|
57693
|
+
const screenCenter = applyToPoint20(realToScreenTransform, realCenter);
|
|
57694
57694
|
return {
|
|
57695
57695
|
type: "element",
|
|
57696
57696
|
name: "text",
|
|
@@ -57776,8 +57776,8 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57776
57776
|
minY: Math.min(...paths.flatMap((p) => p.points.map((pt2) => pt2.y))),
|
|
57777
57777
|
maxY: Math.max(...paths.flatMap((p) => p.points.map((pt2) => pt2.y)))
|
|
57778
57778
|
};
|
|
57779
|
-
const [screenMinX, screenMinY] =
|
|
57780
|
-
const [screenMaxX, screenMaxY] =
|
|
57779
|
+
const [screenMinX, screenMinY] = applyToPoint20(compose5(realToScreenTransform, transformFromSymbolToReal), [bounds.minX, bounds.minY]);
|
|
57780
|
+
const [screenMaxX, screenMaxY] = applyToPoint20(compose5(realToScreenTransform, transformFromSymbolToReal), [bounds.maxX, bounds.maxY]);
|
|
57781
57781
|
const rectHeight = Math.abs(screenMaxY - screenMinY);
|
|
57782
57782
|
const rectY = Math.min(screenMinY, screenMaxY);
|
|
57783
57783
|
const rectWidth = Math.abs(screenMaxX - screenMinX);
|
|
@@ -57803,7 +57803,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57803
57803
|
name: "path",
|
|
57804
57804
|
attributes: {
|
|
57805
57805
|
d: points.map((p, i) => {
|
|
57806
|
-
const [x3, y] =
|
|
57806
|
+
const [x3, y] = applyToPoint20(compose5(realToScreenTransform, transformFromSymbolToReal), [p.x, p.y]);
|
|
57807
57807
|
return `${i === 0 ? "M" : "L"} ${x3} ${y}`;
|
|
57808
57808
|
}).join(" ") + (closed ? " Z" : ""),
|
|
57809
57809
|
stroke: colorMap2.schematic.component_outline,
|
|
@@ -57816,7 +57816,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57816
57816
|
});
|
|
57817
57817
|
}
|
|
57818
57818
|
for (const text of texts) {
|
|
57819
|
-
const screenTextPos =
|
|
57819
|
+
const screenTextPos = applyToPoint20(compose5(realToScreenTransform, transformFromSymbolToReal), text);
|
|
57820
57820
|
let textValue = "";
|
|
57821
57821
|
const isReferenceText = text.text === "{REF}";
|
|
57822
57822
|
if (isReferenceText) {
|
|
@@ -57855,7 +57855,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57855
57855
|
});
|
|
57856
57856
|
}
|
|
57857
57857
|
for (const box of boxes) {
|
|
57858
|
-
const screenBoxPos =
|
|
57858
|
+
const screenBoxPos = applyToPoint20(compose5(realToScreenTransform, transformFromSymbolToReal), box);
|
|
57859
57859
|
const symbolToScreenScale = compose5(realToScreenTransform, transformFromSymbolToReal).a;
|
|
57860
57860
|
svgObjects.push({
|
|
57861
57861
|
name: "rect",
|
|
@@ -57874,7 +57874,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57874
57874
|
for (const port of symbol.ports) {
|
|
57875
57875
|
if (connectedSymbolPorts.has(port))
|
|
57876
57876
|
continue;
|
|
57877
|
-
const screenPortPos =
|
|
57877
|
+
const screenPortPos = applyToPoint20(compose5(realToScreenTransform, transformFromSymbolToReal), port);
|
|
57878
57878
|
svgObjects.push({
|
|
57879
57879
|
type: "element",
|
|
57880
57880
|
name: "circle",
|
|
@@ -57891,7 +57891,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57891
57891
|
});
|
|
57892
57892
|
}
|
|
57893
57893
|
for (const circle of circles) {
|
|
57894
|
-
const screenCirclePos =
|
|
57894
|
+
const screenCirclePos = applyToPoint20(compose5(realToScreenTransform, transformFromSymbolToReal), circle);
|
|
57895
57895
|
const screenRadius = Math.abs(circle.radius * realToScreenTransform.a);
|
|
57896
57896
|
svgObjects.push({
|
|
57897
57897
|
type: "element",
|
|
@@ -57958,8 +57958,8 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57958
57958
|
realEdgePos.y += realPinLineLength;
|
|
57959
57959
|
break;
|
|
57960
57960
|
}
|
|
57961
|
-
const screenSchPortPos =
|
|
57962
|
-
const screenRealEdgePos =
|
|
57961
|
+
const screenSchPortPos = applyToPoint20(transform2, schPort.center);
|
|
57962
|
+
const screenRealEdgePos = applyToPoint20(transform2, realEdgePos);
|
|
57963
57963
|
const isConnected = isSourcePortConnected(circuitJson, schPort.source_port_id);
|
|
57964
57964
|
const is_drawn_with_inversion_circle = schPort.is_drawn_with_inversion_circle ?? false;
|
|
57965
57965
|
const BUBBLE_RADIUS_MM = 0.06;
|
|
@@ -57980,7 +57980,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
57980
57980
|
break;
|
|
57981
57981
|
}
|
|
57982
57982
|
}
|
|
57983
|
-
const screenLineEnd =
|
|
57983
|
+
const screenLineEnd = applyToPoint20(transform2, realLineEnd);
|
|
57984
57984
|
if (is_drawn_with_inversion_circle) {
|
|
57985
57985
|
const bubbleRadiusPx = Math.abs(transform2.a) * BUBBLE_RADIUS_MM;
|
|
57986
57986
|
const bubbleCenter = { ...screenRealEdgePos };
|
|
@@ -58137,7 +58137,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58137
58137
|
} else {
|
|
58138
58138
|
realPinNumberPos.y += 0.02;
|
|
58139
58139
|
}
|
|
58140
|
-
const screenPinNumberTextPos =
|
|
58140
|
+
const screenPinNumberTextPos = applyToPoint20(transform2, realPinNumberPos);
|
|
58141
58141
|
svgObjects.push({
|
|
58142
58142
|
name: "text",
|
|
58143
58143
|
type: "element",
|
|
@@ -58177,7 +58177,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58177
58177
|
const realPinEdgeDistance = schPort.distance_from_component_edge ?? 0.4;
|
|
58178
58178
|
realPinNumberPos.x += vecToEdge.x * (realPinEdgeDistance + LABEL_DIST_FROM_EDGE_MM);
|
|
58179
58179
|
realPinNumberPos.y += vecToEdge.y * (realPinEdgeDistance + LABEL_DIST_FROM_EDGE_MM);
|
|
58180
|
-
const screenPinNumberTextPos =
|
|
58180
|
+
const screenPinNumberTextPos = applyToPoint20(transform2, realPinNumberPos);
|
|
58181
58181
|
const label = schPort.display_pin_label ?? schComponent.port_labels?.[`${schPort.pin_number}`];
|
|
58182
58182
|
if (!label)
|
|
58183
58183
|
return [];
|
|
@@ -58223,7 +58223,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58223
58223
|
transform: transform2,
|
|
58224
58224
|
colorMap: colorMap2
|
|
58225
58225
|
}) => {
|
|
58226
|
-
const center =
|
|
58226
|
+
const center = applyToPoint20(transform2, elm.position);
|
|
58227
58227
|
const textAnchorMap = {
|
|
58228
58228
|
center: "middle",
|
|
58229
58229
|
center_right: "end",
|
|
@@ -58305,11 +58305,11 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58305
58305
|
colorMap: colorMap2
|
|
58306
58306
|
}) => {
|
|
58307
58307
|
const svgObjects = [];
|
|
58308
|
-
const componentScreenTopLeft =
|
|
58308
|
+
const componentScreenTopLeft = applyToPoint20(transform2, {
|
|
58309
58309
|
x: schComponent.center.x - schComponent.size.width / 2,
|
|
58310
58310
|
y: schComponent.center.y + schComponent.size.height / 2
|
|
58311
58311
|
});
|
|
58312
|
-
const componentScreenBottomRight =
|
|
58312
|
+
const componentScreenBottomRight = applyToPoint20(transform2, {
|
|
58313
58313
|
x: schComponent.center.x + schComponent.size.width / 2,
|
|
58314
58314
|
y: schComponent.center.y - schComponent.size.height / 2
|
|
58315
58315
|
});
|
|
@@ -58416,10 +58416,10 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58416
58416
|
x: symbolBounds.minX,
|
|
58417
58417
|
y: (symbolBounds.minY + symbolBounds.maxY) / 2
|
|
58418
58418
|
};
|
|
58419
|
-
const rotatedSymbolEnd =
|
|
58419
|
+
const rotatedSymbolEnd = applyToPoint20(rotationMatrix, symbolEndPoint);
|
|
58420
58420
|
const symbolToRealTransform = compose5(translate5(realAnchorPosition.x - rotatedSymbolEnd.x, realAnchorPosition.y - rotatedSymbolEnd.y), rotationMatrix, scale4(1));
|
|
58421
|
-
const [screenMinX, screenMinY] =
|
|
58422
|
-
const [screenMaxX, screenMaxY] =
|
|
58421
|
+
const [screenMinX, screenMinY] = applyToPoint20(compose5(realToScreenTransform, symbolToRealTransform), [bounds.minX, bounds.minY]);
|
|
58422
|
+
const [screenMaxX, screenMaxY] = applyToPoint20(compose5(realToScreenTransform, symbolToRealTransform), [bounds.maxX, bounds.maxY]);
|
|
58423
58423
|
const rectHeight = Math.abs(screenMaxY - screenMinY);
|
|
58424
58424
|
const rectY = Math.min(screenMinY, screenMaxY);
|
|
58425
58425
|
const rectWidth = Math.abs(screenMaxX - screenMinX);
|
|
@@ -58440,7 +58440,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58440
58440
|
});
|
|
58441
58441
|
for (const path42 of symbolPaths) {
|
|
58442
58442
|
const symbolPath = path42.points.map((p, i) => {
|
|
58443
|
-
const [x3, y] =
|
|
58443
|
+
const [x3, y] = applyToPoint20(compose5(realToScreenTransform, symbolToRealTransform), [p.x, p.y]);
|
|
58444
58444
|
return `${i === 0 ? "M" : "L"} ${x3} ${y}`;
|
|
58445
58445
|
}).join(" ");
|
|
58446
58446
|
svgObjects.push({
|
|
@@ -58458,7 +58458,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58458
58458
|
});
|
|
58459
58459
|
}
|
|
58460
58460
|
for (const text of symbolTexts) {
|
|
58461
|
-
const screenTextPos =
|
|
58461
|
+
const screenTextPos = applyToPoint20(compose5(realToScreenTransform, symbolToRealTransform), text);
|
|
58462
58462
|
let textValue = text.text;
|
|
58463
58463
|
if (textValue === "{REF}") {
|
|
58464
58464
|
textValue = labelText || "";
|
|
@@ -58497,7 +58497,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58497
58497
|
});
|
|
58498
58498
|
}
|
|
58499
58499
|
for (const box of symbolBoxes) {
|
|
58500
|
-
const screenBoxPos =
|
|
58500
|
+
const screenBoxPos = applyToPoint20(compose5(realToScreenTransform, symbolToRealTransform), box);
|
|
58501
58501
|
const symbolToScreenScale = compose5(realToScreenTransform, symbolToRealTransform).a;
|
|
58502
58502
|
svgObjects.push({
|
|
58503
58503
|
name: "rect",
|
|
@@ -58514,7 +58514,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58514
58514
|
});
|
|
58515
58515
|
}
|
|
58516
58516
|
for (const circle of symbolCircles) {
|
|
58517
|
-
const screenCirclePos =
|
|
58517
|
+
const screenCirclePos = applyToPoint20(compose5(realToScreenTransform, symbolToRealTransform), circle);
|
|
58518
58518
|
const symbolToScreenScale = compose5(realToScreenTransform, symbolToRealTransform).a;
|
|
58519
58519
|
svgObjects.push({
|
|
58520
58520
|
name: "circle",
|
|
@@ -58551,12 +58551,12 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58551
58551
|
const fontSizePx = getSchScreenFontSize(realToScreenTransform, "net_label");
|
|
58552
58552
|
const fontSizeMm = getSchMmFontSize("net_label");
|
|
58553
58553
|
const textWidthFSR = estimateTextWidth(labelText || "");
|
|
58554
|
-
const screenCenter =
|
|
58554
|
+
const screenCenter = applyToPoint20(realToScreenTransform, schNetLabel.center);
|
|
58555
58555
|
const realTextGrowthVec = getUnitVectorFromOutsideToEdge(schNetLabel.anchor_side);
|
|
58556
58556
|
const screenTextGrowthVec = { ...realTextGrowthVec };
|
|
58557
58557
|
screenTextGrowthVec.y *= -1;
|
|
58558
58558
|
const fullWidthFsr = textWidthFSR + ARROW_POINT_WIDTH_FSR * 2 + END_PADDING_EXTRA_PER_CHARACTER_FSR * labelText.length + END_PADDING_FSR;
|
|
58559
|
-
const screenAnchorPosition = schNetLabel.anchor_position ?
|
|
58559
|
+
const screenAnchorPosition = schNetLabel.anchor_position ? applyToPoint20(realToScreenTransform, schNetLabel.anchor_position) : {
|
|
58560
58560
|
x: screenCenter.x - screenTextGrowthVec.x * fullWidthFsr * fontSizePx / 2,
|
|
58561
58561
|
y: screenCenter.y - screenTextGrowthVec.y * fullWidthFsr * fontSizePx / 2
|
|
58562
58562
|
};
|
|
@@ -58591,7 +58591,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58591
58591
|
x: ARROW_POINT_WIDTH_FSR,
|
|
58592
58592
|
y: -0.6
|
|
58593
58593
|
}
|
|
58594
|
-
].map((fontRelativePoint) =>
|
|
58594
|
+
].map((fontRelativePoint) => applyToPoint20(compose5(realToScreenTransform, translate5(realAnchorPosition.x, realAnchorPosition.y), scale4(fontSizeMm), rotate6(pathRotation / 180 * Math.PI)), fontRelativePoint));
|
|
58595
58595
|
const pathD = `
|
|
58596
58596
|
M ${screenOutlinePoints[0].x},${screenOutlinePoints[0].y}
|
|
58597
58597
|
L ${screenOutlinePoints[1].x},${screenOutlinePoints[1].y}
|
|
@@ -58661,11 +58661,11 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58661
58661
|
transform: transform2,
|
|
58662
58662
|
colorMap: colorMap2
|
|
58663
58663
|
}) => {
|
|
58664
|
-
const topLeft =
|
|
58664
|
+
const topLeft = applyToPoint20(transform2, {
|
|
58665
58665
|
x: schematicBox.x,
|
|
58666
58666
|
y: schematicBox.y
|
|
58667
58667
|
});
|
|
58668
|
-
const bottomRight =
|
|
58668
|
+
const bottomRight = applyToPoint20(transform2, {
|
|
58669
58669
|
x: schematicBox.x + schematicBox.width,
|
|
58670
58670
|
y: schematicBox.y + schematicBox.height
|
|
58671
58671
|
});
|
|
@@ -58727,11 +58727,11 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58727
58727
|
const svgObjects = [];
|
|
58728
58728
|
const borderStrokeWidth = border_width * Math.abs(transform2.a);
|
|
58729
58729
|
const gridStrokeWidth = getSchStrokeSize(transform2);
|
|
58730
|
-
const [screenTopLeftX, screenTopLeftY] =
|
|
58730
|
+
const [screenTopLeftX, screenTopLeftY] = applyToPoint20(transform2, [
|
|
58731
58731
|
topLeftX,
|
|
58732
58732
|
topLeftY
|
|
58733
58733
|
]);
|
|
58734
|
-
const [screenBottomRightX, screenBottomRightY] =
|
|
58734
|
+
const [screenBottomRightX, screenBottomRightY] = applyToPoint20(transform2, [
|
|
58735
58735
|
topLeftX + totalWidth,
|
|
58736
58736
|
topLeftY - totalHeight
|
|
58737
58737
|
]);
|
|
@@ -58759,8 +58759,8 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58759
58759
|
const segmentEndY = segmentStartY - row_heights[j2];
|
|
58760
58760
|
const isMerged = cells.some((cell) => cell.start_column_index <= i && cell.end_column_index > i && cell.start_row_index <= j2 && cell.end_row_index >= j2);
|
|
58761
58761
|
if (!isMerged) {
|
|
58762
|
-
const start =
|
|
58763
|
-
const end =
|
|
58762
|
+
const start = applyToPoint20(transform2, { x: currentX, y: segmentStartY });
|
|
58763
|
+
const end = applyToPoint20(transform2, { x: currentX, y: segmentEndY });
|
|
58764
58764
|
svgObjects.push({
|
|
58765
58765
|
name: "line",
|
|
58766
58766
|
type: "element",
|
|
@@ -58787,11 +58787,11 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58787
58787
|
const segmentEndX = segmentStartX + column_widths[j2];
|
|
58788
58788
|
const isMerged = cells.some((cell) => cell.start_row_index <= i && cell.end_row_index > i && cell.start_column_index <= j2 && cell.end_column_index >= j2);
|
|
58789
58789
|
if (!isMerged) {
|
|
58790
|
-
const start =
|
|
58790
|
+
const start = applyToPoint20(transform2, {
|
|
58791
58791
|
x: segmentStartX,
|
|
58792
58792
|
y: currentY
|
|
58793
58793
|
});
|
|
58794
|
-
const end =
|
|
58794
|
+
const end = applyToPoint20(transform2, { x: segmentEndX, y: currentY });
|
|
58795
58795
|
svgObjects.push({
|
|
58796
58796
|
name: "line",
|
|
58797
58797
|
type: "element",
|
|
@@ -58833,7 +58833,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58833
58833
|
} else if (vertical_align === "bottom") {
|
|
58834
58834
|
realTextAnchorPos.y = cellTopLeftY - cellHeight + cell_padding;
|
|
58835
58835
|
}
|
|
58836
|
-
const screenTextAnchorPos =
|
|
58836
|
+
const screenTextAnchorPos = applyToPoint20(transform2, realTextAnchorPos);
|
|
58837
58837
|
const fontSize = getSchScreenFontSize(transform2, "reference_designator", cell.font_size);
|
|
58838
58838
|
const textAnchorMap = {
|
|
58839
58839
|
left: "start",
|
|
@@ -58885,7 +58885,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58885
58885
|
schPort,
|
|
58886
58886
|
transform: transform2
|
|
58887
58887
|
}) => {
|
|
58888
|
-
const screenSchPortPos =
|
|
58888
|
+
const screenSchPortPos = applyToPoint20(transform2, schPort.center);
|
|
58889
58889
|
const pinRadiusPx = Math.abs(transform2.a) * PIN_CIRCLE_RADIUS_MM2 * 2;
|
|
58890
58890
|
return [
|
|
58891
58891
|
{
|
|
@@ -58935,7 +58935,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58935
58935
|
const svgObjects = [];
|
|
58936
58936
|
const radiusPx = Math.abs(transform2.a) * PIN_CIRCLE_RADIUS_MM3;
|
|
58937
58937
|
const strokeWidth = Math.abs(transform2.a) * PIN_CIRCLE_RADIUS_MM3;
|
|
58938
|
-
const screenPos =
|
|
58938
|
+
const screenPos = applyToPoint20(transform2, schPort.center);
|
|
58939
58939
|
svgObjects.push({
|
|
58940
58940
|
name: "circle",
|
|
58941
58941
|
type: "element",
|
|
@@ -58982,7 +58982,7 @@ var import_debug2, svgAlphabet, lineAlphabet, debug2, debugPcb, debugSch, DEFAUL
|
|
|
58982
58982
|
textAnchor = "middle";
|
|
58983
58983
|
break;
|
|
58984
58984
|
}
|
|
58985
|
-
const screenLabelPos =
|
|
58985
|
+
const screenLabelPos = applyToPoint20(transform2, labelPos);
|
|
58986
58986
|
const fontSizePx = getSchScreenFontSize(transform2, "pin_number");
|
|
58987
58987
|
if (schPort.facing_direction === "up" || schPort.facing_direction === "down") {
|
|
58988
58988
|
rotation2 = `rotate(-90 ${screenLabelPos.x} ${screenLabelPos.y})`;
|
|
@@ -98176,7 +98176,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
|
98176
98176
|
// lib/getVersion.ts
|
|
98177
98177
|
import { createRequire as createRequire2 } from "node:module";
|
|
98178
98178
|
// package.json
|
|
98179
|
-
var version = "0.1.
|
|
98179
|
+
var version = "0.1.1161";
|
|
98180
98180
|
var package_default = {
|
|
98181
98181
|
name: "@tscircuit/cli",
|
|
98182
98182
|
version,
|
|
@@ -98208,7 +98208,7 @@ var package_default = {
|
|
|
98208
98208
|
"bun-match-svg": "^0.0.12",
|
|
98209
98209
|
chokidar: "4.0.1",
|
|
98210
98210
|
"circuit-json": "^0.0.403",
|
|
98211
|
-
"circuit-json-to-kicad": "^0.0.
|
|
98211
|
+
"circuit-json-to-kicad": "^0.0.89",
|
|
98212
98212
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
98213
98213
|
"circuit-json-to-spice": "^0.0.10",
|
|
98214
98214
|
"circuit-json-to-tscircuit": "^0.0.9",
|
|
@@ -102190,6 +102190,8 @@ import { Segment, SegmentNet } from "kicadts";
|
|
|
102190
102190
|
import { applyToPoint as applyToPoint14 } from "transformation-matrix";
|
|
102191
102191
|
import { Via, ViaNet } from "kicadts";
|
|
102192
102192
|
import { applyToPoint as applyToPoint15 } from "transformation-matrix";
|
|
102193
|
+
import { Footprint as Footprint4 } from "kicadts";
|
|
102194
|
+
import { applyToPoint as applyToPoint16 } from "transformation-matrix";
|
|
102193
102195
|
import { GrLine } from "kicadts";
|
|
102194
102196
|
import {
|
|
102195
102197
|
At as At2,
|
|
@@ -102198,8 +102200,8 @@ import {
|
|
|
102198
102200
|
TextEffectsFont as TextEffectsFont10,
|
|
102199
102201
|
TextEffectsJustify as TextEffectsJustify3
|
|
102200
102202
|
} from "kicadts";
|
|
102201
|
-
import { applyToPoint as
|
|
102202
|
-
import { applyToPoint as
|
|
102203
|
+
import { applyToPoint as applyToPoint17 } from "transformation-matrix";
|
|
102204
|
+
import { applyToPoint as applyToPoint19 } from "transformation-matrix";
|
|
102203
102205
|
import {
|
|
102204
102206
|
GrText as GrText2,
|
|
102205
102207
|
TextEffects as TextEffects11,
|
|
@@ -102207,7 +102209,7 @@ import {
|
|
|
102207
102209
|
TextEffectsJustify as TextEffectsJustify4,
|
|
102208
102210
|
At as At3
|
|
102209
102211
|
} from "kicadts";
|
|
102210
|
-
import { applyToPoint as
|
|
102212
|
+
import { applyToPoint as applyToPoint18 } from "transformation-matrix";
|
|
102211
102213
|
import { cju as cju3 } from "@tscircuit/circuit-json-util";
|
|
102212
102214
|
import { cju as cju4 } from "@tscircuit/circuit-json-util";
|
|
102213
102215
|
import { parseKicadSexpr as parseKicadSexpr2, KicadSch as KicadSch2 } from "kicadts";
|
|
@@ -102215,7 +102217,7 @@ import { KicadSymbolLib } from "kicadts";
|
|
|
102215
102217
|
import { parseKicadMod } from "kicadts";
|
|
102216
102218
|
import {
|
|
102217
102219
|
parseKicadSexpr as parseKicadSexpr3,
|
|
102218
|
-
Footprint as
|
|
102220
|
+
Footprint as Footprint5,
|
|
102219
102221
|
Property as Property3,
|
|
102220
102222
|
TextEffects as TextEffects12,
|
|
102221
102223
|
TextEffectsFont as TextEffectsFont12
|
|
@@ -104844,7 +104846,7 @@ var AddFootprintsStage = class extends ConverterStage {
|
|
|
104844
104846
|
const pcbPlatedHoles = this.ctx.db.pcb_plated_hole?.list().filter((hole) => hole.pcb_component_id === component.pcb_component_id) || [];
|
|
104845
104847
|
const { pads: thruHolePads } = convertPlatedHoles(pcbPlatedHoles, component.center, component.rotation || 0, component.pcb_component_id, nextPadNumber, getNetInfo);
|
|
104846
104848
|
fpPads.push(...thruHolePads);
|
|
104847
|
-
const pcbHoles = this.ctx.db.pcb_hole?.list().filter((hole) => hole.
|
|
104849
|
+
const pcbHoles = this.ctx.db.pcb_hole?.list().filter((hole) => hole.pcb_component_id === component.pcb_component_id) || [];
|
|
104848
104850
|
const npthPads = convertNpthHoles(pcbHoles, component.center, component.rotation || 0);
|
|
104849
104851
|
fpPads.push(...npthPads);
|
|
104850
104852
|
footprint.fpPads = fpPads;
|
|
@@ -105116,6 +105118,52 @@ var AddViasStage = class extends ConverterStage {
|
|
|
105116
105118
|
return this.ctx.kicadPcb;
|
|
105117
105119
|
}
|
|
105118
105120
|
};
|
|
105121
|
+
var AddStandalonePcbElements = class extends ConverterStage {
|
|
105122
|
+
holesProcessed = 0;
|
|
105123
|
+
standaloneHoles = [];
|
|
105124
|
+
constructor(input, ctx) {
|
|
105125
|
+
super(input, ctx);
|
|
105126
|
+
this.standaloneHoles = this.ctx.db.pcb_hole.list().filter((hole) => !hole.pcb_component_id);
|
|
105127
|
+
}
|
|
105128
|
+
_step() {
|
|
105129
|
+
const { kicadPcb, c2kMatPcb } = this.ctx;
|
|
105130
|
+
if (!kicadPcb) {
|
|
105131
|
+
throw new Error("KicadPcb instance not initialized in context");
|
|
105132
|
+
}
|
|
105133
|
+
if (!c2kMatPcb) {
|
|
105134
|
+
throw new Error("PCB transformation matrix not initialized in context");
|
|
105135
|
+
}
|
|
105136
|
+
if (this.holesProcessed >= this.standaloneHoles.length) {
|
|
105137
|
+
this.finished = true;
|
|
105138
|
+
return;
|
|
105139
|
+
}
|
|
105140
|
+
const hole = this.standaloneHoles[this.holesProcessed];
|
|
105141
|
+
if (!hole) {
|
|
105142
|
+
this.holesProcessed++;
|
|
105143
|
+
return;
|
|
105144
|
+
}
|
|
105145
|
+
const boardOrigin = applyToPoint16(c2kMatPcb, { x: 0, y: 0 });
|
|
105146
|
+
const footprintSeed = `standalone_hole:${hole.pcb_hole_id}:${hole.x},${hole.y}`;
|
|
105147
|
+
const footprint = new Footprint4({
|
|
105148
|
+
libraryLink: "tscircuit:MountingHole",
|
|
105149
|
+
layer: "F.Cu",
|
|
105150
|
+
at: [boardOrigin.x, boardOrigin.y, 0],
|
|
105151
|
+
uuid: generateDeterministicUuid(footprintSeed)
|
|
105152
|
+
});
|
|
105153
|
+
const ccwRotationDegrees = 0;
|
|
105154
|
+
const npthPads = convertNpthHoles([hole], { x: 0, y: 0 }, ccwRotationDegrees);
|
|
105155
|
+
if (npthPads.length > 0) {
|
|
105156
|
+
footprint.fpPads = npthPads;
|
|
105157
|
+
const footprints = kicadPcb.footprints;
|
|
105158
|
+
footprints.push(footprint);
|
|
105159
|
+
kicadPcb.footprints = footprints;
|
|
105160
|
+
}
|
|
105161
|
+
this.holesProcessed++;
|
|
105162
|
+
}
|
|
105163
|
+
getOutput() {
|
|
105164
|
+
return this.ctx.kicadPcb;
|
|
105165
|
+
}
|
|
105166
|
+
};
|
|
105119
105167
|
function createFabricationNoteTextFromCircuitJson({
|
|
105120
105168
|
textElement,
|
|
105121
105169
|
c2kMatPcb
|
|
@@ -105123,7 +105171,7 @@ function createFabricationNoteTextFromCircuitJson({
|
|
|
105123
105171
|
if (!textElement.text || !textElement.anchor_position) {
|
|
105124
105172
|
return null;
|
|
105125
105173
|
}
|
|
105126
|
-
const transformedPos =
|
|
105174
|
+
const transformedPos = applyToPoint17(c2kMatPcb, {
|
|
105127
105175
|
x: textElement.anchor_position.x,
|
|
105128
105176
|
y: textElement.anchor_position.y
|
|
105129
105177
|
});
|
|
@@ -105179,7 +105227,7 @@ function createGrTextFromCircuitJson({
|
|
|
105179
105227
|
if (!textElement.text || !textElement.anchor_position) {
|
|
105180
105228
|
return null;
|
|
105181
105229
|
}
|
|
105182
|
-
const transformedPos =
|
|
105230
|
+
const transformedPos = applyToPoint18(c2kMatPcb, {
|
|
105183
105231
|
x: textElement.anchor_position.x,
|
|
105184
105232
|
y: textElement.anchor_position.y
|
|
105185
105233
|
});
|
|
@@ -105247,11 +105295,11 @@ var AddGraphicsStage = class extends ConverterStage {
|
|
|
105247
105295
|
const endPoint = path16.route[i + 1];
|
|
105248
105296
|
if (!startPoint || !endPoint)
|
|
105249
105297
|
continue;
|
|
105250
|
-
const transformedStart =
|
|
105298
|
+
const transformedStart = applyToPoint19(c2kMatPcb, {
|
|
105251
105299
|
x: startPoint.x,
|
|
105252
105300
|
y: startPoint.y
|
|
105253
105301
|
});
|
|
105254
|
-
const transformedEnd =
|
|
105302
|
+
const transformedEnd = applyToPoint19(c2kMatPcb, {
|
|
105255
105303
|
x: endPoint.x,
|
|
105256
105304
|
y: endPoint.y
|
|
105257
105305
|
});
|
|
@@ -105315,7 +105363,7 @@ var AddGraphicsStage = class extends ConverterStage {
|
|
|
105315
105363
|
{ x: board.center.x - halfWidth, y: board.center.y + halfHeight }
|
|
105316
105364
|
];
|
|
105317
105365
|
}
|
|
105318
|
-
const transformedCorners = corners.map((corner) =>
|
|
105366
|
+
const transformedCorners = corners.map((corner) => applyToPoint19(c2kMatPcb, corner));
|
|
105319
105367
|
for (let i = 0;i < transformedCorners.length; i++) {
|
|
105320
105368
|
const start = transformedCorners[i];
|
|
105321
105369
|
const end = transformedCorners[(i + 1) % transformedCorners.length];
|
|
@@ -105369,6 +105417,7 @@ var CircuitJsonToKicadPcbConverter = class {
|
|
|
105369
105417
|
}),
|
|
105370
105418
|
new AddTracesStage(circuitJson, this.ctx),
|
|
105371
105419
|
new AddViasStage(circuitJson, this.ctx),
|
|
105420
|
+
new AddStandalonePcbElements(circuitJson, this.ctx),
|
|
105372
105421
|
new AddGraphicsStage(circuitJson, this.ctx)
|
|
105373
105422
|
];
|
|
105374
105423
|
}
|
|
@@ -105772,7 +105821,7 @@ function createTextEffects3(metadataEffects) {
|
|
|
105772
105821
|
function applyKicadFootprintMetadata(kicadModString, metadata, footprintName) {
|
|
105773
105822
|
try {
|
|
105774
105823
|
const parsed = parseKicadSexpr3(kicadModString);
|
|
105775
|
-
const footprint = parsed.find((node) => node instanceof
|
|
105824
|
+
const footprint = parsed.find((node) => node instanceof Footprint5);
|
|
105776
105825
|
if (!footprint) {
|
|
105777
105826
|
return kicadModString;
|
|
105778
105827
|
}
|
|
@@ -197576,7 +197625,7 @@ function rectanglePolygon({
|
|
|
197576
197625
|
if (rotationDeg) {
|
|
197577
197626
|
const matrix2 = rotateDEG(rotationDeg, cx2, cy2);
|
|
197578
197627
|
const rotatedCorners = corners.map((pt3) => {
|
|
197579
|
-
const p3 =
|
|
197628
|
+
const p3 = applyToPoint20(matrix2, { x: pt3.x, y: pt3.y });
|
|
197580
197629
|
return new Point$3(p3.x, p3.y);
|
|
197581
197630
|
});
|
|
197582
197631
|
poly = new Polygon$1(rotatedCorners);
|
|
@@ -197641,7 +197690,7 @@ function computeOverlapDistance(compPoly, boardPoly, componentCenter, componentW
|
|
|
197641
197690
|
}
|
|
197642
197691
|
const matrix2 = rotateDEG(rotationDeg, componentCenter.x, componentCenter.y);
|
|
197643
197692
|
const rotatePoint3 = (pt3) => {
|
|
197644
|
-
const p3 =
|
|
197693
|
+
const p3 = applyToPoint20(matrix2, pt3);
|
|
197645
197694
|
return new Point$3(p3.x, p3.y);
|
|
197646
197695
|
};
|
|
197647
197696
|
const rotatedPoints = corners.concat(midpoints).map(rotatePoint3);
|
|
@@ -215948,7 +215997,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
215948
215997
|
return null;
|
|
215949
215998
|
for (const position2 of placementConfigPositions) {
|
|
215950
215999
|
if (isMatchingSelector(component, position2.selector) || component.props.name === position2.selector) {
|
|
215951
|
-
const center2 =
|
|
216000
|
+
const center2 = applyToPoint20(this._computePcbGlobalTransformBeforeLayout(), position2.center);
|
|
215952
216001
|
return center2;
|
|
215953
216002
|
}
|
|
215954
216003
|
}
|
|
@@ -215965,7 +216014,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
215965
216014
|
return null;
|
|
215966
216015
|
for (const position2 of placementConfigPositions) {
|
|
215967
216016
|
if (isMatchingSelector(component, position2.selector) || component.props.name === position2.selector) {
|
|
215968
|
-
const center2 =
|
|
216017
|
+
const center2 = applyToPoint20(this.computeSchematicGlobalTransform(), position2.center);
|
|
215969
216018
|
return center2;
|
|
215970
216019
|
}
|
|
215971
216020
|
}
|
|
@@ -215985,13 +216034,13 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
215985
216034
|
return null;
|
|
215986
216035
|
}
|
|
215987
216036
|
_getGlobalPcbPositionBeforeLayout() {
|
|
215988
|
-
return
|
|
216037
|
+
return applyToPoint20(this._computePcbGlobalTransformBeforeLayout(), {
|
|
215989
216038
|
x: 0,
|
|
215990
216039
|
y: 0
|
|
215991
216040
|
});
|
|
215992
216041
|
}
|
|
215993
216042
|
_getGlobalSchematicPositionBeforeLayout() {
|
|
215994
|
-
return
|
|
216043
|
+
return applyToPoint20(this.computeSchematicGlobalTransform(), { x: 0, y: 0 });
|
|
215995
216044
|
}
|
|
215996
216045
|
_getBoard() {
|
|
215997
216046
|
let current2 = this;
|
|
@@ -218468,7 +218517,7 @@ function Trace_doInitialPcbManualTraceRender(trace) {
|
|
|
218468
218517
|
viaToLayer = pt3.toLayer;
|
|
218469
218518
|
}
|
|
218470
218519
|
}
|
|
218471
|
-
const finalCoordinates = isGlobalPosition ? coordinates :
|
|
218520
|
+
const finalCoordinates = isGlobalPosition ? coordinates : applyToPoint20(transform2, coordinates);
|
|
218472
218521
|
if (isViaPoint) {
|
|
218473
218522
|
route.push({
|
|
218474
218523
|
route_type: "via",
|
|
@@ -219303,7 +219352,7 @@ var CourtyardOutline = class extends PrimitiveComponent2 {
|
|
|
219303
219352
|
pcb_component_id,
|
|
219304
219353
|
layer,
|
|
219305
219354
|
outline: props.outline.map((p3) => {
|
|
219306
|
-
const transformedPosition =
|
|
219355
|
+
const transformedPosition = applyToPoint20(transform2, {
|
|
219307
219356
|
x: p3.x,
|
|
219308
219357
|
y: p3.y
|
|
219309
219358
|
});
|
|
@@ -219480,7 +219529,7 @@ var Cutout = class extends PrimitiveComponent2 {
|
|
|
219480
219529
|
inserted_pcb_cutout = db.pcb_cutout.insert(circleData);
|
|
219481
219530
|
} else if (props.shape === "polygon") {
|
|
219482
219531
|
const transform2 = this._computePcbGlobalTransformBeforeLayout();
|
|
219483
|
-
const transformedPoints = props.points.map((p3) =>
|
|
219532
|
+
const transformedPoints = props.points.map((p3) => applyToPoint20(transform2, p3));
|
|
219484
219533
|
const polygonData = {
|
|
219485
219534
|
shape: "polygon",
|
|
219486
219535
|
points: transformedPoints,
|
|
@@ -219641,7 +219690,7 @@ var FabricationNotePath = class extends PrimitiveComponent2 {
|
|
|
219641
219690
|
layer,
|
|
219642
219691
|
color: props.color,
|
|
219643
219692
|
route: props.route.map((p3) => {
|
|
219644
|
-
const transformedPosition =
|
|
219693
|
+
const transformedPosition = applyToPoint20(transform2, {
|
|
219645
219694
|
x: p3.x,
|
|
219646
219695
|
y: p3.y
|
|
219647
219696
|
});
|
|
@@ -220134,8 +220183,8 @@ var PcbNoteLine = class extends PrimitiveComponent2 {
|
|
|
220134
220183
|
const subcircuit = this.getSubcircuit();
|
|
220135
220184
|
const group = this.getGroup();
|
|
220136
220185
|
const transform2 = this._computePcbGlobalTransformBeforeLayout();
|
|
220137
|
-
const start =
|
|
220138
|
-
const end =
|
|
220186
|
+
const start = applyToPoint20(transform2, { x: props.x1, y: props.y1 });
|
|
220187
|
+
const end = applyToPoint20(transform2, { x: props.x2, y: props.y2 });
|
|
220139
220188
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id ?? undefined;
|
|
220140
220189
|
const pcb_note_line2 = db.pcb_note_line.insert({
|
|
220141
220190
|
pcb_component_id,
|
|
@@ -220200,7 +220249,7 @@ var PcbNotePath = class extends PrimitiveComponent2 {
|
|
|
220200
220249
|
const { x: x3, y: y32, ...rest } = point6;
|
|
220201
220250
|
const numericX = typeof x3 === "string" ? parseFloat(x3) : x3;
|
|
220202
220251
|
const numericY = typeof y32 === "string" ? parseFloat(y32) : y32;
|
|
220203
|
-
const transformed =
|
|
220252
|
+
const transformed = applyToPoint20(transform2, { x: numericX, y: numericY });
|
|
220204
220253
|
return { ...rest, x: transformed.x, y: transformed.y };
|
|
220205
220254
|
});
|
|
220206
220255
|
const pcb_note_path2 = db.pcb_note_path.insert({
|
|
@@ -220261,7 +220310,7 @@ var PcbNoteRect = class extends PrimitiveComponent2 {
|
|
|
220261
220310
|
const { db } = this.root;
|
|
220262
220311
|
const { _parsedProps: props } = this;
|
|
220263
220312
|
const transform2 = this._computePcbGlobalTransformBeforeLayout();
|
|
220264
|
-
const center2 =
|
|
220313
|
+
const center2 = applyToPoint20(transform2, { x: 0, y: 0 });
|
|
220265
220314
|
const subcircuit = this.getSubcircuit();
|
|
220266
220315
|
const group = this.getGroup();
|
|
220267
220316
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id ?? undefined;
|
|
@@ -220322,7 +220371,7 @@ var PcbNoteText = class extends PrimitiveComponent2 {
|
|
|
220322
220371
|
const { db } = this.root;
|
|
220323
220372
|
const { _parsedProps: props } = this;
|
|
220324
220373
|
const transform2 = this._computePcbGlobalTransformBeforeLayout();
|
|
220325
|
-
const anchorPosition =
|
|
220374
|
+
const anchorPosition = applyToPoint20(transform2, { x: 0, y: 0 });
|
|
220326
220375
|
const subcircuit = this.getSubcircuit();
|
|
220327
220376
|
const group = this.getGroup();
|
|
220328
220377
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id ?? undefined;
|
|
@@ -220391,7 +220440,7 @@ var PcbTrace = class extends PrimitiveComponent2 {
|
|
|
220391
220440
|
const parentTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
220392
220441
|
const transformedRoute = props.route.map((point6) => {
|
|
220393
220442
|
const { x: x3, y: y32, ...restOfPoint } = point6;
|
|
220394
|
-
const transformedPoint =
|
|
220443
|
+
const transformedPoint = applyToPoint20(parentTransform, { x: x3, y: y32 });
|
|
220395
220444
|
if (point6.route_type === "wire" && point6.layer) {
|
|
220396
220445
|
return {
|
|
220397
220446
|
...transformedPoint,
|
|
@@ -220818,8 +220867,8 @@ var SilkscreenLine = class extends PrimitiveComponent2 {
|
|
|
220818
220867
|
}
|
|
220819
220868
|
const subcircuit = this.getSubcircuit();
|
|
220820
220869
|
const transform2 = this._computePcbGlobalTransformBeforeLayout();
|
|
220821
|
-
const p12 =
|
|
220822
|
-
const p222 =
|
|
220870
|
+
const p12 = applyToPoint20(transform2, { x: props.x1, y: props.y1 });
|
|
220871
|
+
const p222 = applyToPoint20(transform2, { x: props.x2, y: props.y2 });
|
|
220823
220872
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
|
|
220824
220873
|
const pcb_silkscreen_line2 = db.pcb_silkscreen_line.insert({
|
|
220825
220874
|
pcb_component_id,
|
|
@@ -220886,7 +220935,7 @@ var SilkscreenPath = class extends PrimitiveComponent2 {
|
|
|
220886
220935
|
pcb_component_id,
|
|
220887
220936
|
layer,
|
|
220888
220937
|
route: props.route.map((p3) => {
|
|
220889
|
-
const transformedPosition =
|
|
220938
|
+
const transformedPosition = applyToPoint20(transform2, {
|
|
220890
220939
|
x: p3.x,
|
|
220891
220940
|
y: p3.y
|
|
220892
220941
|
});
|
|
@@ -221096,7 +221145,7 @@ var SilkscreenText = class extends PrimitiveComponent2 {
|
|
|
221096
221145
|
});
|
|
221097
221146
|
const fontSize = props.fontSize ?? resolvedPcbSxFontSize ?? this.getInheritedProperty("pcbStyle")?.silkscreenFontSize ?? this._footprinterFontSize ?? 1;
|
|
221098
221147
|
const hasResolvedPcbSxPosition = resolvedPcbSxPcbX !== undefined || resolvedPcbSxPcbY !== undefined;
|
|
221099
|
-
const position2 = hasResolvedPcbSxPosition && this._footprinterFontSize !== undefined ?
|
|
221148
|
+
const position2 = hasResolvedPcbSxPosition && this._footprinterFontSize !== undefined ? applyToPoint20(compose5(this.parent?._computePcbGlobalTransformBeforeLayout() ?? identity5(), isFlipped ? flipY() : identity5()), {
|
|
221100
221149
|
x: this.resolvePcbCoordinate({
|
|
221101
221150
|
rawValue: resolvedPcbSxPcbX ?? props.pcbX ?? 0,
|
|
221102
221151
|
axis: "pcbX"
|
|
@@ -221382,7 +221431,7 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
221382
221431
|
});
|
|
221383
221432
|
} else if (props.shape === "polygon") {
|
|
221384
221433
|
const transformedPoints = props.points.map((point6) => {
|
|
221385
|
-
const transformed =
|
|
221434
|
+
const transformed = applyToPoint20(globalTransform, {
|
|
221386
221435
|
x: distance.parse(point6.x),
|
|
221387
221436
|
y: distance.parse(point6.y)
|
|
221388
221437
|
});
|
|
@@ -222229,7 +222278,7 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
222229
222278
|
}
|
|
222230
222279
|
}
|
|
222231
222280
|
const transform2 = compose5(parentNormalComponent.computeSchematicGlobalTransform(), translate5(-symbol.center.x, -symbol.center.y));
|
|
222232
|
-
return
|
|
222281
|
+
return applyToPoint20(transform2, schematicSymbolPortDef);
|
|
222233
222282
|
}
|
|
222234
222283
|
const parentBoxDim = parentNormalComponent?._getSchematicBoxDimensions();
|
|
222235
222284
|
if (parentBoxDim && this.props.pinNumber !== undefined) {
|
|
@@ -222237,7 +222286,7 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
222237
222286
|
if (!localPortPosition) {
|
|
222238
222287
|
throw new Error(`Couldn't find position for schematic_port for port ${this.getString()} inside of the schematic box`);
|
|
222239
222288
|
}
|
|
222240
|
-
return
|
|
222289
|
+
return applyToPoint20(parentNormalComponent.computeSchematicGlobalTransform(), localPortPosition);
|
|
222241
222290
|
}
|
|
222242
222291
|
throw new Error(`Couldn't find position for schematic_port for port ${this.getString()}`);
|
|
222243
222292
|
}
|
|
@@ -222599,15 +222648,15 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
222599
222648
|
const { db } = this.root;
|
|
222600
222649
|
const schPort = db.schematic_port.get(this.schematic_port_id);
|
|
222601
222650
|
if (schPort) {
|
|
222602
|
-
const newCenter =
|
|
222651
|
+
const newCenter = applyToPoint20(transform2, schPort.center);
|
|
222603
222652
|
db.schematic_port.update(this.schematic_port_id, {
|
|
222604
222653
|
center: newCenter
|
|
222605
222654
|
});
|
|
222606
222655
|
if (this.schematic_stem_line_id) {
|
|
222607
222656
|
const line2 = db.schematic_line.get(this.schematic_stem_line_id);
|
|
222608
222657
|
if (line2) {
|
|
222609
|
-
const p12 =
|
|
222610
|
-
const p222 =
|
|
222658
|
+
const p12 = applyToPoint20(transform2, { x: line2.x1, y: line2.y1 });
|
|
222659
|
+
const p222 = applyToPoint20(transform2, { x: line2.x2, y: line2.y2 });
|
|
222611
222660
|
db.schematic_line.update(this.schematic_stem_line_id, {
|
|
222612
222661
|
x1: p12.x,
|
|
222613
222662
|
y1: p12.y,
|
|
@@ -226170,7 +226219,7 @@ var TraceHint = class extends PrimitiveComponent2 {
|
|
|
226170
226219
|
return [];
|
|
226171
226220
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
226172
226221
|
return offsets.map((offset) => ({
|
|
226173
|
-
...
|
|
226222
|
+
...applyToPoint20(globalTransform, offset),
|
|
226174
226223
|
via: offset.via,
|
|
226175
226224
|
to_layer: offset.to_layer,
|
|
226176
226225
|
trace_width: offset.trace_width
|
|
@@ -233614,13 +233663,13 @@ var FabricationNoteDimension = class extends PrimitiveComponent2 {
|
|
|
233614
233663
|
const target = this.getSubcircuit().selectOne(input);
|
|
233615
233664
|
if (!target) {
|
|
233616
233665
|
this.renderError(`FabricationNoteDimension could not find selector "${input}"`);
|
|
233617
|
-
return
|
|
233666
|
+
return applyToPoint20(transform2, { x: 0, y: 0 });
|
|
233618
233667
|
}
|
|
233619
233668
|
return target._getGlobalPcbPositionBeforeLayout();
|
|
233620
233669
|
}
|
|
233621
233670
|
const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
|
|
233622
233671
|
const numericY = typeof input.y === "string" ? parseFloat(input.y) : input.y;
|
|
233623
|
-
return
|
|
233672
|
+
return applyToPoint20(transform2, { x: numericX, y: numericY });
|
|
233624
233673
|
}
|
|
233625
233674
|
doInitialPcbPrimitiveRender() {
|
|
233626
233675
|
if (this.root?.pcbDisabled)
|
|
@@ -233720,7 +233769,7 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
233720
233769
|
const target = this.getSubcircuit().selectOne(`.${input}`);
|
|
233721
233770
|
if (!target) {
|
|
233722
233771
|
this.renderError(`PcbNoteDimension could not find selector "${input}"`);
|
|
233723
|
-
return
|
|
233772
|
+
return applyToPoint20(transform2, { x: 0, y: 0 });
|
|
233724
233773
|
}
|
|
233725
233774
|
const targetPcbComponentId = target.pcb_component_id;
|
|
233726
233775
|
const root = this.root;
|
|
@@ -233737,7 +233786,7 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
233737
233786
|
}
|
|
233738
233787
|
const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
|
|
233739
233788
|
const numericY = typeof input.y === "string" ? parseFloat(input.y) : input.y;
|
|
233740
|
-
return
|
|
233789
|
+
return applyToPoint20(transform2, { x: numericX, y: numericY });
|
|
233741
233790
|
}
|
|
233742
233791
|
doInitialPcbPrimitiveRender() {
|
|
233743
233792
|
if (this.root?.pcbDisabled)
|
|
@@ -234016,7 +234065,7 @@ var NetLabel = class extends PrimitiveComponent2 {
|
|
|
234016
234065
|
const connectedPorts = this._getConnectedPorts();
|
|
234017
234066
|
if (connectedPorts.length > 0) {
|
|
234018
234067
|
const portPos = connectedPorts[0]._getGlobalSchematicPositionBeforeLayout();
|
|
234019
|
-
const parentCenter =
|
|
234068
|
+
const parentCenter = applyToPoint20(this.parent?.computeSchematicGlobalTransform?.() ?? identity5(), { x: 0, y: 0 });
|
|
234020
234069
|
return translate5(portPos.x - parentCenter.x, portPos.y - parentCenter.y);
|
|
234021
234070
|
}
|
|
234022
234071
|
}
|
|
@@ -235289,7 +235338,7 @@ var SchematicText = class extends PrimitiveComponent2 {
|
|
|
235289
235338
|
const text = db.schematic_text.get(this.schematic_text_id);
|
|
235290
235339
|
if (!text)
|
|
235291
235340
|
return;
|
|
235292
|
-
const newPosition =
|
|
235341
|
+
const newPosition = applyToPoint20(transform2, text.position);
|
|
235293
235342
|
db.schematic_text.update(this.schematic_text_id, {
|
|
235294
235343
|
position: { x: newPosition.x, y: newPosition.y }
|
|
235295
235344
|
});
|
|
@@ -235339,8 +235388,8 @@ var SchematicLine = class extends PrimitiveComponent2 {
|
|
|
235339
235388
|
const line2 = db.schematic_line.get(this.schematic_line_id);
|
|
235340
235389
|
if (!line2)
|
|
235341
235390
|
return;
|
|
235342
|
-
const p12 =
|
|
235343
|
-
const p222 =
|
|
235391
|
+
const p12 = applyToPoint20(transform2, { x: line2.x1, y: line2.y1 });
|
|
235392
|
+
const p222 = applyToPoint20(transform2, { x: line2.x2, y: line2.y2 });
|
|
235344
235393
|
db.schematic_line.update(this.schematic_line_id, {
|
|
235345
235394
|
x1: p12.x,
|
|
235346
235395
|
y1: p12.y,
|
|
@@ -235397,11 +235446,11 @@ var SchematicRect = class extends PrimitiveComponent2 {
|
|
|
235397
235446
|
const rect = db.schematic_rect.get(this.schematic_rect_id);
|
|
235398
235447
|
if (!rect)
|
|
235399
235448
|
return;
|
|
235400
|
-
const topLeft =
|
|
235449
|
+
const topLeft = applyToPoint20(transform2, {
|
|
235401
235450
|
x: rect.center.x - rect.width / 2,
|
|
235402
235451
|
y: rect.center.y + rect.height / 2
|
|
235403
235452
|
});
|
|
235404
|
-
const bottomRight =
|
|
235453
|
+
const bottomRight = applyToPoint20(transform2, {
|
|
235405
235454
|
x: rect.center.x + rect.width / 2,
|
|
235406
235455
|
y: rect.center.y - rect.height / 2
|
|
235407
235456
|
});
|
|
@@ -235466,8 +235515,8 @@ var SchematicArc = class extends PrimitiveComponent2 {
|
|
|
235466
235515
|
const arc2 = db.schematic_arc.get(this.schematic_arc_id);
|
|
235467
235516
|
if (!arc2)
|
|
235468
235517
|
return;
|
|
235469
|
-
const newCenter =
|
|
235470
|
-
const edgePoint =
|
|
235518
|
+
const newCenter = applyToPoint20(transform2, arc2.center);
|
|
235519
|
+
const edgePoint = applyToPoint20(transform2, {
|
|
235471
235520
|
x: arc2.center.x + arc2.radius,
|
|
235472
235521
|
y: arc2.center.y
|
|
235473
235522
|
});
|
|
@@ -235525,8 +235574,8 @@ var SchematicCircle = class extends PrimitiveComponent2 {
|
|
|
235525
235574
|
const circle2 = db.schematic_circle.get(this.schematic_circle_id);
|
|
235526
235575
|
if (!circle2)
|
|
235527
235576
|
return;
|
|
235528
|
-
const newCenter =
|
|
235529
|
-
const edgePoint =
|
|
235577
|
+
const newCenter = applyToPoint20(transform2, circle2.center);
|
|
235578
|
+
const edgePoint = applyToPoint20(transform2, {
|
|
235530
235579
|
x: circle2.center.x + circle2.radius,
|
|
235531
235580
|
y: circle2.center.y
|
|
235532
235581
|
});
|
|
@@ -235731,7 +235780,7 @@ var SchematicPath = class extends PrimitiveComponent2 {
|
|
|
235731
235780
|
if (!path42)
|
|
235732
235781
|
continue;
|
|
235733
235782
|
const newPoints = path42.points.map((point6) => {
|
|
235734
|
-
const transformed =
|
|
235783
|
+
const transformed = applyToPoint20(transform2, point6);
|
|
235735
235784
|
return { x: transformed.x, y: transformed.y };
|
|
235736
235785
|
});
|
|
235737
235786
|
db.schematic_path.update(pathId, {
|
|
@@ -242157,11 +242206,11 @@ import {
|
|
|
242157
242206
|
|
|
242158
242207
|
// node_modules/dsn-converter/dist/index.js
|
|
242159
242208
|
import { su as su7 } from "@tscircuit/soup-util";
|
|
242160
|
-
import { applyToPoint as
|
|
242209
|
+
import { applyToPoint as applyToPoint22, scale as scale6 } from "transformation-matrix";
|
|
242161
242210
|
import { su as su23 } from "@tscircuit/soup-util";
|
|
242162
242211
|
import Debug4 from "debug";
|
|
242163
242212
|
import { su as su33 } from "@tscircuit/soup-util";
|
|
242164
|
-
import { applyToPoint as
|
|
242213
|
+
import { applyToPoint as applyToPoint23, scale as scale22 } from "transformation-matrix";
|
|
242165
242214
|
import { su as su42 } from "@tscircuit/soup-util";
|
|
242166
242215
|
import Debug22 from "debug";
|
|
242167
242216
|
import { scale as scale32, applyToPoint as applyToPoint92 } from "transformation-matrix";
|
|
@@ -242397,7 +242446,7 @@ function processComponentsAndPads(componentGroups, circuitElements, pcb) {
|
|
|
242397
242446
|
const sourceComponent = su7(circuitElements).source_component.list().find((e4) => e4.source_component_id === pcbComponent?.source_component_id);
|
|
242398
242447
|
const footprintName = getFootprintName(sourceComponent, pcbComponent);
|
|
242399
242448
|
const componentName = sourceComponent?.name || "Unknown";
|
|
242400
|
-
const circuitSpaceCoordinates =
|
|
242449
|
+
const circuitSpaceCoordinates = applyToPoint22(transformMmToUm, pcbComponent.center);
|
|
242401
242450
|
if (!componentsByFootprint.has(footprintName)) {
|
|
242402
242451
|
componentsByFootprint.set(footprintName, []);
|
|
242403
242452
|
}
|
|
@@ -242909,7 +242958,7 @@ function processPlatedHoles(componentGroups, circuitElements, pcb) {
|
|
|
242909
242958
|
componentsByFootprint.set(key, []);
|
|
242910
242959
|
componentsByFootprint.get(key).push({
|
|
242911
242960
|
componentName: sourceComponent?.name || "Unknown",
|
|
242912
|
-
coordinates:
|
|
242961
|
+
coordinates: applyToPoint23(transformMmToUm2, pcbComponent.center),
|
|
242913
242962
|
rotation: pcbComponent.rotation || 0,
|
|
242914
242963
|
value: getComponentValue(sourceComponent),
|
|
242915
242964
|
sourceComponent
|
|
@@ -250930,7 +250979,7 @@ var any_circuit_element2 = external_exports2.union([
|
|
|
250930
250979
|
var any_soup_element2 = any_circuit_element2;
|
|
250931
250980
|
expectTypesMatch3(true);
|
|
250932
250981
|
expectStringUnionsMatch2(true);
|
|
250933
|
-
function
|
|
250982
|
+
function applyToPoint24(matrix2, point22) {
|
|
250934
250983
|
return Array.isArray(point22) ? [
|
|
250935
250984
|
matrix2.a * point22[0] + matrix2.c * point22[1] + matrix2.e,
|
|
250936
250985
|
matrix2.b * point22[0] + matrix2.d * point22[1] + matrix2.f
|
|
@@ -251894,7 +251943,7 @@ var transformPCBElement2 = (elm, matrix2) => {
|
|
|
251894
251943
|
const tsr = decomposeTSR2(matrix2);
|
|
251895
251944
|
const flipPadWidthHeight = Math.round(tsr.rotation.angle / (Math.PI / 2)) % 2 === 1;
|
|
251896
251945
|
if (elm.type === "pcb_plated_hole" || elm.type === "pcb_hole" || elm.type === "pcb_via" || elm.type === "pcb_smtpad" || elm.type === "pcb_port") {
|
|
251897
|
-
const { x: x3, y: y4 } =
|
|
251946
|
+
const { x: x3, y: y4 } = applyToPoint24(matrix2, {
|
|
251898
251947
|
x: Number(elm.x),
|
|
251899
251948
|
y: Number(elm.y)
|
|
251900
251949
|
});
|
|
@@ -251902,7 +251951,7 @@ var transformPCBElement2 = (elm, matrix2) => {
|
|
|
251902
251951
|
elm.y = y4;
|
|
251903
251952
|
if (elm.type === "pcb_smtpad" && elm.shape === "polygon" && Array.isArray(elm.points)) {
|
|
251904
251953
|
elm.points = elm.points.map((point22) => {
|
|
251905
|
-
const tp3 =
|
|
251954
|
+
const tp3 = applyToPoint24(matrix2, { x: point22.x, y: point22.y });
|
|
251906
251955
|
return {
|
|
251907
251956
|
x: tp3.x,
|
|
251908
251957
|
y: tp3.y
|
|
@@ -251910,13 +251959,13 @@ var transformPCBElement2 = (elm, matrix2) => {
|
|
|
251910
251959
|
});
|
|
251911
251960
|
}
|
|
251912
251961
|
} else if (elm.type === "pcb_keepout" || elm.type === "pcb_board") {
|
|
251913
|
-
elm.center =
|
|
251962
|
+
elm.center = applyToPoint24(matrix2, elm.center);
|
|
251914
251963
|
} else if (elm.type === "pcb_silkscreen_text" || elm.type === "pcb_fabrication_note_text" || elm.type === "pcb_note_text") {
|
|
251915
|
-
elm.anchor_position =
|
|
251964
|
+
elm.anchor_position = applyToPoint24(matrix2, elm.anchor_position);
|
|
251916
251965
|
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect" || elm.type === "pcb_courtyard_rect" || elm.type === "pcb_courtyard_circle") {
|
|
251917
|
-
elm.center =
|
|
251966
|
+
elm.center = applyToPoint24(matrix2, elm.center);
|
|
251918
251967
|
} else if (elm.type === "pcb_component") {
|
|
251919
|
-
elm.center =
|
|
251968
|
+
elm.center = applyToPoint24(matrix2, elm.center);
|
|
251920
251969
|
elm.rotation = elm.rotation + tsr.rotation.angle / Math.PI * 180;
|
|
251921
251970
|
elm.rotation = elm.rotation % 360;
|
|
251922
251971
|
if (flipPadWidthHeight) {
|
|
@@ -251924,21 +251973,21 @@ var transformPCBElement2 = (elm, matrix2) => {
|
|
|
251924
251973
|
}
|
|
251925
251974
|
} else if (elm.type === "pcb_courtyard_outline") {
|
|
251926
251975
|
elm.outline = elm.outline.map((p3) => {
|
|
251927
|
-
const tp3 =
|
|
251976
|
+
const tp3 = applyToPoint24(matrix2, p3);
|
|
251928
251977
|
p3.x = tp3.x;
|
|
251929
251978
|
p3.y = tp3.y;
|
|
251930
251979
|
return p3;
|
|
251931
251980
|
});
|
|
251932
251981
|
} else if (elm.type === "pcb_courtyard_polygon") {
|
|
251933
251982
|
elm.points = elm.points.map((p3) => {
|
|
251934
|
-
const tp3 =
|
|
251983
|
+
const tp3 = applyToPoint24(matrix2, p3);
|
|
251935
251984
|
p3.x = tp3.x;
|
|
251936
251985
|
p3.y = tp3.y;
|
|
251937
251986
|
return p3;
|
|
251938
251987
|
});
|
|
251939
251988
|
} else if (elm.type === "pcb_silkscreen_path" || elm.type === "pcb_trace" || elm.type === "pcb_fabrication_note_path" || elm.type === "pcb_note_path") {
|
|
251940
251989
|
elm.route = elm.route.map((rp3) => {
|
|
251941
|
-
const tp3 =
|
|
251990
|
+
const tp3 = applyToPoint24(matrix2, rp3);
|
|
251942
251991
|
rp3.x = tp3.x;
|
|
251943
251992
|
rp3.y = tp3.y;
|
|
251944
251993
|
return rp3;
|
|
@@ -251946,14 +251995,14 @@ var transformPCBElement2 = (elm, matrix2) => {
|
|
|
251946
251995
|
} else if (elm.type === "pcb_silkscreen_line" || elm.type === "pcb_note_line") {
|
|
251947
251996
|
const p12 = { x: elm.x1, y: elm.y1 };
|
|
251948
251997
|
const p23 = { x: elm.x2, y: elm.y2 };
|
|
251949
|
-
const p1t =
|
|
251950
|
-
const p2t =
|
|
251998
|
+
const p1t = applyToPoint24(matrix2, p12);
|
|
251999
|
+
const p2t = applyToPoint24(matrix2, p23);
|
|
251951
252000
|
elm.x1 = p1t.x;
|
|
251952
252001
|
elm.y1 = p1t.y;
|
|
251953
252002
|
elm.x2 = p2t.x;
|
|
251954
252003
|
elm.y2 = p2t.y;
|
|
251955
252004
|
} else if (elm.type === "cad_component") {
|
|
251956
|
-
const newPos =
|
|
252005
|
+
const newPos = applyToPoint24(matrix2, {
|
|
251957
252006
|
x: elm.position.x,
|
|
251958
252007
|
y: elm.position.y
|
|
251959
252008
|
});
|
|
@@ -252708,15 +252757,15 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, { useModelCdn, shouldRecente
|
|
|
252708
252757
|
for (const e4 of circuitElements) {
|
|
252709
252758
|
if (e4.type === "pcb_cutout") {
|
|
252710
252759
|
if (e4.shape === "polygon") {
|
|
252711
|
-
e4.points = e4.points.map((p3) =>
|
|
252760
|
+
e4.points = e4.points.map((p3) => applyToPoint24(matrix2, p3));
|
|
252712
252761
|
} else if (e4.shape === "circle" || e4.shape === "rect") {
|
|
252713
|
-
e4.center =
|
|
252762
|
+
e4.center = applyToPoint24(matrix2, e4.center);
|
|
252714
252763
|
} else if ("route" in e4) {
|
|
252715
252764
|
const cutoutPath = e4;
|
|
252716
|
-
cutoutPath.route = cutoutPath.route.map((p3) =>
|
|
252765
|
+
cutoutPath.route = cutoutPath.route.map((p3) => applyToPoint24(matrix2, p3));
|
|
252717
252766
|
}
|
|
252718
252767
|
} else if (e4.type === "pcb_smtpad" && e4.shape === "polygon") {
|
|
252719
|
-
e4.points = e4.points.map((p3) =>
|
|
252768
|
+
e4.points = e4.points.map((p3) => applyToPoint24(matrix2, p3));
|
|
252720
252769
|
}
|
|
252721
252770
|
}
|
|
252722
252771
|
const cad = circuitElements.find((e4) => e4.type === "cad_component");
|
|
@@ -257359,7 +257408,7 @@ var any_circuit_element3 = z160.union([
|
|
|
257359
257408
|
var any_soup_element3 = any_circuit_element3;
|
|
257360
257409
|
expectTypesMatch4(true);
|
|
257361
257410
|
expectStringUnionsMatch3(true);
|
|
257362
|
-
function
|
|
257411
|
+
function applyToPoint26(matrix2, point22) {
|
|
257363
257412
|
return Array.isArray(point22) ? [
|
|
257364
257413
|
matrix2.a * point22[0] + matrix2.c * point22[1] + matrix2.e,
|
|
257365
257414
|
matrix2.b * point22[0] + matrix2.d * point22[1] + matrix2.f
|
|
@@ -258322,7 +258371,7 @@ var transformPCBElement3 = (elm, matrix2) => {
|
|
|
258322
258371
|
const tsr = decomposeTSR3(matrix2);
|
|
258323
258372
|
const flipPadWidthHeight = Math.round(tsr.rotation.angle / (Math.PI / 2)) % 2 === 1;
|
|
258324
258373
|
if (elm.type === "pcb_plated_hole" || elm.type === "pcb_hole" || elm.type === "pcb_via" || elm.type === "pcb_smtpad" || elm.type === "pcb_port") {
|
|
258325
|
-
const { x: x3, y: y4 } =
|
|
258374
|
+
const { x: x3, y: y4 } = applyToPoint26(matrix2, {
|
|
258326
258375
|
x: Number(elm.x),
|
|
258327
258376
|
y: Number(elm.y)
|
|
258328
258377
|
});
|
|
@@ -258330,7 +258379,7 @@ var transformPCBElement3 = (elm, matrix2) => {
|
|
|
258330
258379
|
elm.y = y4;
|
|
258331
258380
|
if (elm.type === "pcb_smtpad" && elm.shape === "polygon" && Array.isArray(elm.points)) {
|
|
258332
258381
|
elm.points = elm.points.map((point22) => {
|
|
258333
|
-
const tp3 =
|
|
258382
|
+
const tp3 = applyToPoint26(matrix2, { x: point22.x, y: point22.y });
|
|
258334
258383
|
return {
|
|
258335
258384
|
x: tp3.x,
|
|
258336
258385
|
y: tp3.y
|
|
@@ -258338,13 +258387,13 @@ var transformPCBElement3 = (elm, matrix2) => {
|
|
|
258338
258387
|
});
|
|
258339
258388
|
}
|
|
258340
258389
|
} else if (elm.type === "pcb_keepout" || elm.type === "pcb_board") {
|
|
258341
|
-
elm.center =
|
|
258390
|
+
elm.center = applyToPoint26(matrix2, elm.center);
|
|
258342
258391
|
} else if (elm.type === "pcb_silkscreen_text" || elm.type === "pcb_fabrication_note_text" || elm.type === "pcb_note_text") {
|
|
258343
|
-
elm.anchor_position =
|
|
258392
|
+
elm.anchor_position = applyToPoint26(matrix2, elm.anchor_position);
|
|
258344
258393
|
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect" || elm.type === "pcb_courtyard_rect" || elm.type === "pcb_courtyard_circle") {
|
|
258345
|
-
elm.center =
|
|
258394
|
+
elm.center = applyToPoint26(matrix2, elm.center);
|
|
258346
258395
|
} else if (elm.type === "pcb_component") {
|
|
258347
|
-
elm.center =
|
|
258396
|
+
elm.center = applyToPoint26(matrix2, elm.center);
|
|
258348
258397
|
elm.rotation = elm.rotation + tsr.rotation.angle / Math.PI * 180;
|
|
258349
258398
|
elm.rotation = elm.rotation % 360;
|
|
258350
258399
|
if (flipPadWidthHeight) {
|
|
@@ -258352,21 +258401,21 @@ var transformPCBElement3 = (elm, matrix2) => {
|
|
|
258352
258401
|
}
|
|
258353
258402
|
} else if (elm.type === "pcb_courtyard_outline") {
|
|
258354
258403
|
elm.outline = elm.outline.map((p3) => {
|
|
258355
|
-
const tp3 =
|
|
258404
|
+
const tp3 = applyToPoint26(matrix2, p3);
|
|
258356
258405
|
p3.x = tp3.x;
|
|
258357
258406
|
p3.y = tp3.y;
|
|
258358
258407
|
return p3;
|
|
258359
258408
|
});
|
|
258360
258409
|
} else if (elm.type === "pcb_courtyard_polygon") {
|
|
258361
258410
|
elm.points = elm.points.map((p3) => {
|
|
258362
|
-
const tp3 =
|
|
258411
|
+
const tp3 = applyToPoint26(matrix2, p3);
|
|
258363
258412
|
p3.x = tp3.x;
|
|
258364
258413
|
p3.y = tp3.y;
|
|
258365
258414
|
return p3;
|
|
258366
258415
|
});
|
|
258367
258416
|
} else if (elm.type === "pcb_silkscreen_path" || elm.type === "pcb_trace" || elm.type === "pcb_fabrication_note_path" || elm.type === "pcb_note_path") {
|
|
258368
258417
|
elm.route = elm.route.map((rp3) => {
|
|
258369
|
-
const tp3 =
|
|
258418
|
+
const tp3 = applyToPoint26(matrix2, rp3);
|
|
258370
258419
|
rp3.x = tp3.x;
|
|
258371
258420
|
rp3.y = tp3.y;
|
|
258372
258421
|
return rp3;
|
|
@@ -258374,14 +258423,14 @@ var transformPCBElement3 = (elm, matrix2) => {
|
|
|
258374
258423
|
} else if (elm.type === "pcb_silkscreen_line" || elm.type === "pcb_note_line") {
|
|
258375
258424
|
const p12 = { x: elm.x1, y: elm.y1 };
|
|
258376
258425
|
const p23 = { x: elm.x2, y: elm.y2 };
|
|
258377
|
-
const p1t =
|
|
258378
|
-
const p2t =
|
|
258426
|
+
const p1t = applyToPoint26(matrix2, p12);
|
|
258427
|
+
const p2t = applyToPoint26(matrix2, p23);
|
|
258379
258428
|
elm.x1 = p1t.x;
|
|
258380
258429
|
elm.y1 = p1t.y;
|
|
258381
258430
|
elm.x2 = p2t.x;
|
|
258382
258431
|
elm.y2 = p2t.y;
|
|
258383
258432
|
} else if (elm.type === "cad_component") {
|
|
258384
|
-
const newPos =
|
|
258433
|
+
const newPos = applyToPoint26(matrix2, {
|
|
258385
258434
|
x: elm.position.x,
|
|
258386
258435
|
y: elm.position.y
|
|
258387
258436
|
});
|
|
@@ -259133,15 +259182,15 @@ var convertEasyEdaJsonToCircuitJson2 = (easyEdaJson, { useModelCdn, shouldRecent
|
|
|
259133
259182
|
for (const e4 of circuitElements) {
|
|
259134
259183
|
if (e4.type === "pcb_cutout") {
|
|
259135
259184
|
if (e4.shape === "polygon") {
|
|
259136
|
-
e4.points = e4.points.map((p3) =>
|
|
259185
|
+
e4.points = e4.points.map((p3) => applyToPoint26(matrix2, p3));
|
|
259137
259186
|
} else if (e4.shape === "circle" || e4.shape === "rect") {
|
|
259138
|
-
e4.center =
|
|
259187
|
+
e4.center = applyToPoint26(matrix2, e4.center);
|
|
259139
259188
|
} else if ("route" in e4) {
|
|
259140
259189
|
const cutoutPath = e4;
|
|
259141
|
-
cutoutPath.route = cutoutPath.route.map((p3) =>
|
|
259190
|
+
cutoutPath.route = cutoutPath.route.map((p3) => applyToPoint26(matrix2, p3));
|
|
259142
259191
|
}
|
|
259143
259192
|
} else if (e4.type === "pcb_smtpad" && e4.shape === "polygon") {
|
|
259144
|
-
e4.points = e4.points.map((p3) =>
|
|
259193
|
+
e4.points = e4.points.map((p3) => applyToPoint26(matrix2, p3));
|
|
259145
259194
|
}
|
|
259146
259195
|
}
|
|
259147
259196
|
const cad = circuitElements.find((e4) => e4.type === "cad_component");
|