@tscircuit/core 0.0.1182 → 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 +16 -4
- package/dist/index.js +138 -29
- package/package.json +4 -4
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';
|
|
@@ -46,6 +46,8 @@ type SimplifiedPcbTrace = {
|
|
|
46
46
|
y: number;
|
|
47
47
|
to_layer: string;
|
|
48
48
|
from_layer: string;
|
|
49
|
+
via_diameter?: number;
|
|
50
|
+
via_hole_diameter?: number;
|
|
49
51
|
} | {
|
|
50
52
|
route_type: "jumper";
|
|
51
53
|
start: {
|
|
@@ -94,6 +96,12 @@ interface SimpleRouteJson {
|
|
|
94
96
|
layerCount: number;
|
|
95
97
|
minTraceWidth: number;
|
|
96
98
|
nominalTraceWidth?: number;
|
|
99
|
+
/** @deprecated Use `min_via_pad_diameter` / `minViaPadDiameter` instead. */
|
|
100
|
+
minViaDiameter?: number;
|
|
101
|
+
minViaHoleDiameter?: number;
|
|
102
|
+
minViaPadDiameter?: number;
|
|
103
|
+
min_via_hole_diameter?: number;
|
|
104
|
+
min_via_pad_diameter?: number;
|
|
97
105
|
obstacles: Obstacle[];
|
|
98
106
|
connections: Array<SimpleRouteConnection>;
|
|
99
107
|
bounds: {
|
|
@@ -1499,6 +1507,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
1499
1507
|
* components positions before layout is applied
|
|
1500
1508
|
*/
|
|
1501
1509
|
_computePcbGlobalTransformBeforeLayout(): Matrix;
|
|
1510
|
+
private _getEnclosingFootprint;
|
|
1502
1511
|
getPrimitiveContainer(): PrimitiveComponent | null;
|
|
1503
1512
|
/**
|
|
1504
1513
|
* Get the Symbol ancestor if this component is inside a Symbol primitive container.
|
|
@@ -1951,6 +1960,9 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
|
|
|
1951
1960
|
_renderReactSubtree(element: ReactElement): ReactSubtree;
|
|
1952
1961
|
doInitialInitializePortsFromChildren(): void;
|
|
1953
1962
|
updateInitializePortsFromChildren(): void;
|
|
1963
|
+
protected getGlobalTransformRotation(): number;
|
|
1964
|
+
private _getFootprintMetadataForPcbComponent;
|
|
1965
|
+
protected _getPcbComponentInsertionDirection(componentLayer: LayerRef, rotationDegrees?: number): PcbComponent["insertion_direction"] | undefined;
|
|
1954
1966
|
doInitialReactSubtreesRender(): void;
|
|
1955
1967
|
doInitialPcbFootprintStringRender(): void;
|
|
1956
1968
|
/**
|
|
@@ -72539,13 +72551,13 @@ declare class Footprint extends PrimitiveComponent<typeof footprintProps> {
|
|
|
72539
72551
|
}>>>;
|
|
72540
72552
|
circuitJson: zod.ZodOptional<zod.ZodArray<zod.ZodAny, "many">>;
|
|
72541
72553
|
src: zod.ZodOptional<zod.ZodType<_tscircuit_props.FootprintProp, zod.ZodTypeDef, _tscircuit_props.FootprintProp>>;
|
|
72542
|
-
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"]>>;
|
|
72543
72555
|
}, "strip", zod.ZodTypeAny, {
|
|
72544
72556
|
children?: any;
|
|
72545
72557
|
circuitJson?: any[] | undefined;
|
|
72546
72558
|
originalLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
72547
72559
|
src?: _tscircuit_props.FootprintProp | undefined;
|
|
72548
|
-
insertionDirection?: "
|
|
72560
|
+
insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
|
|
72549
72561
|
}, {
|
|
72550
72562
|
children?: any;
|
|
72551
72563
|
circuitJson?: any[] | undefined;
|
|
@@ -72553,7 +72565,7 @@ declare class Footprint extends PrimitiveComponent<typeof footprintProps> {
|
|
|
72553
72565
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
72554
72566
|
} | undefined;
|
|
72555
72567
|
src?: _tscircuit_props.FootprintProp | undefined;
|
|
72556
|
-
insertionDirection?: "
|
|
72568
|
+
insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
|
|
72557
72569
|
}>;
|
|
72558
72570
|
};
|
|
72559
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,
|
|
@@ -13938,6 +14028,11 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
13938
14028
|
// subcircuit
|
|
13939
14029
|
layerCount: board?.num_layers ?? 2,
|
|
13940
14030
|
minTraceWidth,
|
|
14031
|
+
minViaDiameter: board?.min_via_pad_diameter,
|
|
14032
|
+
minViaHoleDiameter: board?.min_via_hole_diameter,
|
|
14033
|
+
minViaPadDiameter: board?.min_via_pad_diameter,
|
|
14034
|
+
min_via_hole_diameter: board?.min_via_hole_diameter,
|
|
14035
|
+
min_via_pad_diameter: board?.min_via_pad_diameter,
|
|
13941
14036
|
nominalTraceWidth,
|
|
13942
14037
|
outline: board?.outline?.map((point6) => ({ ...point6 }))
|
|
13943
14038
|
},
|
|
@@ -15116,7 +15211,7 @@ import { translate as translate6, rotate as rotate3, compose as compose6 } from
|
|
|
15116
15211
|
import {
|
|
15117
15212
|
transformPCBElements as transformPCBElements2
|
|
15118
15213
|
} from "@tscircuit/circuit-json-util";
|
|
15119
|
-
import { normalizeDegrees as
|
|
15214
|
+
import { normalizeDegrees as normalizeDegrees3 } from "@tscircuit/math-utils";
|
|
15120
15215
|
var updateCadRotation = ({
|
|
15121
15216
|
db,
|
|
15122
15217
|
pcbComponentId,
|
|
@@ -15133,7 +15228,7 @@ var updateCadRotation = ({
|
|
|
15133
15228
|
const currentRotationZ = cadComponent.rotation?.z ?? 0;
|
|
15134
15229
|
const nextRotation = {
|
|
15135
15230
|
...cadComponent.rotation ?? { x: 0, y: 0, z: 0 },
|
|
15136
|
-
z:
|
|
15231
|
+
z: normalizeDegrees3(currentRotationZ + delta)
|
|
15137
15232
|
};
|
|
15138
15233
|
db.cad_component.update(cadComponent.cad_component_id, {
|
|
15139
15234
|
rotation: nextRotation
|
|
@@ -18824,6 +18919,9 @@ var Group6 = class extends NormalComponent3 {
|
|
|
18824
18919
|
const { db } = this.root;
|
|
18825
18920
|
const pcbStyle = this.getInheritedMergedProperty("pcbStyle");
|
|
18826
18921
|
const { holeDiameter, padDiameter } = getViaDiameterDefaults(pcbStyle);
|
|
18922
|
+
const board = db.pcb_board.list()[0];
|
|
18923
|
+
const routedViaHoleDiameter = board?.min_via_hole_diameter ?? holeDiameter;
|
|
18924
|
+
const routedViaPadDiameter = board?.min_via_pad_diameter ?? padDiameter;
|
|
18827
18925
|
if (output_jumpers && output_jumpers.length > 0) {
|
|
18828
18926
|
insertAutoplacedJumpers({
|
|
18829
18927
|
db,
|
|
@@ -18859,12 +18957,13 @@ var Group6 = class extends NormalComponent3 {
|
|
|
18859
18957
|
if (pcb_trace.type === "pcb_trace") {
|
|
18860
18958
|
for (const point6 of pcb_trace.route) {
|
|
18861
18959
|
if (point6.route_type === "via") {
|
|
18960
|
+
const routedViaPoint = point6;
|
|
18862
18961
|
db.pcb_via.insert({
|
|
18863
18962
|
pcb_trace_id: pcb_trace.pcb_trace_id,
|
|
18864
18963
|
x: point6.x,
|
|
18865
18964
|
y: point6.y,
|
|
18866
|
-
hole_diameter:
|
|
18867
|
-
outer_diameter:
|
|
18965
|
+
hole_diameter: routedViaPoint.via_hole_diameter ?? routedViaPoint.hole_diameter ?? routedViaHoleDiameter,
|
|
18966
|
+
outer_diameter: routedViaPoint.via_diameter ?? routedViaPoint.outer_diameter ?? routedViaPadDiameter,
|
|
18868
18967
|
layers: [
|
|
18869
18968
|
point6.from_layer,
|
|
18870
18969
|
point6.to_layer
|
|
@@ -19911,7 +20010,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19911
20010
|
var package_default = {
|
|
19912
20011
|
name: "@tscircuit/core",
|
|
19913
20012
|
type: "module",
|
|
19914
|
-
version: "0.0.
|
|
20013
|
+
version: "0.0.1183",
|
|
19915
20014
|
types: "dist/index.d.ts",
|
|
19916
20015
|
main: "dist/index.js",
|
|
19917
20016
|
module: "dist/index.js",
|
|
@@ -19943,9 +20042,9 @@ var package_default = {
|
|
|
19943
20042
|
"@biomejs/biome": "^1.8.3",
|
|
19944
20043
|
"@resvg/resvg-js": "^2.6.2",
|
|
19945
20044
|
"@tscircuit/alphabet": "0.0.25",
|
|
19946
|
-
"@tscircuit/
|
|
20045
|
+
"@tscircuit/circuit-json-util": "^0.0.94",
|
|
20046
|
+
"@tscircuit/capacity-autorouter": "^0.0.447",
|
|
19947
20047
|
"@tscircuit/checks": "0.0.120",
|
|
19948
|
-
"@tscircuit/circuit-json-util": "^0.0.93",
|
|
19949
20048
|
"@tscircuit/common": "^0.0.20",
|
|
19950
20049
|
"@tscircuit/copper-pour-solver": "^0.0.23",
|
|
19951
20050
|
"@tscircuit/footprinter": "^0.0.351",
|
|
@@ -19957,7 +20056,7 @@ var package_default = {
|
|
|
19957
20056
|
"@tscircuit/math-utils": "^0.0.36",
|
|
19958
20057
|
"@tscircuit/miniflex": "^0.0.4",
|
|
19959
20058
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
19960
|
-
"@tscircuit/props": "^0.0.
|
|
20059
|
+
"@tscircuit/props": "^0.0.511",
|
|
19961
20060
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
19962
20061
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
19963
20062
|
"@tscircuit/solver-utils": "^0.0.3",
|
|
@@ -21970,6 +22069,7 @@ var Jumper = class extends NormalComponent3 {
|
|
|
21970
22069
|
const { db } = this.root;
|
|
21971
22070
|
const { _parsedProps: props } = this;
|
|
21972
22071
|
const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
|
|
22072
|
+
const globalTransformRotation = this.getGlobalTransformRotation();
|
|
21973
22073
|
const pcb_component = db.pcb_component.insert({
|
|
21974
22074
|
center: { x: pcbX, y: pcbY },
|
|
21975
22075
|
width: 2,
|
|
@@ -21977,7 +22077,11 @@ var Jumper = class extends NormalComponent3 {
|
|
|
21977
22077
|
height: 3,
|
|
21978
22078
|
// Default height, adjust as needed
|
|
21979
22079
|
layer: props.layer ?? "top",
|
|
21980
|
-
rotation: props.pcbRotation ??
|
|
22080
|
+
rotation: props.pcbRotation ?? globalTransformRotation,
|
|
22081
|
+
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
22082
|
+
props.layer ?? "top",
|
|
22083
|
+
globalTransformRotation
|
|
22084
|
+
),
|
|
21981
22085
|
source_component_id: this.source_component_id,
|
|
21982
22086
|
subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
|
|
21983
22087
|
do_not_place: props.doNotPlace ?? false,
|
|
@@ -22194,6 +22298,7 @@ var SolderJumper = class extends NormalComponent3 {
|
|
|
22194
22298
|
const { db } = this.root;
|
|
22195
22299
|
const { _parsedProps: props } = this;
|
|
22196
22300
|
const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
|
|
22301
|
+
const globalTransformRotation = this.getGlobalTransformRotation();
|
|
22197
22302
|
const pcb_component = db.pcb_component.insert({
|
|
22198
22303
|
center: { x: pcbX, y: pcbY },
|
|
22199
22304
|
width: 2,
|
|
@@ -22201,7 +22306,11 @@ var SolderJumper = class extends NormalComponent3 {
|
|
|
22201
22306
|
height: 3,
|
|
22202
22307
|
// Default height, adjust as needed
|
|
22203
22308
|
layer: props.layer ?? "top",
|
|
22204
|
-
rotation: props.pcbRotation ??
|
|
22309
|
+
rotation: props.pcbRotation ?? globalTransformRotation,
|
|
22310
|
+
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
22311
|
+
props.layer ?? "top",
|
|
22312
|
+
globalTransformRotation
|
|
22313
|
+
),
|
|
22205
22314
|
source_component_id: this.source_component_id,
|
|
22206
22315
|
subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
|
|
22207
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/
|
|
36
|
+
"@tscircuit/circuit-json-util": "^0.0.94",
|
|
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",
|