@tscircuit/core 0.0.2166 → 0.0.2168
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 +98 -71
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10434,7 +10434,30 @@ var CourtyardRect = class extends PrimitiveComponent2 {
|
|
|
10434
10434
|
};
|
|
10435
10435
|
|
|
10436
10436
|
// lib/components/primitive-components/Cutout.ts
|
|
10437
|
-
import { applyToPoint as applyToPoint8 } from "transformation-matrix";
|
|
10437
|
+
import { applyToPoint as applyToPoint8, decomposeTSR as decomposeTSR2 } from "transformation-matrix";
|
|
10438
|
+
|
|
10439
|
+
// lib/utils/pcb/get-axis-aligned-size-from-rotated-rect.ts
|
|
10440
|
+
function getAxisAlignedSizeFromRotatedRect({
|
|
10441
|
+
width,
|
|
10442
|
+
height,
|
|
10443
|
+
ccwRotationDegrees
|
|
10444
|
+
}) {
|
|
10445
|
+
const angleRad = ccwRotationDegrees * Math.PI / 180;
|
|
10446
|
+
const cosAngle = Math.cos(angleRad);
|
|
10447
|
+
const sinAngle = Math.sin(angleRad);
|
|
10448
|
+
const w2 = width / 2;
|
|
10449
|
+
const h2 = height / 2;
|
|
10450
|
+
const xExtent = Math.abs(w2 * cosAngle) + Math.abs(h2 * sinAngle);
|
|
10451
|
+
const yExtent = Math.abs(w2 * sinAngle) + Math.abs(h2 * cosAngle);
|
|
10452
|
+
return {
|
|
10453
|
+
width: xExtent * 2,
|
|
10454
|
+
height: yExtent * 2,
|
|
10455
|
+
xExtent,
|
|
10456
|
+
yExtent
|
|
10457
|
+
};
|
|
10458
|
+
}
|
|
10459
|
+
|
|
10460
|
+
// lib/components/primitive-components/Cutout.ts
|
|
10438
10461
|
import { cutoutProps } from "@tscircuit/props";
|
|
10439
10462
|
var Cutout = class extends PrimitiveComponent2 {
|
|
10440
10463
|
pcb_cutout_id = null;
|
|
@@ -10454,16 +10477,17 @@ var Cutout = class extends PrimitiveComponent2 {
|
|
|
10454
10477
|
const globalPosition = this._getGlobalPcbPositionBeforeLayout();
|
|
10455
10478
|
const container = this.getPrimitiveContainer();
|
|
10456
10479
|
const pcb_component_id = this.parent?.pcb_component_id ?? container?.pcb_component_id ?? void 0;
|
|
10457
|
-
const parentRotation = container?._parsedProps.pcbRotation ?? 0;
|
|
10458
10480
|
let inserted_pcb_cutout = void 0;
|
|
10459
10481
|
if (props.shape === "rect") {
|
|
10460
|
-
const
|
|
10461
|
-
const
|
|
10482
|
+
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
10483
|
+
const isReflected = globalTransform.a * globalTransform.d - globalTransform.b * globalTransform.c < 0;
|
|
10484
|
+
const { rotation: rotation5 } = decomposeTSR2(globalTransform, false, isReflected);
|
|
10462
10485
|
const rectData = {
|
|
10463
10486
|
shape: "rect",
|
|
10464
10487
|
center: globalPosition,
|
|
10465
|
-
width:
|
|
10466
|
-
height:
|
|
10488
|
+
width: props.width,
|
|
10489
|
+
height: props.height,
|
|
10490
|
+
rotation: rotation5.angle * 180 / Math.PI,
|
|
10467
10491
|
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
10468
10492
|
pcb_group_id,
|
|
10469
10493
|
pcb_component_id
|
|
@@ -10524,17 +10548,21 @@ var Cutout = class extends PrimitiveComponent2 {
|
|
|
10524
10548
|
const cutout = db2.pcb_cutout.get(this.pcb_cutout_id);
|
|
10525
10549
|
if (!cutout) return super._getPcbCircuitJsonBounds();
|
|
10526
10550
|
if (cutout.shape === "rect") {
|
|
10551
|
+
const { width, height, xExtent, yExtent } = getAxisAlignedSizeFromRotatedRect({
|
|
10552
|
+
width: cutout.width,
|
|
10553
|
+
height: cutout.height,
|
|
10554
|
+
ccwRotationDegrees: cutout.rotation ?? 0
|
|
10555
|
+
});
|
|
10527
10556
|
return {
|
|
10528
10557
|
center: cutout.center,
|
|
10529
10558
|
bounds: {
|
|
10530
|
-
left: cutout.center.x -
|
|
10531
|
-
top: cutout.center.y +
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
bottom: cutout.center.y - cutout.height / 2
|
|
10559
|
+
left: cutout.center.x - xExtent,
|
|
10560
|
+
top: cutout.center.y + yExtent,
|
|
10561
|
+
right: cutout.center.x + xExtent,
|
|
10562
|
+
bottom: cutout.center.y - yExtent
|
|
10535
10563
|
},
|
|
10536
|
-
width
|
|
10537
|
-
height
|
|
10564
|
+
width,
|
|
10565
|
+
height
|
|
10538
10566
|
};
|
|
10539
10567
|
} else if (cutout.shape === "circle") {
|
|
10540
10568
|
return {
|
|
@@ -10845,7 +10873,7 @@ function resolvePcbProperty({
|
|
|
10845
10873
|
}
|
|
10846
10874
|
|
|
10847
10875
|
// lib/components/primitive-components/FabricationNoteText.ts
|
|
10848
|
-
import { decomposeTSR as
|
|
10876
|
+
import { decomposeTSR as decomposeTSR3 } from "transformation-matrix";
|
|
10849
10877
|
var FabricationNoteText = class extends PrimitiveComponent2 {
|
|
10850
10878
|
pcb_fabrication_note_text_id = null;
|
|
10851
10879
|
isPcbPrimitive = true;
|
|
@@ -10860,7 +10888,7 @@ var FabricationNoteText = class extends PrimitiveComponent2 {
|
|
|
10860
10888
|
const { db: db2 } = this.root;
|
|
10861
10889
|
const { _parsedProps: props } = this;
|
|
10862
10890
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
10863
|
-
const decomposedTransform =
|
|
10891
|
+
const decomposedTransform = decomposeTSR3(
|
|
10864
10892
|
this._computePcbGlobalTransformBeforeLayout()
|
|
10865
10893
|
);
|
|
10866
10894
|
const ccwRotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
@@ -11094,7 +11122,7 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
11094
11122
|
|
|
11095
11123
|
// lib/components/primitive-components/Keepout.ts
|
|
11096
11124
|
import { pcbKeepoutProps } from "@tscircuit/props";
|
|
11097
|
-
import { decomposeTSR as
|
|
11125
|
+
import { decomposeTSR as decomposeTSR4 } from "transformation-matrix";
|
|
11098
11126
|
var Keepout = class extends PrimitiveComponent2 {
|
|
11099
11127
|
pcb_keepout_id = null;
|
|
11100
11128
|
isPcbPrimitive = true;
|
|
@@ -11119,7 +11147,7 @@ var Keepout = class extends PrimitiveComponent2 {
|
|
|
11119
11147
|
const pcbKeepoutOwnershipProps = pcbComponentId ? { pcb_component_id: pcbComponentId } : {};
|
|
11120
11148
|
const pcbGroupId = this.getGroup()?.pcb_group_id ?? void 0;
|
|
11121
11149
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
11122
|
-
const decomposedMat =
|
|
11150
|
+
const decomposedMat = decomposeTSR4(
|
|
11123
11151
|
this._computePcbGlobalTransformBeforeLayout()
|
|
11124
11152
|
);
|
|
11125
11153
|
const isRotated90 = Math.abs(decomposedMat.rotation.angle * (180 / Math.PI) - 90) % 180 < 0.01;
|
|
@@ -11450,7 +11478,7 @@ var PcbNoteText = class extends PrimitiveComponent2 {
|
|
|
11450
11478
|
// lib/components/primitive-components/PcbSoldermaskOpening.ts
|
|
11451
11479
|
import { pcbSoldermaskOpeningProps } from "@tscircuit/props";
|
|
11452
11480
|
import { getBoundsFromPoints as getBoundsFromPoints2 } from "@tscircuit/math-utils";
|
|
11453
|
-
import { applyToPoint as applyToPoint15, decomposeTSR as
|
|
11481
|
+
import { applyToPoint as applyToPoint15, decomposeTSR as decomposeTSR5 } from "transformation-matrix";
|
|
11454
11482
|
var PcbSoldermaskOpening = class extends PrimitiveComponent2 {
|
|
11455
11483
|
pcb_soldermask_opening_id = null;
|
|
11456
11484
|
isPcbPrimitive = true;
|
|
@@ -11501,7 +11529,7 @@ var PcbSoldermaskOpening = class extends PrimitiveComponent2 {
|
|
|
11501
11529
|
subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0
|
|
11502
11530
|
};
|
|
11503
11531
|
const center = applyToPoint15(transform, { x: 0, y: 0 });
|
|
11504
|
-
const rotation5 =
|
|
11532
|
+
const rotation5 = decomposeTSR5(transform, false, isFlipped).rotation.angle * 180 / Math.PI;
|
|
11505
11533
|
const geometry = props.shape === "polygon" ? {
|
|
11506
11534
|
shape: "polygon",
|
|
11507
11535
|
points: props.points.map((point6) => applyToPoint15(transform, point6))
|
|
@@ -11797,7 +11825,7 @@ var PcbVia = class extends PrimitiveComponent2 {
|
|
|
11797
11825
|
// lib/components/primitive-components/PlatedHole.ts
|
|
11798
11826
|
import { platedHoleProps } from "@tscircuit/props";
|
|
11799
11827
|
import "circuit-json";
|
|
11800
|
-
import { decomposeTSR as
|
|
11828
|
+
import { decomposeTSR as decomposeTSR6 } from "transformation-matrix";
|
|
11801
11829
|
|
|
11802
11830
|
// lib/components/primitive-components/Port/selectPortForPcbPrimitive.ts
|
|
11803
11831
|
var getPinNumberFromHints = (hints) => {
|
|
@@ -11937,7 +11965,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
|
|
|
11937
11965
|
const soldermaskMargin = props.solderMaskMargin;
|
|
11938
11966
|
const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
|
|
11939
11967
|
this.emitSolderMaskMarginWarning(isCoveredWithSolderMask, soldermaskMargin);
|
|
11940
|
-
const decomposedTransform =
|
|
11968
|
+
const decomposedTransform = decomposeTSR6(
|
|
11941
11969
|
this._computePcbGlobalTransformBeforeLayout()
|
|
11942
11970
|
);
|
|
11943
11971
|
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
@@ -12974,7 +13002,7 @@ var SilkscreenPath = class extends PrimitiveComponent2 {
|
|
|
12974
13002
|
|
|
12975
13003
|
// lib/components/primitive-components/SilkscreenRect.ts
|
|
12976
13004
|
import { silkscreenRectProps } from "@tscircuit/props";
|
|
12977
|
-
import { decomposeTSR as
|
|
13005
|
+
import { decomposeTSR as decomposeTSR7 } from "transformation-matrix";
|
|
12978
13006
|
var SilkscreenRect = class extends PrimitiveComponent2 {
|
|
12979
13007
|
pcb_silkscreen_rect_id = null;
|
|
12980
13008
|
isPcbPrimitive = true;
|
|
@@ -12990,7 +13018,7 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
|
|
|
12990
13018
|
*/
|
|
12991
13019
|
_isRotated90Degrees() {
|
|
12992
13020
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
12993
|
-
const decomposedTransform =
|
|
13021
|
+
const decomposedTransform = decomposeTSR7(globalTransform);
|
|
12994
13022
|
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
12995
13023
|
const normalizedRotationDegrees = (rotationDegrees % 360 + 360) % 360;
|
|
12996
13024
|
const rotationTolerance = 0.01;
|
|
@@ -13062,7 +13090,7 @@ import { silkscreenTextProps } from "@tscircuit/props";
|
|
|
13062
13090
|
import {
|
|
13063
13091
|
applyToPoint as applyToPoint25,
|
|
13064
13092
|
compose as compose5,
|
|
13065
|
-
decomposeTSR as
|
|
13093
|
+
decomposeTSR as decomposeTSR8,
|
|
13066
13094
|
flipY as flipY3,
|
|
13067
13095
|
identity as identity6
|
|
13068
13096
|
} from "transformation-matrix";
|
|
@@ -13088,7 +13116,7 @@ var SilkscreenText = class extends PrimitiveComponent2 {
|
|
|
13088
13116
|
rotation5 = props.pcbRotation;
|
|
13089
13117
|
} else {
|
|
13090
13118
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
13091
|
-
const decomposedTransform =
|
|
13119
|
+
const decomposedTransform = decomposeTSR8(globalTransform);
|
|
13092
13120
|
rotation5 = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
13093
13121
|
}
|
|
13094
13122
|
if (isFlipped) {
|
|
@@ -13212,28 +13240,7 @@ import { getBoundsFromPoints as getBoundsFromPoints4 } from "@tscircuit/math-uti
|
|
|
13212
13240
|
import {
|
|
13213
13241
|
distance as distance5
|
|
13214
13242
|
} from "circuit-json";
|
|
13215
|
-
import { applyToPoint as applyToPoint27, decomposeTSR as
|
|
13216
|
-
|
|
13217
|
-
// lib/utils/pcb/get-axis-aligned-size-from-rotated-rect.ts
|
|
13218
|
-
function getAxisAlignedSizeFromRotatedRect({
|
|
13219
|
-
width,
|
|
13220
|
-
height,
|
|
13221
|
-
ccwRotationDegrees
|
|
13222
|
-
}) {
|
|
13223
|
-
const angleRad = ccwRotationDegrees * Math.PI / 180;
|
|
13224
|
-
const cosAngle = Math.cos(angleRad);
|
|
13225
|
-
const sinAngle = Math.sin(angleRad);
|
|
13226
|
-
const w2 = width / 2;
|
|
13227
|
-
const h2 = height / 2;
|
|
13228
|
-
const xExtent = Math.abs(w2 * cosAngle) + Math.abs(h2 * sinAngle);
|
|
13229
|
-
const yExtent = Math.abs(w2 * sinAngle) + Math.abs(h2 * cosAngle);
|
|
13230
|
-
return {
|
|
13231
|
-
width: xExtent * 2,
|
|
13232
|
-
height: yExtent * 2,
|
|
13233
|
-
xExtent,
|
|
13234
|
-
yExtent
|
|
13235
|
-
};
|
|
13236
|
-
}
|
|
13243
|
+
import { applyToPoint as applyToPoint27, decomposeTSR as decomposeTSR9 } from "transformation-matrix";
|
|
13237
13244
|
|
|
13238
13245
|
// lib/utils/pcb/get-polygon-solder-paste-contours.ts
|
|
13239
13246
|
import Flatten from "@flatten-js/core";
|
|
@@ -13429,7 +13436,7 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
13429
13436
|
const subcircuit = this.getSubcircuit();
|
|
13430
13437
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
13431
13438
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
13432
|
-
const decomposedTransform =
|
|
13439
|
+
const decomposedTransform = decomposeTSR9(
|
|
13433
13440
|
this._computePcbGlobalTransformBeforeLayout()
|
|
13434
13441
|
);
|
|
13435
13442
|
const rotationDegrees = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
@@ -13893,7 +13900,7 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
13893
13900
|
|
|
13894
13901
|
// lib/components/primitive-components/SolderPaste.ts
|
|
13895
13902
|
import { solderPasteProps } from "@tscircuit/props";
|
|
13896
|
-
import { applyToPoint as applyToPoint28, decomposeTSR as
|
|
13903
|
+
import { applyToPoint as applyToPoint28, decomposeTSR as decomposeTSR10 } from "transformation-matrix";
|
|
13897
13904
|
var isStandalonePcbSolderPaste = (element) => element.type === "pcb_solder_paste" && !element.pcb_smtpad_id && (element.shape === "circle" || element.shape === "rect" || element.shape === "rotated_rect");
|
|
13898
13905
|
var SolderPaste = class _SolderPaste extends PrimitiveComponent2 {
|
|
13899
13906
|
pcb_solder_paste_id = null;
|
|
@@ -13955,7 +13962,7 @@ var SolderPaste = class _SolderPaste extends PrimitiveComponent2 {
|
|
|
13955
13962
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
13956
13963
|
const { maybeFlipLayer, isFlipped } = this._getPcbPrimitiveFlippedHelpers();
|
|
13957
13964
|
const center = applyToPoint28(transform, { x: 0, y: 0 });
|
|
13958
|
-
const rotation5 =
|
|
13965
|
+
const rotation5 = decomposeTSR10(transform, false, isFlipped).rotation.angle * 180 / Math.PI;
|
|
13959
13966
|
const base = {
|
|
13960
13967
|
...center,
|
|
13961
13968
|
layer: maybeFlipLayer(authoredLayer),
|
|
@@ -15760,7 +15767,7 @@ import {
|
|
|
15760
15767
|
isValidElement
|
|
15761
15768
|
} from "react";
|
|
15762
15769
|
import { symbols as symbols2 } from "schematic-symbols";
|
|
15763
|
-
import { decomposeTSR as
|
|
15770
|
+
import { decomposeTSR as decomposeTSR12 } from "transformation-matrix";
|
|
15764
15771
|
import { z as z10 } from "zod";
|
|
15765
15772
|
|
|
15766
15773
|
// lib/components/primitive-components/CadAssembly.ts
|
|
@@ -16251,7 +16258,7 @@ var constructAssetUrl = (targetUrl, baseUrl) => {
|
|
|
16251
16258
|
};
|
|
16252
16259
|
|
|
16253
16260
|
// lib/components/primitive-components/CadModel.ts
|
|
16254
|
-
import { decomposeTSR as
|
|
16261
|
+
import { decomposeTSR as decomposeTSR11 } from "transformation-matrix";
|
|
16255
16262
|
import { z as z9 } from "zod";
|
|
16256
16263
|
|
|
16257
16264
|
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
@@ -16445,7 +16452,7 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
16445
16452
|
if (!props || typeof props.modelUrl !== "string" && typeof props.stepUrl !== "string")
|
|
16446
16453
|
return;
|
|
16447
16454
|
const parentTransform = parent._computePcbGlobalTransformBeforeLayout();
|
|
16448
|
-
const decomposedTransform =
|
|
16455
|
+
const decomposedTransform = decomposeTSR11(parentTransform);
|
|
16449
16456
|
const accumulatedRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
16450
16457
|
const sourceRotationOffset = props.pcbRotationOffset ?? props.rotationOffset;
|
|
16451
16458
|
const rotationOffset = rotation3.parse({ x: 0, y: 0, z: 0 });
|
|
@@ -18134,7 +18141,11 @@ function NormalComponent_doInitialComponentAvailabilityWarning(component, { refr
|
|
|
18134
18141
|
}
|
|
18135
18142
|
|
|
18136
18143
|
// lib/components/base-components/NormalComponent/NormalComponent_doInitialSupplierFootprintMismatchWarning.ts
|
|
18137
|
-
import {
|
|
18144
|
+
import {
|
|
18145
|
+
getPlatedHolePolygon,
|
|
18146
|
+
getSmtPadPolygon,
|
|
18147
|
+
placePolygon
|
|
18148
|
+
} from "@tscircuit/circuit-json-util";
|
|
18138
18149
|
import {
|
|
18139
18150
|
supplierProps as supplierProps4
|
|
18140
18151
|
} from "@tscircuit/props";
|
|
@@ -18144,12 +18155,24 @@ import {
|
|
|
18144
18155
|
} from "circuit-json";
|
|
18145
18156
|
var SUPPLIER_FOOTPRINT_IOU_WARNING_THRESHOLD = 0.8;
|
|
18146
18157
|
var supplierNames3 = supplierProps4.shape.supplierPartNumbers.unwrap().keySchema.options;
|
|
18147
|
-
var isCopperElement = (elm) => elm.type === "pcb_smtpad" || elm.type === "pcb_plated_hole";
|
|
18148
18158
|
var isValidBounds = (bounds) => Number.isFinite(bounds.minX) && Number.isFinite(bounds.minY) && Number.isFinite(bounds.maxX) && Number.isFinite(bounds.maxY) && bounds.maxX > bounds.minX && bounds.maxY > bounds.minY;
|
|
18149
|
-
var getCopperBounds = (elements) => {
|
|
18150
|
-
const
|
|
18151
|
-
|
|
18152
|
-
|
|
18159
|
+
var getCopperBounds = (elements, ccwRotationDegrees = 0) => {
|
|
18160
|
+
const bounds = {
|
|
18161
|
+
minX: Infinity,
|
|
18162
|
+
minY: Infinity,
|
|
18163
|
+
maxX: -Infinity,
|
|
18164
|
+
maxY: -Infinity
|
|
18165
|
+
};
|
|
18166
|
+
for (const element of elements) {
|
|
18167
|
+
if (element.type !== "pcb_smtpad" && element.type !== "pcb_plated_hole")
|
|
18168
|
+
continue;
|
|
18169
|
+
const polygon = element.type === "pcb_smtpad" ? getSmtPadPolygon(element) : getPlatedHolePolygon(element, ccwRotationDegrees);
|
|
18170
|
+
const box = placePolygon(polygon, { x: 0, y: 0 }, -ccwRotationDegrees).box;
|
|
18171
|
+
bounds.minX = Math.min(bounds.minX, box.xmin);
|
|
18172
|
+
bounds.minY = Math.min(bounds.minY, box.ymin);
|
|
18173
|
+
bounds.maxX = Math.max(bounds.maxX, box.xmax);
|
|
18174
|
+
bounds.maxY = Math.max(bounds.maxY, box.ymax);
|
|
18175
|
+
}
|
|
18153
18176
|
if (!isValidBounds(bounds)) return null;
|
|
18154
18177
|
return bounds;
|
|
18155
18178
|
};
|
|
@@ -18211,7 +18234,11 @@ function NormalComponent_doInitialSupplierFootprintMismatchWarning(component) {
|
|
|
18211
18234
|
pcb_component_id: component.pcb_component_id
|
|
18212
18235
|
})
|
|
18213
18236
|
];
|
|
18214
|
-
const
|
|
18237
|
+
const pcbComponent = db2.pcb_component.get(component.pcb_component_id);
|
|
18238
|
+
const localBounds = getCopperBounds(
|
|
18239
|
+
localCopperElements,
|
|
18240
|
+
pcbComponent.rotation
|
|
18241
|
+
);
|
|
18215
18242
|
if (!localBounds) return;
|
|
18216
18243
|
component._hasStartedSupplierFootprintMismatchWarningCheck = true;
|
|
18217
18244
|
component._queueAsyncEffect("check-supplier-footprint-mismatch", async () => {
|
|
@@ -19293,7 +19320,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
19293
19320
|
}
|
|
19294
19321
|
getGlobalTransformRotation() {
|
|
19295
19322
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
19296
|
-
const decomposedTransform =
|
|
19323
|
+
const decomposedTransform = decomposeTSR12(globalTransform);
|
|
19297
19324
|
return decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
19298
19325
|
}
|
|
19299
19326
|
_footprintChildCache;
|
|
@@ -19853,7 +19880,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
19853
19880
|
const computedLayer = this.props.layer === "bottom" ? "bottom" : "top";
|
|
19854
19881
|
const pcbComponent = db2.pcb_component.get(this.pcb_component_id);
|
|
19855
19882
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
19856
|
-
const decomposedTransform =
|
|
19883
|
+
const decomposedTransform = decomposeTSR12(globalTransform);
|
|
19857
19884
|
const preLayoutRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
19858
19885
|
const totalRotation = pcbComponent?.position_mode === "packed" ? pcbComponent.rotation ?? preLayoutRotation : preLayoutRotation;
|
|
19859
19886
|
const isBottomLayer = computedLayer === "bottom";
|
|
@@ -111318,7 +111345,7 @@ var Group_doInitialAssignSchematicSheetToConnectedComponents = (group) => {
|
|
|
111318
111345
|
};
|
|
111319
111346
|
|
|
111320
111347
|
// lib/components/primitive-components/Group/Group_doInitialPcbCalcPlacementResolution.ts
|
|
111321
|
-
import { getBoundsOfPcbElements
|
|
111348
|
+
import { getBoundsOfPcbElements } from "@tscircuit/circuit-json-util";
|
|
111322
111349
|
var SUPPORTED_COMPONENT_FIELDS = /* @__PURE__ */ new Set([
|
|
111323
111350
|
"x",
|
|
111324
111351
|
"y",
|
|
@@ -111606,7 +111633,7 @@ function updateVarsForNamedComponent(component, vars) {
|
|
|
111606
111633
|
});
|
|
111607
111634
|
const padElementsByReference = collectPadElementsByReference(component);
|
|
111608
111635
|
for (const [referencePath, elements] of padElementsByReference.entries()) {
|
|
111609
|
-
const bounds =
|
|
111636
|
+
const bounds = getBoundsOfPcbElements(elements);
|
|
111610
111637
|
const minX = bounds.minX;
|
|
111611
111638
|
const maxX = bounds.maxX;
|
|
111612
111639
|
const minY = bounds.minY;
|
|
@@ -119448,7 +119475,7 @@ var RoutingPhasePreparationError = class extends Error {
|
|
|
119448
119475
|
var package_default = {
|
|
119449
119476
|
name: "@tscircuit/core",
|
|
119450
119477
|
type: "module",
|
|
119451
|
-
version: "0.0.
|
|
119478
|
+
version: "0.0.2167",
|
|
119452
119479
|
types: "dist/index.d.ts",
|
|
119453
119480
|
main: "dist/index.js",
|
|
119454
119481
|
module: "dist/index.js",
|
|
@@ -124661,9 +124688,9 @@ import {
|
|
|
124661
124688
|
import Flatbush2 from "flatbush";
|
|
124662
124689
|
import {
|
|
124663
124690
|
copperPolygonsTouch,
|
|
124664
|
-
getPlatedHolePolygon,
|
|
124691
|
+
getPlatedHolePolygon as getPlatedHolePolygon2,
|
|
124665
124692
|
getPourPolygon,
|
|
124666
|
-
getSmtPadPolygon,
|
|
124693
|
+
getSmtPadPolygon as getSmtPadPolygon2,
|
|
124667
124694
|
getTraceSegmentPolygon,
|
|
124668
124695
|
getViaPolygon
|
|
124669
124696
|
} from "@tscircuit/circuit-json-util";
|
|
@@ -124720,7 +124747,7 @@ var findFloatingCopper = (circuitJson, generatedStitchingViaIds = /* @__PURE__ *
|
|
|
124720
124747
|
const netId = connectivity.getNetConnectedToId(element.pcb_smtpad_id);
|
|
124721
124748
|
if (netId && pouredNets.has(netId))
|
|
124722
124749
|
add({
|
|
124723
|
-
polygon:
|
|
124750
|
+
polygon: getSmtPadPolygon2(element),
|
|
124724
124751
|
layers: [element.layer],
|
|
124725
124752
|
netId,
|
|
124726
124753
|
isTerminal: !!element.pcb_port_id
|
|
@@ -124729,7 +124756,7 @@ var findFloatingCopper = (circuitJson, generatedStitchingViaIds = /* @__PURE__ *
|
|
|
124729
124756
|
const netId = connectivity.getNetConnectedToId(element.pcb_plated_hole_id);
|
|
124730
124757
|
if (netId && pouredNets.has(netId))
|
|
124731
124758
|
add({
|
|
124732
|
-
polygon:
|
|
124759
|
+
polygon: getPlatedHolePolygon2(
|
|
124733
124760
|
element,
|
|
124734
124761
|
element.pcb_component_id ? components.get(element.pcb_component_id)?.rotation : 0
|
|
124735
124762
|
),
|
|
@@ -134983,7 +135010,7 @@ var PcbBend = class extends PrimitiveComponent2 {
|
|
|
134983
135010
|
|
|
134984
135011
|
// lib/components/primitive-components/PcbStiffener.ts
|
|
134985
135012
|
import { pcbStiffenerProps } from "@tscircuit/props";
|
|
134986
|
-
import { applyToPoint as applyToPoint46, decomposeTSR as
|
|
135013
|
+
import { applyToPoint as applyToPoint46, decomposeTSR as decomposeTSR13 } from "transformation-matrix";
|
|
134987
135014
|
var PcbStiffener = class extends PrimitiveComponent2 {
|
|
134988
135015
|
pcb_stiffener_id = null;
|
|
134989
135016
|
get config() {
|
|
@@ -135007,7 +135034,7 @@ var PcbStiffener = class extends PrimitiveComponent2 {
|
|
|
135007
135034
|
const geometry = props.shape === "rect" ? {
|
|
135008
135035
|
shape: "rect",
|
|
135009
135036
|
center: applyToPoint46(transform, { x: 0, y: 0 }),
|
|
135010
|
-
rotation:
|
|
135037
|
+
rotation: decomposeTSR13(transform).rotation.angle * 180 / Math.PI,
|
|
135011
135038
|
width: props.width,
|
|
135012
135039
|
height: props.height
|
|
135013
135040
|
} : {
|