@tscircuit/core 0.0.778 → 0.0.779
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 +63 -13
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2611,16 +2611,45 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
2611
2611
|
const { _parsedProps: props } = this;
|
|
2612
2612
|
const subcircuit = this.getSubcircuit();
|
|
2613
2613
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2614
|
+
if (props.shape === "pill") {
|
|
2615
|
+
if (props.pcbRotation && props.pcbRotation !== 0) {
|
|
2616
|
+
const inserted_hole = db.pcb_hole.insert({
|
|
2617
|
+
type: "pcb_hole",
|
|
2618
|
+
hole_shape: "rotated_pill",
|
|
2619
|
+
hole_width: props.width,
|
|
2620
|
+
hole_height: props.height,
|
|
2621
|
+
x: position.x,
|
|
2622
|
+
y: position.y,
|
|
2623
|
+
ccw_rotation: props.pcbRotation,
|
|
2624
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
2625
|
+
pcb_group_id: subcircuit?.getGroup()?.pcb_group_id ?? void 0
|
|
2626
|
+
});
|
|
2627
|
+
this.pcb_hole_id = inserted_hole.pcb_hole_id;
|
|
2628
|
+
} else {
|
|
2629
|
+
const inserted_hole = db.pcb_hole.insert({
|
|
2630
|
+
type: "pcb_hole",
|
|
2631
|
+
hole_shape: "pill",
|
|
2632
|
+
hole_width: props.width,
|
|
2633
|
+
hole_height: props.height,
|
|
2634
|
+
x: position.x,
|
|
2635
|
+
y: position.y,
|
|
2636
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
2637
|
+
pcb_group_id: subcircuit?.getGroup()?.pcb_group_id ?? void 0
|
|
2638
|
+
});
|
|
2639
|
+
this.pcb_hole_id = inserted_hole.pcb_hole_id;
|
|
2640
|
+
}
|
|
2641
|
+
} else {
|
|
2642
|
+
const inserted_hole = db.pcb_hole.insert({
|
|
2643
|
+
hole_shape: "circle",
|
|
2644
|
+
// @ts-ignore
|
|
2645
|
+
hole_diameter: props.diameter,
|
|
2646
|
+
x: position.x,
|
|
2647
|
+
y: position.y,
|
|
2648
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
2649
|
+
pcb_group_id: subcircuit?.getGroup()?.pcb_group_id ?? void 0
|
|
2650
|
+
});
|
|
2651
|
+
this.pcb_hole_id = inserted_hole.pcb_hole_id;
|
|
2652
|
+
}
|
|
2624
2653
|
}
|
|
2625
2654
|
_getPcbCircuitJsonBounds() {
|
|
2626
2655
|
const { db } = this.root;
|
|
@@ -3028,6 +3057,27 @@ var createComponentsFromCircuitJson = ({
|
|
|
3028
3057
|
diameter: elm.hole_diameter
|
|
3029
3058
|
})
|
|
3030
3059
|
);
|
|
3060
|
+
} else if (elm.type === "pcb_hole" && elm.hole_shape === "pill") {
|
|
3061
|
+
components.push(
|
|
3062
|
+
new Hole({
|
|
3063
|
+
pcbX: elm.x,
|
|
3064
|
+
pcbY: elm.y,
|
|
3065
|
+
shape: "pill",
|
|
3066
|
+
width: elm.hole_width,
|
|
3067
|
+
height: elm.hole_height
|
|
3068
|
+
})
|
|
3069
|
+
);
|
|
3070
|
+
} else if (elm.type === "pcb_hole" && elm.hole_shape === "rotated_pill") {
|
|
3071
|
+
components.push(
|
|
3072
|
+
new Hole({
|
|
3073
|
+
pcbX: elm.x,
|
|
3074
|
+
pcbY: elm.y,
|
|
3075
|
+
shape: "pill",
|
|
3076
|
+
width: elm.hole_width,
|
|
3077
|
+
height: elm.hole_height,
|
|
3078
|
+
pcbRotation: elm.ccw_rotation
|
|
3079
|
+
})
|
|
3080
|
+
);
|
|
3031
3081
|
} else if (elm.type === "pcb_cutout") {
|
|
3032
3082
|
if (elm.shape === "rect") {
|
|
3033
3083
|
components.push(
|
|
@@ -16218,7 +16268,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
16218
16268
|
var package_default = {
|
|
16219
16269
|
name: "@tscircuit/core",
|
|
16220
16270
|
type: "module",
|
|
16221
|
-
version: "0.0.
|
|
16271
|
+
version: "0.0.778",
|
|
16222
16272
|
types: "dist/index.d.ts",
|
|
16223
16273
|
main: "dist/index.js",
|
|
16224
16274
|
module: "dist/index.js",
|
|
@@ -16271,13 +16321,13 @@ var package_default = {
|
|
|
16271
16321
|
"bun-match-svg": "0.0.12",
|
|
16272
16322
|
"calculate-elbow": "^0.0.12",
|
|
16273
16323
|
"chokidar-cli": "^3.0.0",
|
|
16274
|
-
"circuit-json": "^0.0.
|
|
16324
|
+
"circuit-json": "^0.0.277",
|
|
16275
16325
|
"circuit-json-to-bpc": "^0.0.13",
|
|
16276
16326
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
16277
16327
|
"circuit-json-to-gltf": "^0.0.7",
|
|
16278
16328
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
16279
16329
|
"circuit-json-to-spice": "^0.0.13",
|
|
16280
|
-
"circuit-to-svg": "^0.0.
|
|
16330
|
+
"circuit-to-svg": "^0.0.235",
|
|
16281
16331
|
concurrently: "^9.1.2",
|
|
16282
16332
|
"connectivity-map": "^1.0.0",
|
|
16283
16333
|
debug: "^4.3.6",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.779",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"bun-match-svg": "0.0.12",
|
|
55
55
|
"calculate-elbow": "^0.0.12",
|
|
56
56
|
"chokidar-cli": "^3.0.0",
|
|
57
|
-
"circuit-json": "^0.0.
|
|
57
|
+
"circuit-json": "^0.0.277",
|
|
58
58
|
"circuit-json-to-bpc": "^0.0.13",
|
|
59
59
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
60
60
|
"circuit-json-to-gltf": "^0.0.7",
|
|
61
61
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
62
62
|
"circuit-json-to-spice": "^0.0.13",
|
|
63
|
-
"circuit-to-svg": "^0.0.
|
|
63
|
+
"circuit-to-svg": "^0.0.235",
|
|
64
64
|
"concurrently": "^9.1.2",
|
|
65
65
|
"connectivity-map": "^1.0.0",
|
|
66
66
|
"debug": "^4.3.6",
|