@tscircuit/core 0.0.1111 → 0.0.1112
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 +24 -18
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5458,6 +5458,7 @@ var CourtyardOutline = class extends PrimitiveComponent2 {
|
|
|
5458
5458
|
};
|
|
5459
5459
|
|
|
5460
5460
|
// lib/components/primitive-components/CourtyardRect.ts
|
|
5461
|
+
import { decomposeTSR } from "transformation-matrix";
|
|
5461
5462
|
import { courtyardRectProps } from "@tscircuit/props";
|
|
5462
5463
|
var CourtyardRect = class extends PrimitiveComponent2 {
|
|
5463
5464
|
pcb_courtyard_rect_id = null;
|
|
@@ -5482,6 +5483,10 @@ var CourtyardRect = class extends PrimitiveComponent2 {
|
|
|
5482
5483
|
}
|
|
5483
5484
|
const subcircuit = this.getSubcircuit();
|
|
5484
5485
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
|
|
5486
|
+
const decomposedTransform = decomposeTSR(
|
|
5487
|
+
this._computePcbGlobalTransformBeforeLayout()
|
|
5488
|
+
);
|
|
5489
|
+
const ccw_rotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
5485
5490
|
const pcb_courtyard_rect = db.pcb_courtyard_rect.insert({
|
|
5486
5491
|
pcb_component_id,
|
|
5487
5492
|
layer,
|
|
@@ -5491,6 +5496,7 @@ var CourtyardRect = class extends PrimitiveComponent2 {
|
|
|
5491
5496
|
},
|
|
5492
5497
|
width: props.width,
|
|
5493
5498
|
height: props.height,
|
|
5499
|
+
ccw_rotation: ccw_rotation || void 0,
|
|
5494
5500
|
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
5495
5501
|
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
5496
5502
|
});
|
|
@@ -6148,7 +6154,7 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
6148
6154
|
|
|
6149
6155
|
// lib/components/primitive-components/Keepout.ts
|
|
6150
6156
|
import { pcbKeepoutProps } from "@tscircuit/props";
|
|
6151
|
-
import { decomposeTSR } from "transformation-matrix";
|
|
6157
|
+
import { decomposeTSR as decomposeTSR2 } from "transformation-matrix";
|
|
6152
6158
|
var Keepout = class extends PrimitiveComponent2 {
|
|
6153
6159
|
pcb_keepout_id = null;
|
|
6154
6160
|
isPcbPrimitive = true;
|
|
@@ -6164,7 +6170,7 @@ var Keepout = class extends PrimitiveComponent2 {
|
|
|
6164
6170
|
const { db } = this.root;
|
|
6165
6171
|
const { _parsedProps: props } = this;
|
|
6166
6172
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
6167
|
-
const decomposedMat =
|
|
6173
|
+
const decomposedMat = decomposeTSR2(
|
|
6168
6174
|
this._computePcbGlobalTransformBeforeLayout()
|
|
6169
6175
|
);
|
|
6170
6176
|
const isRotated90 = Math.abs(decomposedMat.rotation.angle * (180 / Math.PI) - 90) % 180 < 0.01;
|
|
@@ -6548,7 +6554,7 @@ var PcbTrace = class extends PrimitiveComponent2 {
|
|
|
6548
6554
|
// lib/components/primitive-components/PlatedHole.ts
|
|
6549
6555
|
import { platedHoleProps } from "@tscircuit/props";
|
|
6550
6556
|
import "circuit-json";
|
|
6551
|
-
import { decomposeTSR as
|
|
6557
|
+
import { decomposeTSR as decomposeTSR3 } from "transformation-matrix";
|
|
6552
6558
|
var PlatedHole = class extends PrimitiveComponent2 {
|
|
6553
6559
|
pcb_plated_hole_id = null;
|
|
6554
6560
|
matchedPort = null;
|
|
@@ -6647,7 +6653,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
|
|
|
6647
6653
|
const soldermaskMargin = props.solderMaskMargin;
|
|
6648
6654
|
const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
|
|
6649
6655
|
this.emitSolderMaskMarginWarning(isCoveredWithSolderMask, soldermaskMargin);
|
|
6650
|
-
const decomposedTransform =
|
|
6656
|
+
const decomposedTransform = decomposeTSR3(
|
|
6651
6657
|
this._computePcbGlobalTransformBeforeLayout()
|
|
6652
6658
|
);
|
|
6653
6659
|
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
@@ -7101,7 +7107,7 @@ var SilkscreenPath = class extends PrimitiveComponent2 {
|
|
|
7101
7107
|
|
|
7102
7108
|
// lib/components/primitive-components/SilkscreenRect.ts
|
|
7103
7109
|
import { silkscreenRectProps } from "@tscircuit/props";
|
|
7104
|
-
import { decomposeTSR as
|
|
7110
|
+
import { decomposeTSR as decomposeTSR4 } from "transformation-matrix";
|
|
7105
7111
|
var SilkscreenRect = class extends PrimitiveComponent2 {
|
|
7106
7112
|
pcb_silkscreen_rect_id = null;
|
|
7107
7113
|
isPcbPrimitive = true;
|
|
@@ -7117,7 +7123,7 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
|
|
|
7117
7123
|
*/
|
|
7118
7124
|
_isRotated90Degrees() {
|
|
7119
7125
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
7120
|
-
const decomposedTransform =
|
|
7126
|
+
const decomposedTransform = decomposeTSR4(globalTransform);
|
|
7121
7127
|
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
7122
7128
|
const normalizedRotationDegrees = (rotationDegrees % 360 + 360) % 360;
|
|
7123
7129
|
const rotationTolerance = 0.01;
|
|
@@ -7189,7 +7195,7 @@ import { silkscreenTextProps } from "@tscircuit/props";
|
|
|
7189
7195
|
import {
|
|
7190
7196
|
applyToPoint as applyToPoint14,
|
|
7191
7197
|
compose as compose3,
|
|
7192
|
-
decomposeTSR as
|
|
7198
|
+
decomposeTSR as decomposeTSR5,
|
|
7193
7199
|
flipY as flipY2,
|
|
7194
7200
|
identity as identity4
|
|
7195
7201
|
} from "transformation-matrix";
|
|
@@ -7215,7 +7221,7 @@ var SilkscreenText = class extends PrimitiveComponent2 {
|
|
|
7215
7221
|
rotation4 = props.pcbRotation;
|
|
7216
7222
|
} else {
|
|
7217
7223
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
7218
|
-
const decomposedTransform =
|
|
7224
|
+
const decomposedTransform = decomposeTSR5(globalTransform);
|
|
7219
7225
|
rotation4 = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
7220
7226
|
}
|
|
7221
7227
|
if (isFlipped) {
|
|
@@ -7330,7 +7336,7 @@ import { smtPadProps } from "@tscircuit/props";
|
|
|
7330
7336
|
import {
|
|
7331
7337
|
distance as distance5
|
|
7332
7338
|
} from "circuit-json";
|
|
7333
|
-
import { applyToPoint as applyToPoint15, decomposeTSR as
|
|
7339
|
+
import { applyToPoint as applyToPoint15, decomposeTSR as decomposeTSR6 } from "transformation-matrix";
|
|
7334
7340
|
var SmtPad = class extends PrimitiveComponent2 {
|
|
7335
7341
|
pcb_smtpad_id = null;
|
|
7336
7342
|
matchedPort = null;
|
|
@@ -7401,7 +7407,7 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
7401
7407
|
const subcircuit = this.getSubcircuit();
|
|
7402
7408
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
7403
7409
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
7404
|
-
const decomposedTransform =
|
|
7410
|
+
const decomposedTransform = decomposeTSR6(
|
|
7405
7411
|
this._computePcbGlobalTransformBeforeLayout()
|
|
7406
7412
|
);
|
|
7407
7413
|
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
@@ -9315,7 +9321,7 @@ import {
|
|
|
9315
9321
|
isValidElement
|
|
9316
9322
|
} from "react";
|
|
9317
9323
|
import { symbols as symbols2 } from "schematic-symbols";
|
|
9318
|
-
import { decomposeTSR as
|
|
9324
|
+
import { decomposeTSR as decomposeTSR8 } from "transformation-matrix";
|
|
9319
9325
|
import { z as z9 } from "zod";
|
|
9320
9326
|
|
|
9321
9327
|
// lib/components/primitive-components/CadAssembly.ts
|
|
@@ -9334,7 +9340,7 @@ var CadAssembly = class extends PrimitiveComponent2 {
|
|
|
9334
9340
|
import { cadmodelProps, point3 } from "@tscircuit/props";
|
|
9335
9341
|
import { z as z8 } from "zod";
|
|
9336
9342
|
import { distance as distance6 } from "circuit-json";
|
|
9337
|
-
import { decomposeTSR as
|
|
9343
|
+
import { decomposeTSR as decomposeTSR7 } from "transformation-matrix";
|
|
9338
9344
|
|
|
9339
9345
|
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
9340
9346
|
var getFileExtension = (filename) => {
|
|
@@ -9395,7 +9401,7 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
9395
9401
|
if (!props || typeof props.modelUrl !== "string" && typeof props.stepUrl !== "string")
|
|
9396
9402
|
return;
|
|
9397
9403
|
const parentTransform = parent._computePcbGlobalTransformBeforeLayout();
|
|
9398
|
-
const decomposedTransform =
|
|
9404
|
+
const decomposedTransform = decomposeTSR7(parentTransform);
|
|
9399
9405
|
const accumulatedRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
9400
9406
|
const rotationOffset = rotation3.parse({ x: 0, y: 0, z: 0 });
|
|
9401
9407
|
if (typeof props.rotationOffset === "number") {
|
|
@@ -10802,7 +10808,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
10802
10808
|
db.pcb_component_invalid_layer_error.insert(error);
|
|
10803
10809
|
}
|
|
10804
10810
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
10805
|
-
const decomposedTransform =
|
|
10811
|
+
const decomposedTransform = decomposeTSR8(globalTransform);
|
|
10806
10812
|
const accumulatedRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
10807
10813
|
const pcb_component = db.pcb_component.insert({
|
|
10808
10814
|
center: this._getGlobalPcbPositionBeforeLayout(),
|
|
@@ -11289,7 +11295,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
11289
11295
|
) : 0 : 0;
|
|
11290
11296
|
const computedLayer = this.props.layer === "bottom" ? "bottom" : "top";
|
|
11291
11297
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
11292
|
-
const decomposedTransform =
|
|
11298
|
+
const decomposedTransform = decomposeTSR8(globalTransform);
|
|
11293
11299
|
const totalRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
11294
11300
|
const isBottomLayer = computedLayer === "bottom";
|
|
11295
11301
|
const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0);
|
|
@@ -18642,7 +18648,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
18642
18648
|
var package_default = {
|
|
18643
18649
|
name: "@tscircuit/core",
|
|
18644
18650
|
type: "module",
|
|
18645
|
-
version: "0.0.
|
|
18651
|
+
version: "0.0.1111",
|
|
18646
18652
|
types: "dist/index.d.ts",
|
|
18647
18653
|
main: "dist/index.js",
|
|
18648
18654
|
module: "dist/index.js",
|
|
@@ -18701,13 +18707,13 @@ var package_default = {
|
|
|
18701
18707
|
"bun-match-svg": "0.0.12",
|
|
18702
18708
|
"calculate-elbow": "^0.0.12",
|
|
18703
18709
|
"chokidar-cli": "^3.0.0",
|
|
18704
|
-
"circuit-json": "^0.0.
|
|
18710
|
+
"circuit-json": "^0.0.403",
|
|
18705
18711
|
"circuit-json-to-bpc": "^0.0.13",
|
|
18706
18712
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
18707
18713
|
"circuit-json-to-gltf": "^0.0.73",
|
|
18708
18714
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
18709
18715
|
"circuit-json-to-spice": "^0.0.34",
|
|
18710
|
-
"circuit-to-svg": "^0.0.
|
|
18716
|
+
"circuit-to-svg": "^0.0.337",
|
|
18711
18717
|
concurrently: "^9.1.2",
|
|
18712
18718
|
"connectivity-map": "^1.0.0",
|
|
18713
18719
|
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.1112",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"bun-match-svg": "0.0.12",
|
|
61
61
|
"calculate-elbow": "^0.0.12",
|
|
62
62
|
"chokidar-cli": "^3.0.0",
|
|
63
|
-
"circuit-json": "^0.0.
|
|
63
|
+
"circuit-json": "^0.0.403",
|
|
64
64
|
"circuit-json-to-bpc": "^0.0.13",
|
|
65
65
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
66
66
|
"circuit-json-to-gltf": "^0.0.73",
|
|
67
67
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
68
68
|
"circuit-json-to-spice": "^0.0.34",
|
|
69
|
-
"circuit-to-svg": "^0.0.
|
|
69
|
+
"circuit-to-svg": "^0.0.337",
|
|
70
70
|
"concurrently": "^9.1.2",
|
|
71
71
|
"connectivity-map": "^1.0.0",
|
|
72
72
|
"debug": "^4.3.6",
|