@tscircuit/core 0.0.1183 → 0.0.1184
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.d.ts +8 -4
- package/dist/index.js +126 -26
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as circuit_json from 'circuit-json';
|
|
2
|
-
import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, PcbTraceRoutePoint, AnySourceComponent, PcbTrace as PcbTrace$1, PcbVia, SchematicPort, SchematicComponent, RouteHintPoint, CircuitJson } from 'circuit-json';
|
|
2
|
+
import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, PcbTraceRoutePoint, AnySourceComponent, PcbComponent, PcbTrace as PcbTrace$1, PcbVia, SchematicPort, SchematicComponent, RouteHintPoint, CircuitJson } from 'circuit-json';
|
|
3
3
|
import * as _tscircuit_props from '@tscircuit/props';
|
|
4
4
|
import { PlatformConfig, traceProps, netProps, subcircuitGroupProps, AutorouterConfig, PcbSx, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
5
5
|
export { kicadFootprintStrings } from '@tscircuit/props';
|
|
@@ -1507,6 +1507,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
1507
1507
|
* components positions before layout is applied
|
|
1508
1508
|
*/
|
|
1509
1509
|
_computePcbGlobalTransformBeforeLayout(): Matrix;
|
|
1510
|
+
private _getEnclosingFootprint;
|
|
1510
1511
|
getPrimitiveContainer(): PrimitiveComponent | null;
|
|
1511
1512
|
/**
|
|
1512
1513
|
* Get the Symbol ancestor if this component is inside a Symbol primitive container.
|
|
@@ -1959,6 +1960,9 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
|
|
|
1959
1960
|
_renderReactSubtree(element: ReactElement): ReactSubtree;
|
|
1960
1961
|
doInitialInitializePortsFromChildren(): void;
|
|
1961
1962
|
updateInitializePortsFromChildren(): void;
|
|
1963
|
+
protected getGlobalTransformRotation(): number;
|
|
1964
|
+
private _getFootprintMetadataForPcbComponent;
|
|
1965
|
+
protected _getPcbComponentInsertionDirection(componentLayer: LayerRef, rotationDegrees?: number): PcbComponent["insertion_direction"] | undefined;
|
|
1962
1966
|
doInitialReactSubtreesRender(): void;
|
|
1963
1967
|
doInitialPcbFootprintStringRender(): void;
|
|
1964
1968
|
/**
|
|
@@ -72547,13 +72551,13 @@ declare class Footprint extends PrimitiveComponent<typeof footprintProps> {
|
|
|
72547
72551
|
}>>>;
|
|
72548
72552
|
circuitJson: zod.ZodOptional<zod.ZodArray<zod.ZodAny, "many">>;
|
|
72549
72553
|
src: zod.ZodOptional<zod.ZodType<_tscircuit_props.FootprintProp, zod.ZodTypeDef, _tscircuit_props.FootprintProp>>;
|
|
72550
|
-
insertionDirection: zod.ZodOptional<zod.ZodEnum<["from_above", "from_left", "from_right", "from_front", "from_back"
|
|
72554
|
+
insertionDirection: zod.ZodOptional<zod.ZodEnum<["from_above", "from_left", "from_right", "from_front", "from_back"]>>;
|
|
72551
72555
|
}, "strip", zod.ZodTypeAny, {
|
|
72552
72556
|
children?: any;
|
|
72553
72557
|
circuitJson?: any[] | undefined;
|
|
72554
72558
|
originalLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
72555
72559
|
src?: _tscircuit_props.FootprintProp | undefined;
|
|
72556
|
-
insertionDirection?: "
|
|
72560
|
+
insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
|
|
72557
72561
|
}, {
|
|
72558
72562
|
children?: any;
|
|
72559
72563
|
circuitJson?: any[] | undefined;
|
|
@@ -72561,7 +72565,7 @@ declare class Footprint extends PrimitiveComponent<typeof footprintProps> {
|
|
|
72561
72565
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
72562
72566
|
} | undefined;
|
|
72563
72567
|
src?: _tscircuit_props.FootprintProp | undefined;
|
|
72564
|
-
insertionDirection?: "
|
|
72568
|
+
insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
|
|
72565
72569
|
}>;
|
|
72566
72570
|
};
|
|
72567
72571
|
/**
|
package/dist/index.js
CHANGED
|
@@ -97,7 +97,7 @@ __export(components_exports, {
|
|
|
97
97
|
|
|
98
98
|
// lib/components/base-components/NormalComponent/NormalComponent.ts
|
|
99
99
|
import { fp } from "@tscircuit/footprinter";
|
|
100
|
-
import { normalizeDegrees } from "@tscircuit/math-utils";
|
|
100
|
+
import { normalizeDegrees as normalizeDegrees2 } from "@tscircuit/math-utils";
|
|
101
101
|
import {
|
|
102
102
|
distance as distance8,
|
|
103
103
|
pcb_component_invalid_layer_error,
|
|
@@ -914,6 +914,35 @@ function getSubcircuitPcbCalcVariables(db) {
|
|
|
914
914
|
return vars;
|
|
915
915
|
}
|
|
916
916
|
|
|
917
|
+
// lib/utils/pcb/transform-footprint-insertion-direction.ts
|
|
918
|
+
import { normalizeDegrees } from "@tscircuit/math-utils";
|
|
919
|
+
var directionToVector = {
|
|
920
|
+
from_left: { x: -1, y: 0 },
|
|
921
|
+
from_right: { x: 1, y: 0 },
|
|
922
|
+
from_front: { x: 0, y: 1 },
|
|
923
|
+
from_back: { x: 0, y: -1 }
|
|
924
|
+
};
|
|
925
|
+
var isFootprintFlipped = (params) => {
|
|
926
|
+
const { componentLayer, originalLayer } = params;
|
|
927
|
+
return componentLayer === "bottom" !== (originalLayer === "bottom");
|
|
928
|
+
};
|
|
929
|
+
var transformFootprintInsertionDirection = (params) => {
|
|
930
|
+
const { insertionDirection, rotationDegrees = 0, isFlipped = false } = params;
|
|
931
|
+
if (!insertionDirection) return void 0;
|
|
932
|
+
if (insertionDirection === "from_above") return insertionDirection;
|
|
933
|
+
const baseVector = directionToVector[insertionDirection];
|
|
934
|
+
const angleRadians = normalizeDegrees(rotationDegrees) * Math.PI / 180;
|
|
935
|
+
const rotatedVector = {
|
|
936
|
+
x: baseVector.x * Math.cos(angleRadians) - baseVector.y * Math.sin(angleRadians),
|
|
937
|
+
y: baseVector.x * Math.sin(angleRadians) + baseVector.y * Math.cos(angleRadians)
|
|
938
|
+
};
|
|
939
|
+
const finalVector = isFlipped ? { x: rotatedVector.x, y: -rotatedVector.y } : rotatedVector;
|
|
940
|
+
if (Math.abs(finalVector.x) >= Math.abs(finalVector.y)) {
|
|
941
|
+
return finalVector.x >= 0 ? "from_right" : "from_left";
|
|
942
|
+
}
|
|
943
|
+
return finalVector.y >= 0 ? "from_front" : "from_back";
|
|
944
|
+
};
|
|
945
|
+
|
|
917
946
|
// lib/utils/pcbSx/convert-pcb-style-to-pcb-sx.ts
|
|
918
947
|
function convertPcbStyleToPcbSx(pcbStyle) {
|
|
919
948
|
if (!pcbStyle) return void 0;
|
|
@@ -1496,16 +1525,13 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1496
1525
|
);
|
|
1497
1526
|
}
|
|
1498
1527
|
if (this.isPcbPrimitive) {
|
|
1499
|
-
const
|
|
1500
|
-
if (
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
this.computePcbPropsTransform()
|
|
1507
|
-
);
|
|
1508
|
-
}
|
|
1528
|
+
const { isFlipped } = this._getPcbPrimitiveFlippedHelpers();
|
|
1529
|
+
if (isFlipped) {
|
|
1530
|
+
return compose(
|
|
1531
|
+
this.parent?._computePcbGlobalTransformBeforeLayout() ?? identity(),
|
|
1532
|
+
flipY(),
|
|
1533
|
+
this.computePcbPropsTransform()
|
|
1534
|
+
);
|
|
1509
1535
|
}
|
|
1510
1536
|
}
|
|
1511
1537
|
return compose(
|
|
@@ -1513,6 +1539,16 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1513
1539
|
this.computePcbPropsTransform()
|
|
1514
1540
|
);
|
|
1515
1541
|
}
|
|
1542
|
+
_getEnclosingFootprint() {
|
|
1543
|
+
let current = this.parent;
|
|
1544
|
+
while (current) {
|
|
1545
|
+
if (current.componentName === "Footprint") {
|
|
1546
|
+
return current;
|
|
1547
|
+
}
|
|
1548
|
+
current = current.parent;
|
|
1549
|
+
}
|
|
1550
|
+
return null;
|
|
1551
|
+
}
|
|
1516
1552
|
getPrimitiveContainer() {
|
|
1517
1553
|
if (this.isPrimitiveContainer) return this;
|
|
1518
1554
|
return this.parent?.getPrimitiveContainer?.() ?? null;
|
|
@@ -1597,7 +1633,11 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1597
1633
|
*/
|
|
1598
1634
|
_getPcbPrimitiveFlippedHelpers() {
|
|
1599
1635
|
const container = this.getPrimitiveContainer();
|
|
1600
|
-
const
|
|
1636
|
+
const footprint = this.componentName === "Footprint" ? this : this._getEnclosingFootprint();
|
|
1637
|
+
const isFlipped = !container ? false : isFootprintFlipped({
|
|
1638
|
+
componentLayer: container._parsedProps.layer,
|
|
1639
|
+
originalLayer: footprint?._parsedProps.originalLayer
|
|
1640
|
+
});
|
|
1601
1641
|
const maybeFlipLayer = (layer) => {
|
|
1602
1642
|
if (isFlipped) {
|
|
1603
1643
|
return layer === "top" ? "bottom" : "top";
|
|
@@ -11422,16 +11462,18 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
11422
11462
|
});
|
|
11423
11463
|
db.pcb_component_invalid_layer_error.insert(error);
|
|
11424
11464
|
}
|
|
11425
|
-
const
|
|
11426
|
-
const decomposedTransform = decomposeTSR8(globalTransform);
|
|
11427
|
-
const accumulatedRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
11465
|
+
const globalTransformRotation = this.getGlobalTransformRotation();
|
|
11428
11466
|
const pcb_component = db.pcb_component.insert({
|
|
11429
11467
|
center: this._getGlobalPcbPositionBeforeLayout(),
|
|
11430
11468
|
// width/height are computed in the PcbComponentSizeCalculation phase
|
|
11431
11469
|
width: 0,
|
|
11432
11470
|
height: 0,
|
|
11433
11471
|
layer: componentLayer === "top" || componentLayer === "bottom" ? componentLayer : "top",
|
|
11434
|
-
rotation: props.pcbRotation ??
|
|
11472
|
+
rotation: props.pcbRotation ?? globalTransformRotation,
|
|
11473
|
+
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
11474
|
+
componentLayer,
|
|
11475
|
+
globalTransformRotation
|
|
11476
|
+
),
|
|
11435
11477
|
source_component_id: this.source_component_id,
|
|
11436
11478
|
subcircuit_id: subcircuit.subcircuit_id ?? void 0,
|
|
11437
11479
|
do_not_place: props.doNotPlace ?? false,
|
|
@@ -11578,6 +11620,49 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
11578
11620
|
updateInitializePortsFromChildren() {
|
|
11579
11621
|
this.initPorts();
|
|
11580
11622
|
}
|
|
11623
|
+
getGlobalTransformRotation() {
|
|
11624
|
+
const globalTransform = this._computePcbGlobalTransformBeforeLayout();
|
|
11625
|
+
const decomposedTransform = decomposeTSR8(globalTransform);
|
|
11626
|
+
return decomposedTransform.rotation.angle * 180 / Math.PI;
|
|
11627
|
+
}
|
|
11628
|
+
_getFootprintMetadataForPcbComponent() {
|
|
11629
|
+
const footprintChild = this.children.find(
|
|
11630
|
+
(c) => c.componentName === "Footprint"
|
|
11631
|
+
);
|
|
11632
|
+
if (footprintChild) {
|
|
11633
|
+
return {
|
|
11634
|
+
insertionDirection: footprintChild._parsedProps.insertionDirection,
|
|
11635
|
+
originalLayer: footprintChild._parsedProps.originalLayer
|
|
11636
|
+
};
|
|
11637
|
+
}
|
|
11638
|
+
const footprint = this.props.footprint;
|
|
11639
|
+
if (isValidElement(footprint)) {
|
|
11640
|
+
const footprintProps2 = footprint.props;
|
|
11641
|
+
return {
|
|
11642
|
+
insertionDirection: footprintProps2.insertionDirection,
|
|
11643
|
+
originalLayer: footprintProps2.originalLayer
|
|
11644
|
+
};
|
|
11645
|
+
}
|
|
11646
|
+
if (footprint?.componentName === "Footprint") {
|
|
11647
|
+
return {
|
|
11648
|
+
insertionDirection: footprint._parsedProps?.insertionDirection ?? footprint.props?.insertionDirection,
|
|
11649
|
+
originalLayer: footprint._parsedProps?.originalLayer ?? footprint.props?.originalLayer
|
|
11650
|
+
};
|
|
11651
|
+
}
|
|
11652
|
+
return void 0;
|
|
11653
|
+
}
|
|
11654
|
+
_getPcbComponentInsertionDirection(componentLayer, rotationDegrees = this.getGlobalTransformRotation()) {
|
|
11655
|
+
const footprintMetadata = this._getFootprintMetadataForPcbComponent();
|
|
11656
|
+
if (!footprintMetadata?.insertionDirection) return void 0;
|
|
11657
|
+
return transformFootprintInsertionDirection({
|
|
11658
|
+
insertionDirection: footprintMetadata.insertionDirection,
|
|
11659
|
+
rotationDegrees,
|
|
11660
|
+
isFlipped: isFootprintFlipped({
|
|
11661
|
+
componentLayer,
|
|
11662
|
+
originalLayer: footprintMetadata.originalLayer
|
|
11663
|
+
})
|
|
11664
|
+
});
|
|
11665
|
+
}
|
|
11581
11666
|
doInitialReactSubtreesRender() {
|
|
11582
11667
|
const fpElm = this.props.footprint;
|
|
11583
11668
|
if (isValidElement(fpElm)) {
|
|
@@ -11945,7 +12030,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
11945
12030
|
const totalRotation = pcbComponent?.position_mode === "packed" ? pcbComponent.rotation ?? preLayoutRotation : preLayoutRotation;
|
|
11946
12031
|
const isBottomLayer = computedLayer === "bottom";
|
|
11947
12032
|
const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0);
|
|
11948
|
-
const cadRotationZ =
|
|
12033
|
+
const cadRotationZ = normalizeDegrees2(rotationWithOffset);
|
|
11949
12034
|
const cad_model = db.cad_component.insert({
|
|
11950
12035
|
// TODO z maybe depends on layer
|
|
11951
12036
|
position: {
|
|
@@ -11956,7 +12041,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
11956
12041
|
rotation: {
|
|
11957
12042
|
x: rotationOffset.x,
|
|
11958
12043
|
y: rotationOffset.y + (isBottomLayer ? 180 : 0),
|
|
11959
|
-
z:
|
|
12044
|
+
z: normalizeDegrees2(isBottomLayer ? -cadRotationZ : cadRotationZ)
|
|
11960
12045
|
},
|
|
11961
12046
|
pcb_component_id: this.pcb_component_id,
|
|
11962
12047
|
source_component_id: this.source_component_id,
|
|
@@ -12638,6 +12723,7 @@ var Chip = class extends NormalComponent3 {
|
|
|
12638
12723
|
});
|
|
12639
12724
|
db.pcb_component_invalid_layer_error.insert(error);
|
|
12640
12725
|
}
|
|
12726
|
+
const globalTransformRotation = this.getGlobalTransformRotation();
|
|
12641
12727
|
const pcb_component = db.pcb_component.insert({
|
|
12642
12728
|
center: { x: pcbX, y: pcbY },
|
|
12643
12729
|
width: 2,
|
|
@@ -12645,7 +12731,11 @@ var Chip = class extends NormalComponent3 {
|
|
|
12645
12731
|
height: 3,
|
|
12646
12732
|
// Default height, adjust as needed
|
|
12647
12733
|
layer: componentLayer === "top" || componentLayer === "bottom" ? componentLayer : "top",
|
|
12648
|
-
rotation: props.pcbRotation ??
|
|
12734
|
+
rotation: props.pcbRotation ?? globalTransformRotation,
|
|
12735
|
+
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
12736
|
+
componentLayer,
|
|
12737
|
+
globalTransformRotation
|
|
12738
|
+
),
|
|
12649
12739
|
source_component_id: this.source_component_id,
|
|
12650
12740
|
subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
|
|
12651
12741
|
do_not_place: props.doNotPlace ?? false,
|
|
@@ -15121,7 +15211,7 @@ import { translate as translate6, rotate as rotate3, compose as compose6 } from
|
|
|
15121
15211
|
import {
|
|
15122
15212
|
transformPCBElements as transformPCBElements2
|
|
15123
15213
|
} from "@tscircuit/circuit-json-util";
|
|
15124
|
-
import { normalizeDegrees as
|
|
15214
|
+
import { normalizeDegrees as normalizeDegrees3 } from "@tscircuit/math-utils";
|
|
15125
15215
|
var updateCadRotation = ({
|
|
15126
15216
|
db,
|
|
15127
15217
|
pcbComponentId,
|
|
@@ -15138,7 +15228,7 @@ var updateCadRotation = ({
|
|
|
15138
15228
|
const currentRotationZ = cadComponent.rotation?.z ?? 0;
|
|
15139
15229
|
const nextRotation = {
|
|
15140
15230
|
...cadComponent.rotation ?? { x: 0, y: 0, z: 0 },
|
|
15141
|
-
z:
|
|
15231
|
+
z: normalizeDegrees3(currentRotationZ + delta)
|
|
15142
15232
|
};
|
|
15143
15233
|
db.cad_component.update(cadComponent.cad_component_id, {
|
|
15144
15234
|
rotation: nextRotation
|
|
@@ -19920,7 +20010,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19920
20010
|
var package_default = {
|
|
19921
20011
|
name: "@tscircuit/core",
|
|
19922
20012
|
type: "module",
|
|
19923
|
-
version: "0.0.
|
|
20013
|
+
version: "0.0.1183",
|
|
19924
20014
|
types: "dist/index.d.ts",
|
|
19925
20015
|
main: "dist/index.js",
|
|
19926
20016
|
module: "dist/index.js",
|
|
@@ -19952,9 +20042,9 @@ var package_default = {
|
|
|
19952
20042
|
"@biomejs/biome": "^1.8.3",
|
|
19953
20043
|
"@resvg/resvg-js": "^2.6.2",
|
|
19954
20044
|
"@tscircuit/alphabet": "0.0.25",
|
|
20045
|
+
"@tscircuit/circuit-json-util": "^0.0.94",
|
|
19955
20046
|
"@tscircuit/capacity-autorouter": "^0.0.447",
|
|
19956
20047
|
"@tscircuit/checks": "0.0.120",
|
|
19957
|
-
"@tscircuit/circuit-json-util": "^0.0.93",
|
|
19958
20048
|
"@tscircuit/common": "^0.0.20",
|
|
19959
20049
|
"@tscircuit/copper-pour-solver": "^0.0.23",
|
|
19960
20050
|
"@tscircuit/footprinter": "^0.0.351",
|
|
@@ -19966,7 +20056,7 @@ var package_default = {
|
|
|
19966
20056
|
"@tscircuit/math-utils": "^0.0.36",
|
|
19967
20057
|
"@tscircuit/miniflex": "^0.0.4",
|
|
19968
20058
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
19969
|
-
"@tscircuit/props": "^0.0.
|
|
20059
|
+
"@tscircuit/props": "^0.0.511",
|
|
19970
20060
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
19971
20061
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
19972
20062
|
"@tscircuit/solver-utils": "^0.0.3",
|
|
@@ -21979,6 +22069,7 @@ var Jumper = class extends NormalComponent3 {
|
|
|
21979
22069
|
const { db } = this.root;
|
|
21980
22070
|
const { _parsedProps: props } = this;
|
|
21981
22071
|
const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
|
|
22072
|
+
const globalTransformRotation = this.getGlobalTransformRotation();
|
|
21982
22073
|
const pcb_component = db.pcb_component.insert({
|
|
21983
22074
|
center: { x: pcbX, y: pcbY },
|
|
21984
22075
|
width: 2,
|
|
@@ -21986,7 +22077,11 @@ var Jumper = class extends NormalComponent3 {
|
|
|
21986
22077
|
height: 3,
|
|
21987
22078
|
// Default height, adjust as needed
|
|
21988
22079
|
layer: props.layer ?? "top",
|
|
21989
|
-
rotation: props.pcbRotation ??
|
|
22080
|
+
rotation: props.pcbRotation ?? globalTransformRotation,
|
|
22081
|
+
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
22082
|
+
props.layer ?? "top",
|
|
22083
|
+
globalTransformRotation
|
|
22084
|
+
),
|
|
21990
22085
|
source_component_id: this.source_component_id,
|
|
21991
22086
|
subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
|
|
21992
22087
|
do_not_place: props.doNotPlace ?? false,
|
|
@@ -22203,6 +22298,7 @@ var SolderJumper = class extends NormalComponent3 {
|
|
|
22203
22298
|
const { db } = this.root;
|
|
22204
22299
|
const { _parsedProps: props } = this;
|
|
22205
22300
|
const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
|
|
22301
|
+
const globalTransformRotation = this.getGlobalTransformRotation();
|
|
22206
22302
|
const pcb_component = db.pcb_component.insert({
|
|
22207
22303
|
center: { x: pcbX, y: pcbY },
|
|
22208
22304
|
width: 2,
|
|
@@ -22210,7 +22306,11 @@ var SolderJumper = class extends NormalComponent3 {
|
|
|
22210
22306
|
height: 3,
|
|
22211
22307
|
// Default height, adjust as needed
|
|
22212
22308
|
layer: props.layer ?? "top",
|
|
22213
|
-
rotation: props.pcbRotation ??
|
|
22309
|
+
rotation: props.pcbRotation ?? globalTransformRotation,
|
|
22310
|
+
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
22311
|
+
props.layer ?? "top",
|
|
22312
|
+
globalTransformRotation
|
|
22313
|
+
),
|
|
22214
22314
|
source_component_id: this.source_component_id,
|
|
22215
22315
|
subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
|
|
22216
22316
|
do_not_place: props.doNotPlace ?? false,
|
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.1184",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@biomejs/biome": "^1.8.3",
|
|
34
34
|
"@resvg/resvg-js": "^2.6.2",
|
|
35
35
|
"@tscircuit/alphabet": "0.0.25",
|
|
36
|
+
"@tscircuit/circuit-json-util": "^0.0.94",
|
|
36
37
|
"@tscircuit/capacity-autorouter": "^0.0.447",
|
|
37
38
|
"@tscircuit/checks": "0.0.120",
|
|
38
|
-
"@tscircuit/circuit-json-util": "^0.0.93",
|
|
39
39
|
"@tscircuit/common": "^0.0.20",
|
|
40
40
|
"@tscircuit/copper-pour-solver": "^0.0.23",
|
|
41
41
|
"@tscircuit/footprinter": "^0.0.351",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@tscircuit/math-utils": "^0.0.36",
|
|
48
48
|
"@tscircuit/miniflex": "^0.0.4",
|
|
49
49
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
50
|
-
"@tscircuit/props": "^0.0.
|
|
50
|
+
"@tscircuit/props": "^0.0.511",
|
|
51
51
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
52
52
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
53
53
|
"@tscircuit/solver-utils": "^0.0.3",
|