@tscircuit/core 0.0.827 → 0.0.829
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 +100 -57
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -86,12 +86,13 @@ __export(components_exports, {
|
|
|
86
86
|
// lib/components/base-components/NormalComponent/NormalComponent.ts
|
|
87
87
|
import { fp } from "@tscircuit/footprinter";
|
|
88
88
|
import {
|
|
89
|
-
distance as
|
|
89
|
+
distance as distance5,
|
|
90
90
|
pcb_manual_edit_conflict_warning,
|
|
91
91
|
pcb_component_invalid_layer_error,
|
|
92
92
|
point3 as point32,
|
|
93
93
|
rotation as rotation2,
|
|
94
|
-
schematic_manual_edit_conflict_warning
|
|
94
|
+
schematic_manual_edit_conflict_warning,
|
|
95
|
+
unknown_error_finding_part
|
|
95
96
|
} from "circuit-json";
|
|
96
97
|
import { decomposeTSR as decomposeTSR5 } from "transformation-matrix";
|
|
97
98
|
import Debug5 from "debug";
|
|
@@ -1843,7 +1844,10 @@ var createNetsFromProps = (component, props) => {
|
|
|
1843
1844
|
|
|
1844
1845
|
// lib/components/primitive-components/SmtPad.ts
|
|
1845
1846
|
import { smtPadProps } from "@tscircuit/props";
|
|
1846
|
-
import {
|
|
1847
|
+
import {
|
|
1848
|
+
distance
|
|
1849
|
+
} from "circuit-json";
|
|
1850
|
+
import { applyToPoint as applyToPoint2, decomposeTSR } from "transformation-matrix";
|
|
1847
1851
|
var SmtPad = class extends PrimitiveComponent2 {
|
|
1848
1852
|
pcb_smtpad_id = null;
|
|
1849
1853
|
matchedPort = null;
|
|
@@ -1912,6 +1916,7 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
1912
1916
|
if (!props.portHints) return;
|
|
1913
1917
|
const subcircuit = this.getSubcircuit();
|
|
1914
1918
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
1919
|
+
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
1915
1920
|
const decomposedTransform = decomposeTSR(
|
|
1916
1921
|
this._computePcbGlobalTransformBeforeLayout()
|
|
1917
1922
|
);
|
|
@@ -2055,16 +2060,23 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
2055
2060
|
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
2056
2061
|
});
|
|
2057
2062
|
} else if (props.shape === "polygon") {
|
|
2063
|
+
const transformedPoints = props.points.map((point) => {
|
|
2064
|
+
const transformed = applyToPoint2(globalTransform, {
|
|
2065
|
+
x: distance.parse(point.x),
|
|
2066
|
+
y: distance.parse(point.y)
|
|
2067
|
+
});
|
|
2068
|
+
return {
|
|
2069
|
+
x: transformed.x,
|
|
2070
|
+
y: transformed.y
|
|
2071
|
+
};
|
|
2072
|
+
});
|
|
2058
2073
|
pcb_smtpad = db.pcb_smtpad.insert({
|
|
2059
2074
|
pcb_component_id,
|
|
2060
2075
|
pcb_port_id: this.matchedPort?.pcb_port_id,
|
|
2061
2076
|
// port likely isn't matched
|
|
2062
2077
|
layer: maybeFlipLayer(props.layer ?? "top"),
|
|
2063
2078
|
shape: "polygon",
|
|
2064
|
-
points:
|
|
2065
|
-
x: p.x + position.x,
|
|
2066
|
-
y: p.y + position.y
|
|
2067
|
-
})),
|
|
2079
|
+
points: transformedPoints,
|
|
2068
2080
|
port_hints: props.portHints.map((ph) => ph.toString()),
|
|
2069
2081
|
is_covered_with_solder_mask: isCoveredWithSolderMask,
|
|
2070
2082
|
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
@@ -2206,7 +2218,7 @@ var SmtPad = class extends PrimitiveComponent2 {
|
|
|
2206
2218
|
|
|
2207
2219
|
// lib/components/primitive-components/SilkscreenPath.ts
|
|
2208
2220
|
import { silkscreenPathProps } from "@tscircuit/props";
|
|
2209
|
-
import { applyToPoint as
|
|
2221
|
+
import { applyToPoint as applyToPoint3 } from "transformation-matrix";
|
|
2210
2222
|
var SilkscreenPath = class extends PrimitiveComponent2 {
|
|
2211
2223
|
pcb_silkscreen_path_id = null;
|
|
2212
2224
|
isPcbPrimitive = true;
|
|
@@ -2234,7 +2246,7 @@ var SilkscreenPath = class extends PrimitiveComponent2 {
|
|
|
2234
2246
|
pcb_component_id,
|
|
2235
2247
|
layer,
|
|
2236
2248
|
route: props.route.map((p) => {
|
|
2237
|
-
const transformedPosition =
|
|
2249
|
+
const transformedPosition = applyToPoint3(transform, {
|
|
2238
2250
|
x: p.x,
|
|
2239
2251
|
y: p.y
|
|
2240
2252
|
});
|
|
@@ -2296,7 +2308,7 @@ var SilkscreenPath = class extends PrimitiveComponent2 {
|
|
|
2296
2308
|
// lib/components/primitive-components/PcbTrace.ts
|
|
2297
2309
|
import { z as z5 } from "zod";
|
|
2298
2310
|
import { pcb_trace_route_point } from "circuit-json";
|
|
2299
|
-
import { applyToPoint as
|
|
2311
|
+
import { applyToPoint as applyToPoint4 } from "transformation-matrix";
|
|
2300
2312
|
var pcbTraceProps = z5.object({
|
|
2301
2313
|
route: z5.array(pcb_trace_route_point),
|
|
2302
2314
|
// If this primitive PcbTrace needs to be associated with a source_trace_id
|
|
@@ -2322,7 +2334,7 @@ var PcbTrace = class extends PrimitiveComponent2 {
|
|
|
2322
2334
|
const parentTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
2323
2335
|
const transformedRoute = props.route.map((point) => {
|
|
2324
2336
|
const { x, y, ...restOfPoint } = point;
|
|
2325
|
-
const transformedPoint =
|
|
2337
|
+
const transformedPoint = applyToPoint4(parentTransform, { x, y });
|
|
2326
2338
|
if (point.route_type === "wire" && point.layer) {
|
|
2327
2339
|
return {
|
|
2328
2340
|
...transformedPoint,
|
|
@@ -2809,7 +2821,7 @@ var SilkscreenText = class extends PrimitiveComponent2 {
|
|
|
2809
2821
|
};
|
|
2810
2822
|
|
|
2811
2823
|
// lib/components/primitive-components/Cutout.ts
|
|
2812
|
-
import { applyToPoint as
|
|
2824
|
+
import { applyToPoint as applyToPoint5 } from "transformation-matrix";
|
|
2813
2825
|
import { cutoutProps } from "@tscircuit/props";
|
|
2814
2826
|
var Cutout = class extends PrimitiveComponent2 {
|
|
2815
2827
|
pcb_cutout_id = null;
|
|
@@ -2854,7 +2866,7 @@ var Cutout = class extends PrimitiveComponent2 {
|
|
|
2854
2866
|
} else if (props.shape === "polygon") {
|
|
2855
2867
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
2856
2868
|
const transformedPoints = props.points.map(
|
|
2857
|
-
(p) =>
|
|
2869
|
+
(p) => applyToPoint5(transform, p)
|
|
2858
2870
|
);
|
|
2859
2871
|
const polygonData = {
|
|
2860
2872
|
shape: "polygon",
|
|
@@ -3410,7 +3422,7 @@ function getRelativeDirection(pointA, pointB) {
|
|
|
3410
3422
|
|
|
3411
3423
|
// lib/components/primitive-components/Port/Port.ts
|
|
3412
3424
|
import "schematic-symbols";
|
|
3413
|
-
import { applyToPoint as
|
|
3425
|
+
import { applyToPoint as applyToPoint6, compose as compose3, translate as translate3 } from "transformation-matrix";
|
|
3414
3426
|
import { z as z6 } from "zod";
|
|
3415
3427
|
|
|
3416
3428
|
// lib/components/primitive-components/Port/areAllPcbPrimitivesOverlapping.ts
|
|
@@ -3609,7 +3621,7 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
3609
3621
|
parentNormalComponent.computeSchematicGlobalTransform(),
|
|
3610
3622
|
translate3(-symbol.center.x, -symbol.center.y)
|
|
3611
3623
|
);
|
|
3612
|
-
return
|
|
3624
|
+
return applyToPoint6(transform, schematicSymbolPortDef);
|
|
3613
3625
|
}
|
|
3614
3626
|
const parentBoxDim = parentNormalComponent?._getSchematicBoxDimensions();
|
|
3615
3627
|
if (parentBoxDim && this.props.pinNumber !== void 0) {
|
|
@@ -3621,7 +3633,7 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
3621
3633
|
`Couldn't find position for schematic_port for port ${this.getString()} inside of the schematic box`
|
|
3622
3634
|
);
|
|
3623
3635
|
}
|
|
3624
|
-
return
|
|
3636
|
+
return applyToPoint6(
|
|
3625
3637
|
parentNormalComponent.computeSchematicGlobalTransform(),
|
|
3626
3638
|
localPortPosition
|
|
3627
3639
|
);
|
|
@@ -4449,7 +4461,7 @@ var Footprint = class extends PrimitiveComponent2 {
|
|
|
4449
4461
|
// lib/components/primitive-components/CadModel.ts
|
|
4450
4462
|
import { cadmodelProps, point3 } from "@tscircuit/props";
|
|
4451
4463
|
import { z as z7 } from "zod";
|
|
4452
|
-
import { distance } from "circuit-json";
|
|
4464
|
+
import { distance as distance2 } from "circuit-json";
|
|
4453
4465
|
import { decomposeTSR as decomposeTSR4 } from "transformation-matrix";
|
|
4454
4466
|
|
|
4455
4467
|
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
@@ -4526,7 +4538,7 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
4526
4538
|
z: props.pcbZ ?? 0,
|
|
4527
4539
|
...typeof props.positionOffset === "object" ? props.positionOffset : {}
|
|
4528
4540
|
});
|
|
4529
|
-
const zOffsetFromSurface = props.zOffsetFromSurface !== void 0 ?
|
|
4541
|
+
const zOffsetFromSurface = props.zOffsetFromSurface !== void 0 ? distance2.parse(props.zOffsetFromSurface) : 0;
|
|
4530
4542
|
const layer = parent.props.layer === "bottom" ? "bottom" : "top";
|
|
4531
4543
|
const ext = props.modelUrl ? getFileExtension(props.modelUrl) : void 0;
|
|
4532
4544
|
const urlProps = {};
|
|
@@ -4839,7 +4851,7 @@ var getEnteringEdgeFromDirection = (direction) => {
|
|
|
4839
4851
|
};
|
|
4840
4852
|
|
|
4841
4853
|
// lib/utils/schematic/getStubEdges.ts
|
|
4842
|
-
import { distance as
|
|
4854
|
+
import { distance as distance3 } from "@tscircuit/math-utils";
|
|
4843
4855
|
var getStubEdges = ({
|
|
4844
4856
|
firstEdge,
|
|
4845
4857
|
firstEdgePort,
|
|
@@ -4886,7 +4898,7 @@ var getStubEdges = ({
|
|
|
4886
4898
|
});
|
|
4887
4899
|
}
|
|
4888
4900
|
}
|
|
4889
|
-
edges = edges.filter((e) =>
|
|
4901
|
+
edges = edges.filter((e) => distance3(e.from, e.to) > 0.01);
|
|
4890
4902
|
return edges;
|
|
4891
4903
|
};
|
|
4892
4904
|
|
|
@@ -5389,7 +5401,7 @@ import { calculateElbow } from "calculate-elbow";
|
|
|
5389
5401
|
import { doesLineIntersectLine as doesLineIntersectLine3 } from "@tscircuit/math-utils";
|
|
5390
5402
|
|
|
5391
5403
|
// lib/components/primitive-components/Trace/trace-utils/create-schematic-trace-crossing-segments.ts
|
|
5392
|
-
import { distance as
|
|
5404
|
+
import { distance as distance4, doesLineIntersectLine } from "@tscircuit/math-utils";
|
|
5393
5405
|
|
|
5394
5406
|
// lib/components/primitive-components/Trace/trace-utils/get-other-schematic-traces.ts
|
|
5395
5407
|
var getOtherSchematicTraces = ({
|
|
@@ -5456,7 +5468,7 @@ var createSchematicTraceCrossingSegments = ({
|
|
|
5456
5468
|
otherEdgesIntersections.push({
|
|
5457
5469
|
otherEdge,
|
|
5458
5470
|
crossingPoint: crossingPoint2,
|
|
5459
|
-
distanceFromEdgeFrom:
|
|
5471
|
+
distanceFromEdgeFrom: distance4(edge.from, crossingPoint2)
|
|
5460
5472
|
});
|
|
5461
5473
|
}
|
|
5462
5474
|
}
|
|
@@ -5481,7 +5493,7 @@ var createSchematicTraceCrossingSegments = ({
|
|
|
5481
5493
|
x: crossingPoint.x + crossingUnitVec.x * crossingSegmentLength / 2,
|
|
5482
5494
|
y: crossingPoint.y + crossingUnitVec.y * crossingSegmentLength / 2
|
|
5483
5495
|
};
|
|
5484
|
-
const overshot =
|
|
5496
|
+
const overshot = distance4(afterCrossing, edge.to) < crossingSegmentLength;
|
|
5485
5497
|
const newEdges = [
|
|
5486
5498
|
{ from: edge.from, to: beforeCrossing },
|
|
5487
5499
|
{ from: beforeCrossing, to: afterCrossing, is_crossing: true },
|
|
@@ -6410,7 +6422,7 @@ function Trace_doInitialPcbTraceRender(trace) {
|
|
|
6410
6422
|
}
|
|
6411
6423
|
|
|
6412
6424
|
// lib/components/primitive-components/Trace/Trace_doInitialPcbManualTraceRender.ts
|
|
6413
|
-
import { applyToPoint as
|
|
6425
|
+
import { applyToPoint as applyToPoint7, identity as identity3 } from "transformation-matrix";
|
|
6414
6426
|
function Trace_doInitialPcbManualTraceRender(trace) {
|
|
6415
6427
|
if (trace.root?.pcbDisabled) return;
|
|
6416
6428
|
const { db } = trace.root;
|
|
@@ -6488,7 +6500,7 @@ function Trace_doInitialPcbManualTraceRender(trace) {
|
|
|
6488
6500
|
coordinates = { x: pt.x, y: pt.y };
|
|
6489
6501
|
isGlobalPosition = false;
|
|
6490
6502
|
}
|
|
6491
|
-
const finalCoordinates = isGlobalPosition ? coordinates :
|
|
6503
|
+
const finalCoordinates = isGlobalPosition ? coordinates : applyToPoint7(transform, coordinates);
|
|
6492
6504
|
route.push({
|
|
6493
6505
|
route_type: "wire",
|
|
6494
6506
|
x: finalCoordinates.x,
|
|
@@ -8446,7 +8458,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
8446
8458
|
z: 0,
|
|
8447
8459
|
...typeof cadModel?.positionOffset === "object" ? cadModel.positionOffset : {}
|
|
8448
8460
|
});
|
|
8449
|
-
const zOffsetFromSurface = cadModel && typeof cadModel === "object" && "zOffsetFromSurface" in cadModel ? cadModel.zOffsetFromSurface !== void 0 ?
|
|
8461
|
+
const zOffsetFromSurface = cadModel && typeof cadModel === "object" && "zOffsetFromSurface" in cadModel ? cadModel.zOffsetFromSurface !== void 0 ? distance5.parse(
|
|
8450
8462
|
cadModel.zOffsetFromSurface
|
|
8451
8463
|
) : 0 : 0;
|
|
8452
8464
|
const computedLayer = this.props.layer === "bottom" ? "bottom" : "top";
|
|
@@ -8518,7 +8530,26 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
8518
8530
|
footprinterString
|
|
8519
8531
|
})
|
|
8520
8532
|
);
|
|
8521
|
-
|
|
8533
|
+
if (typeof result === "string") {
|
|
8534
|
+
if (result.includes("<!DOCTYPE") || result.includes("<html")) {
|
|
8535
|
+
throw new Error(
|
|
8536
|
+
`Failed to fetch supplier part numbers: Received HTML response instead of JSON. Response starts with: ${result.substring(0, 100)}`
|
|
8537
|
+
);
|
|
8538
|
+
}
|
|
8539
|
+
if (result === "Not found") {
|
|
8540
|
+
return {};
|
|
8541
|
+
}
|
|
8542
|
+
throw new Error(
|
|
8543
|
+
`Invalid supplier part numbers format: Expected object but got string: "${result}"`
|
|
8544
|
+
);
|
|
8545
|
+
}
|
|
8546
|
+
if (!result || Array.isArray(result) || typeof result !== "object") {
|
|
8547
|
+
const actualType = result === null ? "null" : Array.isArray(result) ? "array" : typeof result;
|
|
8548
|
+
throw new Error(
|
|
8549
|
+
`Invalid supplier part numbers format: Expected object but got ${actualType}`
|
|
8550
|
+
);
|
|
8551
|
+
}
|
|
8552
|
+
const supplierPartNumbers = result;
|
|
8522
8553
|
if (cacheEngine) {
|
|
8523
8554
|
try {
|
|
8524
8555
|
await cacheEngine.setItem(cacheKey, JSON.stringify(supplierPartNumbers));
|
|
@@ -8551,8 +8582,20 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
8551
8582
|
return;
|
|
8552
8583
|
}
|
|
8553
8584
|
this._queueAsyncEffect("get-supplier-part-numbers", async () => {
|
|
8554
|
-
|
|
8555
|
-
|
|
8585
|
+
await supplierPartNumbersMaybePromise.then((supplierPartNumbers) => {
|
|
8586
|
+
this._asyncSupplierPartNumbers = supplierPartNumbers;
|
|
8587
|
+
this._markDirty("PartsEngineRender");
|
|
8588
|
+
}).catch((error) => {
|
|
8589
|
+
this._asyncSupplierPartNumbers = {};
|
|
8590
|
+
const errorObj = unknown_error_finding_part.parse({
|
|
8591
|
+
type: "unknown_error_finding_part",
|
|
8592
|
+
message: `Failed to fetch supplier part numbers for ${this.getString()}: ${error.message}`,
|
|
8593
|
+
source_component_id: this.source_component_id,
|
|
8594
|
+
subcircuit_id: this.getSubcircuit()?.subcircuit_id
|
|
8595
|
+
});
|
|
8596
|
+
db.unknown_error_finding_part.insert(errorObj);
|
|
8597
|
+
this._markDirty("PartsEngineRender");
|
|
8598
|
+
});
|
|
8556
8599
|
});
|
|
8557
8600
|
}
|
|
8558
8601
|
updatePartsEngineRender() {
|
|
@@ -8829,14 +8872,14 @@ var CapacityMeshAutorouter = class {
|
|
|
8829
8872
|
|
|
8830
8873
|
// lib/components/primitive-components/Group/Group.ts
|
|
8831
8874
|
import {
|
|
8832
|
-
distance as
|
|
8875
|
+
distance as distance6
|
|
8833
8876
|
} from "circuit-json";
|
|
8834
8877
|
import Debug13 from "debug";
|
|
8835
8878
|
import "zod";
|
|
8836
8879
|
|
|
8837
8880
|
// lib/components/primitive-components/TraceHint.ts
|
|
8838
8881
|
import { traceHintProps } from "@tscircuit/props";
|
|
8839
|
-
import { applyToPoint as
|
|
8882
|
+
import { applyToPoint as applyToPoint8 } from "transformation-matrix";
|
|
8840
8883
|
var TraceHint = class extends PrimitiveComponent2 {
|
|
8841
8884
|
matchedPort = null;
|
|
8842
8885
|
get config() {
|
|
@@ -8876,7 +8919,7 @@ var TraceHint = class extends PrimitiveComponent2 {
|
|
|
8876
8919
|
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
8877
8920
|
return offsets.map(
|
|
8878
8921
|
(offset) => ({
|
|
8879
|
-
...
|
|
8922
|
+
...applyToPoint8(globalTransform, offset),
|
|
8880
8923
|
via: offset.via,
|
|
8881
8924
|
to_layer: offset.to_layer,
|
|
8882
8925
|
trace_width: offset.trace_width
|
|
@@ -12761,8 +12804,8 @@ var Group6 = class extends NormalComponent3 {
|
|
|
12761
12804
|
const groupProps2 = props;
|
|
12762
12805
|
const hasOutline = groupProps2.outline && groupProps2.outline.length > 0;
|
|
12763
12806
|
const numericOutline = hasOutline ? groupProps2.outline.map((point) => ({
|
|
12764
|
-
x:
|
|
12765
|
-
y:
|
|
12807
|
+
x: distance6.parse(point.x),
|
|
12808
|
+
y: distance6.parse(point.y)
|
|
12766
12809
|
})) : void 0;
|
|
12767
12810
|
const pcb_group = db.pcb_group.insert({
|
|
12768
12811
|
is_subcircuit: this.isSubcircuit,
|
|
@@ -12792,8 +12835,8 @@ var Group6 = class extends NormalComponent3 {
|
|
|
12792
12835
|
const hasExplicitPositioning = this._parsedProps.pcbX !== void 0 || this._parsedProps.pcbY !== void 0;
|
|
12793
12836
|
if (hasOutline) {
|
|
12794
12837
|
const numericOutline = props.outline.map((point) => ({
|
|
12795
|
-
x:
|
|
12796
|
-
y:
|
|
12838
|
+
x: distance6.parse(point.x),
|
|
12839
|
+
y: distance6.parse(point.y)
|
|
12797
12840
|
}));
|
|
12798
12841
|
const outlineBounds = getBoundsFromPoints3(numericOutline);
|
|
12799
12842
|
if (!outlineBounds) return;
|
|
@@ -14863,7 +14906,7 @@ var FabricationNoteRect = class extends PrimitiveComponent2 {
|
|
|
14863
14906
|
|
|
14864
14907
|
// lib/components/primitive-components/FabricationNotePath.ts
|
|
14865
14908
|
import { fabricationNotePathProps } from "@tscircuit/props";
|
|
14866
|
-
import { applyToPoint as
|
|
14909
|
+
import { applyToPoint as applyToPoint10 } from "transformation-matrix";
|
|
14867
14910
|
var FabricationNotePath = class extends PrimitiveComponent2 {
|
|
14868
14911
|
fabrication_note_path_id = null;
|
|
14869
14912
|
get config() {
|
|
@@ -14890,7 +14933,7 @@ var FabricationNotePath = class extends PrimitiveComponent2 {
|
|
|
14890
14933
|
layer,
|
|
14891
14934
|
color: props.color,
|
|
14892
14935
|
route: props.route.map((p) => {
|
|
14893
|
-
const transformedPosition =
|
|
14936
|
+
const transformedPosition = applyToPoint10(transform, {
|
|
14894
14937
|
x: p.x,
|
|
14895
14938
|
y: p.y
|
|
14896
14939
|
});
|
|
@@ -14942,7 +14985,7 @@ var FabricationNoteText = class extends PrimitiveComponent2 {
|
|
|
14942
14985
|
|
|
14943
14986
|
// lib/components/primitive-components/FabricationNoteDimension.ts
|
|
14944
14987
|
import { fabricationNoteDimensionProps } from "@tscircuit/props";
|
|
14945
|
-
import { applyToPoint as
|
|
14988
|
+
import { applyToPoint as applyToPoint11 } from "transformation-matrix";
|
|
14946
14989
|
var FabricationNoteDimension = class extends PrimitiveComponent2 {
|
|
14947
14990
|
fabrication_note_dimension_id = null;
|
|
14948
14991
|
isPcbPrimitive = true;
|
|
@@ -14961,13 +15004,13 @@ var FabricationNoteDimension = class extends PrimitiveComponent2 {
|
|
|
14961
15004
|
this.renderError(
|
|
14962
15005
|
`FabricationNoteDimension could not find selector "${input}"`
|
|
14963
15006
|
);
|
|
14964
|
-
return
|
|
15007
|
+
return applyToPoint11(transform, { x: 0, y: 0 });
|
|
14965
15008
|
}
|
|
14966
15009
|
return target._getGlobalPcbPositionBeforeLayout();
|
|
14967
15010
|
}
|
|
14968
15011
|
const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
|
|
14969
15012
|
const numericY = typeof input.y === "string" ? parseFloat(input.y) : input.y;
|
|
14970
|
-
return
|
|
15013
|
+
return applyToPoint11(transform, { x: numericX, y: numericY });
|
|
14971
15014
|
}
|
|
14972
15015
|
doInitialPcbPrimitiveRender() {
|
|
14973
15016
|
if (this.root?.pcbDisabled) return;
|
|
@@ -15036,7 +15079,7 @@ var FabricationNoteDimension = class extends PrimitiveComponent2 {
|
|
|
15036
15079
|
|
|
15037
15080
|
// lib/components/primitive-components/PcbNoteLine.ts
|
|
15038
15081
|
import { pcbNoteLineProps } from "@tscircuit/props";
|
|
15039
|
-
import { applyToPoint as
|
|
15082
|
+
import { applyToPoint as applyToPoint12 } from "transformation-matrix";
|
|
15040
15083
|
var PcbNoteLine = class extends PrimitiveComponent2 {
|
|
15041
15084
|
pcb_note_line_id = null;
|
|
15042
15085
|
isPcbPrimitive = true;
|
|
@@ -15053,8 +15096,8 @@ var PcbNoteLine = class extends PrimitiveComponent2 {
|
|
|
15053
15096
|
const subcircuit = this.getSubcircuit();
|
|
15054
15097
|
const group = this.getGroup();
|
|
15055
15098
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
15056
|
-
const start =
|
|
15057
|
-
const end =
|
|
15099
|
+
const start = applyToPoint12(transform, { x: props.x1, y: props.y1 });
|
|
15100
|
+
const end = applyToPoint12(transform, { x: props.x2, y: props.y2 });
|
|
15058
15101
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id ?? void 0;
|
|
15059
15102
|
const pcb_note_line = db.pcb_note_line.insert({
|
|
15060
15103
|
pcb_component_id,
|
|
@@ -15081,7 +15124,7 @@ var PcbNoteLine = class extends PrimitiveComponent2 {
|
|
|
15081
15124
|
|
|
15082
15125
|
// lib/components/primitive-components/PcbNoteRect.ts
|
|
15083
15126
|
import { pcbNoteRectProps } from "@tscircuit/props";
|
|
15084
|
-
import { applyToPoint as
|
|
15127
|
+
import { applyToPoint as applyToPoint13 } from "transformation-matrix";
|
|
15085
15128
|
var PcbNoteRect = class extends PrimitiveComponent2 {
|
|
15086
15129
|
pcb_note_rect_id = null;
|
|
15087
15130
|
isPcbPrimitive = true;
|
|
@@ -15096,7 +15139,7 @@ var PcbNoteRect = class extends PrimitiveComponent2 {
|
|
|
15096
15139
|
const { db } = this.root;
|
|
15097
15140
|
const { _parsedProps: props } = this;
|
|
15098
15141
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
15099
|
-
const center =
|
|
15142
|
+
const center = applyToPoint13(transform, { x: 0, y: 0 });
|
|
15100
15143
|
const subcircuit = this.getSubcircuit();
|
|
15101
15144
|
const group = this.getGroup();
|
|
15102
15145
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id ?? void 0;
|
|
@@ -15125,7 +15168,7 @@ var PcbNoteRect = class extends PrimitiveComponent2 {
|
|
|
15125
15168
|
|
|
15126
15169
|
// lib/components/primitive-components/PcbNoteText.ts
|
|
15127
15170
|
import { pcbNoteTextProps } from "@tscircuit/props";
|
|
15128
|
-
import { applyToPoint as
|
|
15171
|
+
import { applyToPoint as applyToPoint14 } from "transformation-matrix";
|
|
15129
15172
|
var PcbNoteText = class extends PrimitiveComponent2 {
|
|
15130
15173
|
pcb_note_text_id = null;
|
|
15131
15174
|
isPcbPrimitive = true;
|
|
@@ -15140,7 +15183,7 @@ var PcbNoteText = class extends PrimitiveComponent2 {
|
|
|
15140
15183
|
const { db } = this.root;
|
|
15141
15184
|
const { _parsedProps: props } = this;
|
|
15142
15185
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
15143
|
-
const anchorPosition =
|
|
15186
|
+
const anchorPosition = applyToPoint14(transform, { x: 0, y: 0 });
|
|
15144
15187
|
const subcircuit = this.getSubcircuit();
|
|
15145
15188
|
const group = this.getGroup();
|
|
15146
15189
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id ?? void 0;
|
|
@@ -15169,7 +15212,7 @@ var PcbNoteText = class extends PrimitiveComponent2 {
|
|
|
15169
15212
|
|
|
15170
15213
|
// lib/components/primitive-components/PcbNotePath.ts
|
|
15171
15214
|
import { pcbNotePathProps } from "@tscircuit/props";
|
|
15172
|
-
import { applyToPoint as
|
|
15215
|
+
import { applyToPoint as applyToPoint15 } from "transformation-matrix";
|
|
15173
15216
|
var PcbNotePath = class extends PrimitiveComponent2 {
|
|
15174
15217
|
pcb_note_path_id = null;
|
|
15175
15218
|
isPcbPrimitive = true;
|
|
@@ -15191,7 +15234,7 @@ var PcbNotePath = class extends PrimitiveComponent2 {
|
|
|
15191
15234
|
const { x, y, ...rest } = point;
|
|
15192
15235
|
const numericX = typeof x === "string" ? parseFloat(x) : x;
|
|
15193
15236
|
const numericY = typeof y === "string" ? parseFloat(y) : y;
|
|
15194
|
-
const transformed =
|
|
15237
|
+
const transformed = applyToPoint15(transform, { x: numericX, y: numericY });
|
|
15195
15238
|
return { ...rest, x: transformed.x, y: transformed.y };
|
|
15196
15239
|
});
|
|
15197
15240
|
const pcb_note_path = db.pcb_note_path.insert({
|
|
@@ -15223,7 +15266,7 @@ var PcbNotePath = class extends PrimitiveComponent2 {
|
|
|
15223
15266
|
|
|
15224
15267
|
// lib/components/primitive-components/PcbNoteDimension.ts
|
|
15225
15268
|
import { pcbNoteDimensionProps } from "@tscircuit/props";
|
|
15226
|
-
import { applyToPoint as
|
|
15269
|
+
import { applyToPoint as applyToPoint16 } from "transformation-matrix";
|
|
15227
15270
|
var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
15228
15271
|
pcb_note_dimension_id = null;
|
|
15229
15272
|
isPcbPrimitive = true;
|
|
@@ -15240,13 +15283,13 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
15240
15283
|
);
|
|
15241
15284
|
if (!target) {
|
|
15242
15285
|
this.renderError(`PcbNoteDimension could not find selector "${input}"`);
|
|
15243
|
-
return
|
|
15286
|
+
return applyToPoint16(transform, { x: 0, y: 0 });
|
|
15244
15287
|
}
|
|
15245
15288
|
return target._getGlobalPcbPositionBeforeLayout();
|
|
15246
15289
|
}
|
|
15247
15290
|
const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
|
|
15248
15291
|
const numericY = typeof input.y === "string" ? parseFloat(input.y) : input.y;
|
|
15249
|
-
return
|
|
15292
|
+
return applyToPoint16(transform, { x: numericX, y: numericY });
|
|
15250
15293
|
}
|
|
15251
15294
|
doInitialPcbPrimitiveRender() {
|
|
15252
15295
|
if (this.root?.pcbDisabled) return;
|
|
@@ -15426,7 +15469,7 @@ var BreakoutPoint = class extends PrimitiveComponent2 {
|
|
|
15426
15469
|
// lib/components/primitive-components/NetLabel.ts
|
|
15427
15470
|
import { netLabelProps } from "@tscircuit/props";
|
|
15428
15471
|
import {
|
|
15429
|
-
applyToPoint as
|
|
15472
|
+
applyToPoint as applyToPoint17,
|
|
15430
15473
|
identity as identity5,
|
|
15431
15474
|
translate as translate6
|
|
15432
15475
|
} from "transformation-matrix";
|
|
@@ -15477,7 +15520,7 @@ var NetLabel = class extends PrimitiveComponent2 {
|
|
|
15477
15520
|
const connectedPorts = this._getConnectedPorts();
|
|
15478
15521
|
if (connectedPorts.length > 0) {
|
|
15479
15522
|
const portPos = connectedPorts[0]._getGlobalSchematicPositionBeforeLayout();
|
|
15480
|
-
const parentCenter =
|
|
15523
|
+
const parentCenter = applyToPoint17(
|
|
15481
15524
|
this.parent?.computeSchematicGlobalTransform?.() ?? identity5(),
|
|
15482
15525
|
{ x: 0, y: 0 }
|
|
15483
15526
|
);
|
|
@@ -17322,7 +17365,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
17322
17365
|
var package_default = {
|
|
17323
17366
|
name: "@tscircuit/core",
|
|
17324
17367
|
type: "module",
|
|
17325
|
-
version: "0.0.
|
|
17368
|
+
version: "0.0.828",
|
|
17326
17369
|
types: "dist/index.d.ts",
|
|
17327
17370
|
main: "dist/index.js",
|
|
17328
17371
|
module: "dist/index.js",
|
|
@@ -17377,7 +17420,7 @@ var package_default = {
|
|
|
17377
17420
|
"bun-match-svg": "0.0.12",
|
|
17378
17421
|
"calculate-elbow": "^0.0.12",
|
|
17379
17422
|
"chokidar-cli": "^3.0.0",
|
|
17380
|
-
"circuit-json": "^0.0.
|
|
17423
|
+
"circuit-json": "^0.0.291",
|
|
17381
17424
|
"circuit-json-to-bpc": "^0.0.13",
|
|
17382
17425
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
17383
17426
|
"circuit-json-to-gltf": "^0.0.31",
|
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.829",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"bun-match-svg": "0.0.12",
|
|
57
57
|
"calculate-elbow": "^0.0.12",
|
|
58
58
|
"chokidar-cli": "^3.0.0",
|
|
59
|
-
"circuit-json": "^0.0.
|
|
59
|
+
"circuit-json": "^0.0.291",
|
|
60
60
|
"circuit-json-to-bpc": "^0.0.13",
|
|
61
61
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
62
62
|
"circuit-json-to-gltf": "^0.0.31",
|