@tscircuit/pcb-viewer 1.11.261 → 1.11.262
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +84 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7573,6 +7573,88 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7573
7573
|
ccw_rotation: hole_ccw_rotation
|
|
7574
7574
|
}
|
|
7575
7575
|
];
|
|
7576
|
+
} else if (element.shape === "hole_with_polygon_pad") {
|
|
7577
|
+
const {
|
|
7578
|
+
x,
|
|
7579
|
+
y,
|
|
7580
|
+
pad_outline,
|
|
7581
|
+
hole_shape,
|
|
7582
|
+
hole_diameter,
|
|
7583
|
+
hole_width,
|
|
7584
|
+
hole_height,
|
|
7585
|
+
layers
|
|
7586
|
+
} = element;
|
|
7587
|
+
const hole_offset_x = distance2.parse(
|
|
7588
|
+
element.hole_offset_x ?? 0
|
|
7589
|
+
);
|
|
7590
|
+
const hole_offset_y = distance2.parse(
|
|
7591
|
+
element.hole_offset_y ?? 0
|
|
7592
|
+
);
|
|
7593
|
+
const pcb_outline = pad_outline;
|
|
7594
|
+
const padPrimitives = [];
|
|
7595
|
+
if (pcb_outline && Array.isArray(pcb_outline)) {
|
|
7596
|
+
const translatedPoints = normalizePolygonPoints(pcb_outline).map(
|
|
7597
|
+
(p) => ({ x: p.x + x, y: p.y + y })
|
|
7598
|
+
);
|
|
7599
|
+
for (const layer of layers || ["top", "bottom"]) {
|
|
7600
|
+
padPrimitives.push({
|
|
7601
|
+
_pcb_drawing_object_id: `polygon_${globalPcbDrawingObjectCount++}`,
|
|
7602
|
+
pcb_drawing_type: "polygon",
|
|
7603
|
+
points: translatedPoints,
|
|
7604
|
+
layer,
|
|
7605
|
+
_element: element,
|
|
7606
|
+
_parent_pcb_component,
|
|
7607
|
+
_parent_source_component,
|
|
7608
|
+
_source_port
|
|
7609
|
+
});
|
|
7610
|
+
}
|
|
7611
|
+
}
|
|
7612
|
+
const holeCenter = {
|
|
7613
|
+
x: x + hole_offset_x,
|
|
7614
|
+
y: y + hole_offset_y
|
|
7615
|
+
};
|
|
7616
|
+
const holePrimitives = [];
|
|
7617
|
+
if (hole_shape === "circle") {
|
|
7618
|
+
holePrimitives.push({
|
|
7619
|
+
_pcb_drawing_object_id: `circle_${globalPcbDrawingObjectCount++}`,
|
|
7620
|
+
pcb_drawing_type: "circle",
|
|
7621
|
+
x: holeCenter.x,
|
|
7622
|
+
y: holeCenter.y,
|
|
7623
|
+
r: (hole_diameter ?? 0) / 2,
|
|
7624
|
+
layer: "drill",
|
|
7625
|
+
_element: element,
|
|
7626
|
+
_parent_pcb_component,
|
|
7627
|
+
_parent_source_component
|
|
7628
|
+
});
|
|
7629
|
+
} else if (hole_shape === "oval") {
|
|
7630
|
+
holePrimitives.push({
|
|
7631
|
+
_pcb_drawing_object_id: `oval_${globalPcbDrawingObjectCount++}`,
|
|
7632
|
+
pcb_drawing_type: "oval",
|
|
7633
|
+
x: holeCenter.x,
|
|
7634
|
+
y: holeCenter.y,
|
|
7635
|
+
rX: (hole_width ?? 0) / 2,
|
|
7636
|
+
rY: (hole_height ?? 0) / 2,
|
|
7637
|
+
layer: "drill",
|
|
7638
|
+
_element: element,
|
|
7639
|
+
_parent_pcb_component,
|
|
7640
|
+
_parent_source_component
|
|
7641
|
+
});
|
|
7642
|
+
} else if (hole_shape === "pill" || hole_shape === "rotated_pill") {
|
|
7643
|
+
holePrimitives.push({
|
|
7644
|
+
_pcb_drawing_object_id: `pill_${globalPcbDrawingObjectCount++}`,
|
|
7645
|
+
pcb_drawing_type: "pill",
|
|
7646
|
+
x: holeCenter.x,
|
|
7647
|
+
y: holeCenter.y,
|
|
7648
|
+
w: hole_width ?? 0,
|
|
7649
|
+
h: hole_height ?? 0,
|
|
7650
|
+
layer: "drill",
|
|
7651
|
+
_element: element,
|
|
7652
|
+
_parent_pcb_component,
|
|
7653
|
+
_parent_source_component,
|
|
7654
|
+
ccw_rotation: element.ccw_rotation
|
|
7655
|
+
});
|
|
7656
|
+
}
|
|
7657
|
+
return [...padPrimitives, ...holePrimitives];
|
|
7576
7658
|
} else {
|
|
7577
7659
|
return [];
|
|
7578
7660
|
}
|
|
@@ -12737,7 +12819,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
12737
12819
|
// package.json
|
|
12738
12820
|
var package_default = {
|
|
12739
12821
|
name: "@tscircuit/pcb-viewer",
|
|
12740
|
-
version: "1.11.
|
|
12822
|
+
version: "1.11.261",
|
|
12741
12823
|
main: "dist/index.js",
|
|
12742
12824
|
type: "module",
|
|
12743
12825
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -12790,7 +12872,7 @@ var package_default = {
|
|
|
12790
12872
|
"@tscircuit/alphabet": "^0.0.3",
|
|
12791
12873
|
"@vitejs/plugin-react": "^5.0.2",
|
|
12792
12874
|
"circuit-json": "^0.0.307",
|
|
12793
|
-
"circuit-to-svg": "^0.0.
|
|
12875
|
+
"circuit-to-svg": "^0.0.271",
|
|
12794
12876
|
color: "^4.2.3",
|
|
12795
12877
|
"react-supergrid": "^1.0.10",
|
|
12796
12878
|
"react-toastify": "^10.0.5",
|