@tscircuit/core 0.0.1183 → 0.0.1185

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 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", "x+", "x-", "y+", "y-"]>>;
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?: "x+" | "x-" | "y+" | "y-" | "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
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?: "x+" | "x-" | "y+" | "y-" | "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
72568
+ insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
72565
72569
  }>;
72566
72570
  };
72567
72571
  /**
@@ -74587,6 +74591,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
74587
74591
  holeHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
74588
74592
  rectPadWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
74589
74593
  rectPadHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
74594
+ rectBorderRadius: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
74590
74595
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
74591
74596
  holeOffsetX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
74592
74597
  holeOffsetY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -74636,6 +74641,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
74636
74641
  coveredWithSolderMask?: boolean | undefined;
74637
74642
  holeOffsetX?: number | undefined;
74638
74643
  holeOffsetY?: number | undefined;
74644
+ rectBorderRadius?: number | undefined;
74639
74645
  holeShape?: "pill" | undefined;
74640
74646
  padShape?: "rect" | undefined;
74641
74647
  }, {
@@ -74682,6 +74688,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
74682
74688
  coveredWithSolderMask?: boolean | undefined;
74683
74689
  holeOffsetX?: string | number | undefined;
74684
74690
  holeOffsetY?: string | number | undefined;
74691
+ rectBorderRadius?: string | number | undefined;
74685
74692
  holeShape?: "pill" | undefined;
74686
74693
  padShape?: "rect" | undefined;
74687
74694
  }>, zod.ZodObject<Omit<{
@@ -75087,6 +75094,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
75087
75094
  coveredWithSolderMask?: boolean | undefined;
75088
75095
  holeOffsetX?: number | undefined;
75089
75096
  holeOffsetY?: number | undefined;
75097
+ rectBorderRadius?: number | undefined;
75090
75098
  holeShape?: "pill" | undefined;
75091
75099
  padShape?: "rect" | undefined;
75092
75100
  } | {
@@ -75357,6 +75365,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
75357
75365
  coveredWithSolderMask?: boolean | undefined;
75358
75366
  holeOffsetX?: string | number | undefined;
75359
75367
  holeOffsetY?: string | number | undefined;
75368
+ rectBorderRadius?: string | number | undefined;
75360
75369
  holeShape?: "pill" | undefined;
75361
75370
  padShape?: "rect" | undefined;
75362
75371
  } | {
@@ -75627,6 +75636,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
75627
75636
  coveredWithSolderMask?: boolean | undefined;
75628
75637
  holeOffsetX?: number | undefined;
75629
75638
  holeOffsetY?: number | undefined;
75639
+ rectBorderRadius?: number | undefined;
75630
75640
  holeShape?: "pill" | undefined;
75631
75641
  padShape?: "rect" | undefined;
75632
75642
  } | {
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 primitiveContainer = this.getPrimitiveContainer();
1500
- if (primitiveContainer) {
1501
- const isFlipped = primitiveContainer._parsedProps.layer === "bottom";
1502
- if (isFlipped) {
1503
- return compose(
1504
- this.parent?._computePcbGlobalTransformBeforeLayout() ?? identity(),
1505
- flipY(),
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 isFlipped = !container ? false : container._parsedProps.layer === "bottom";
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";
@@ -7108,6 +7148,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7108
7148
  pad_shape: "rect",
7109
7149
  hole_ccw_rotation: props.pcbRotation,
7110
7150
  rect_ccw_rotation: props.pcbRotation,
7151
+ rect_border_radius: props.rectBorderRadius,
7111
7152
  port_hints: this.getNameAndAliases(),
7112
7153
  x: position.x,
7113
7154
  y: position.y,
@@ -7129,6 +7170,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7129
7170
  hole_offset_x: props.holeOffsetX,
7130
7171
  hole_offset_y: props.holeOffsetY,
7131
7172
  shape: "pill_hole_with_rect_pad",
7173
+ rect_border_radius: props.rectBorderRadius,
7132
7174
  port_hints: this.getNameAndAliases(),
7133
7175
  x: position.x,
7134
7176
  y: position.y,
@@ -8222,6 +8264,7 @@ var createComponentsFromCircuitJson = ({
8222
8264
  holeHeight: elm.hole_height,
8223
8265
  rectPadWidth: elm.rect_pad_width,
8224
8266
  rectPadHeight: elm.rect_pad_height,
8267
+ rectBorderRadius: elm.rect_border_radius,
8225
8268
  portHints: elm.port_hints,
8226
8269
  holeOffsetX: elm.hole_offset_x,
8227
8270
  holeOffsetY: elm.hole_offset_y
@@ -8239,6 +8282,7 @@ var createComponentsFromCircuitJson = ({
8239
8282
  holeHeight: elm.hole_height,
8240
8283
  rectPadWidth: elm.rect_pad_width,
8241
8284
  rectPadHeight: elm.rect_pad_height,
8285
+ rectBorderRadius: elm.rect_border_radius,
8242
8286
  portHints: elm.port_hints,
8243
8287
  holeOffsetX: elm.hole_offset_x,
8244
8288
  holeOffsetY: elm.hole_offset_y,
@@ -11422,16 +11466,18 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
11422
11466
  });
11423
11467
  db.pcb_component_invalid_layer_error.insert(error);
11424
11468
  }
11425
- const globalTransform = this._computePcbGlobalTransformBeforeLayout();
11426
- const decomposedTransform = decomposeTSR8(globalTransform);
11427
- const accumulatedRotation = decomposedTransform.rotation.angle * 180 / Math.PI;
11469
+ const globalTransformRotation = this.getGlobalTransformRotation();
11428
11470
  const pcb_component = db.pcb_component.insert({
11429
11471
  center: this._getGlobalPcbPositionBeforeLayout(),
11430
11472
  // width/height are computed in the PcbComponentSizeCalculation phase
11431
11473
  width: 0,
11432
11474
  height: 0,
11433
11475
  layer: componentLayer === "top" || componentLayer === "bottom" ? componentLayer : "top",
11434
- rotation: props.pcbRotation ?? accumulatedRotation,
11476
+ rotation: props.pcbRotation ?? globalTransformRotation,
11477
+ insertion_direction: this._getPcbComponentInsertionDirection(
11478
+ componentLayer,
11479
+ globalTransformRotation
11480
+ ),
11435
11481
  source_component_id: this.source_component_id,
11436
11482
  subcircuit_id: subcircuit.subcircuit_id ?? void 0,
11437
11483
  do_not_place: props.doNotPlace ?? false,
@@ -11578,6 +11624,49 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
11578
11624
  updateInitializePortsFromChildren() {
11579
11625
  this.initPorts();
11580
11626
  }
11627
+ getGlobalTransformRotation() {
11628
+ const globalTransform = this._computePcbGlobalTransformBeforeLayout();
11629
+ const decomposedTransform = decomposeTSR8(globalTransform);
11630
+ return decomposedTransform.rotation.angle * 180 / Math.PI;
11631
+ }
11632
+ _getFootprintMetadataForPcbComponent() {
11633
+ const footprintChild = this.children.find(
11634
+ (c) => c.componentName === "Footprint"
11635
+ );
11636
+ if (footprintChild) {
11637
+ return {
11638
+ insertionDirection: footprintChild._parsedProps.insertionDirection,
11639
+ originalLayer: footprintChild._parsedProps.originalLayer
11640
+ };
11641
+ }
11642
+ const footprint = this.props.footprint;
11643
+ if (isValidElement(footprint)) {
11644
+ const footprintProps2 = footprint.props;
11645
+ return {
11646
+ insertionDirection: footprintProps2.insertionDirection,
11647
+ originalLayer: footprintProps2.originalLayer
11648
+ };
11649
+ }
11650
+ if (footprint?.componentName === "Footprint") {
11651
+ return {
11652
+ insertionDirection: footprint._parsedProps?.insertionDirection ?? footprint.props?.insertionDirection,
11653
+ originalLayer: footprint._parsedProps?.originalLayer ?? footprint.props?.originalLayer
11654
+ };
11655
+ }
11656
+ return void 0;
11657
+ }
11658
+ _getPcbComponentInsertionDirection(componentLayer, rotationDegrees = this.getGlobalTransformRotation()) {
11659
+ const footprintMetadata = this._getFootprintMetadataForPcbComponent();
11660
+ if (!footprintMetadata?.insertionDirection) return void 0;
11661
+ return transformFootprintInsertionDirection({
11662
+ insertionDirection: footprintMetadata.insertionDirection,
11663
+ rotationDegrees,
11664
+ isFlipped: isFootprintFlipped({
11665
+ componentLayer,
11666
+ originalLayer: footprintMetadata.originalLayer
11667
+ })
11668
+ });
11669
+ }
11581
11670
  doInitialReactSubtreesRender() {
11582
11671
  const fpElm = this.props.footprint;
11583
11672
  if (isValidElement(fpElm)) {
@@ -11945,7 +12034,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
11945
12034
  const totalRotation = pcbComponent?.position_mode === "packed" ? pcbComponent.rotation ?? preLayoutRotation : preLayoutRotation;
11946
12035
  const isBottomLayer = computedLayer === "bottom";
11947
12036
  const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0);
11948
- const cadRotationZ = normalizeDegrees(rotationWithOffset);
12037
+ const cadRotationZ = normalizeDegrees2(rotationWithOffset);
11949
12038
  const cad_model = db.cad_component.insert({
11950
12039
  // TODO z maybe depends on layer
11951
12040
  position: {
@@ -11956,7 +12045,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
11956
12045
  rotation: {
11957
12046
  x: rotationOffset.x,
11958
12047
  y: rotationOffset.y + (isBottomLayer ? 180 : 0),
11959
- z: normalizeDegrees(isBottomLayer ? -cadRotationZ : cadRotationZ)
12048
+ z: normalizeDegrees2(isBottomLayer ? -cadRotationZ : cadRotationZ)
11960
12049
  },
11961
12050
  pcb_component_id: this.pcb_component_id,
11962
12051
  source_component_id: this.source_component_id,
@@ -12638,6 +12727,7 @@ var Chip = class extends NormalComponent3 {
12638
12727
  });
12639
12728
  db.pcb_component_invalid_layer_error.insert(error);
12640
12729
  }
12730
+ const globalTransformRotation = this.getGlobalTransformRotation();
12641
12731
  const pcb_component = db.pcb_component.insert({
12642
12732
  center: { x: pcbX, y: pcbY },
12643
12733
  width: 2,
@@ -12645,7 +12735,11 @@ var Chip = class extends NormalComponent3 {
12645
12735
  height: 3,
12646
12736
  // Default height, adjust as needed
12647
12737
  layer: componentLayer === "top" || componentLayer === "bottom" ? componentLayer : "top",
12648
- rotation: props.pcbRotation ?? 0,
12738
+ rotation: props.pcbRotation ?? globalTransformRotation,
12739
+ insertion_direction: this._getPcbComponentInsertionDirection(
12740
+ componentLayer,
12741
+ globalTransformRotation
12742
+ ),
12649
12743
  source_component_id: this.source_component_id,
12650
12744
  subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
12651
12745
  do_not_place: props.doNotPlace ?? false,
@@ -15121,7 +15215,7 @@ import { translate as translate6, rotate as rotate3, compose as compose6 } from
15121
15215
  import {
15122
15216
  transformPCBElements as transformPCBElements2
15123
15217
  } from "@tscircuit/circuit-json-util";
15124
- import { normalizeDegrees as normalizeDegrees2 } from "@tscircuit/math-utils";
15218
+ import { normalizeDegrees as normalizeDegrees3 } from "@tscircuit/math-utils";
15125
15219
  var updateCadRotation = ({
15126
15220
  db,
15127
15221
  pcbComponentId,
@@ -15138,7 +15232,7 @@ var updateCadRotation = ({
15138
15232
  const currentRotationZ = cadComponent.rotation?.z ?? 0;
15139
15233
  const nextRotation = {
15140
15234
  ...cadComponent.rotation ?? { x: 0, y: 0, z: 0 },
15141
- z: normalizeDegrees2(currentRotationZ + delta)
15235
+ z: normalizeDegrees3(currentRotationZ + delta)
15142
15236
  };
15143
15237
  db.cad_component.update(cadComponent.cad_component_id, {
15144
15238
  rotation: nextRotation
@@ -19920,7 +20014,7 @@ import { identity as identity5 } from "transformation-matrix";
19920
20014
  var package_default = {
19921
20015
  name: "@tscircuit/core",
19922
20016
  type: "module",
19923
- version: "0.0.1182",
20017
+ version: "0.0.1184",
19924
20018
  types: "dist/index.d.ts",
19925
20019
  main: "dist/index.js",
19926
20020
  module: "dist/index.js",
@@ -19952,9 +20046,9 @@ var package_default = {
19952
20046
  "@biomejs/biome": "^1.8.3",
19953
20047
  "@resvg/resvg-js": "^2.6.2",
19954
20048
  "@tscircuit/alphabet": "0.0.25",
20049
+ "@tscircuit/circuit-json-util": "^0.0.94",
19955
20050
  "@tscircuit/capacity-autorouter": "^0.0.447",
19956
20051
  "@tscircuit/checks": "0.0.120",
19957
- "@tscircuit/circuit-json-util": "^0.0.93",
19958
20052
  "@tscircuit/common": "^0.0.20",
19959
20053
  "@tscircuit/copper-pour-solver": "^0.0.23",
19960
20054
  "@tscircuit/footprinter": "^0.0.351",
@@ -19966,7 +20060,7 @@ var package_default = {
19966
20060
  "@tscircuit/math-utils": "^0.0.36",
19967
20061
  "@tscircuit/miniflex": "^0.0.4",
19968
20062
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
19969
- "@tscircuit/props": "^0.0.510",
20063
+ "@tscircuit/props": "^0.0.512",
19970
20064
  "@tscircuit/schematic-match-adapt": "^0.0.16",
19971
20065
  "@tscircuit/schematic-trace-solver": "^v0.0.45",
19972
20066
  "@tscircuit/solver-utils": "^0.0.3",
@@ -21979,6 +22073,7 @@ var Jumper = class extends NormalComponent3 {
21979
22073
  const { db } = this.root;
21980
22074
  const { _parsedProps: props } = this;
21981
22075
  const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
22076
+ const globalTransformRotation = this.getGlobalTransformRotation();
21982
22077
  const pcb_component = db.pcb_component.insert({
21983
22078
  center: { x: pcbX, y: pcbY },
21984
22079
  width: 2,
@@ -21986,7 +22081,11 @@ var Jumper = class extends NormalComponent3 {
21986
22081
  height: 3,
21987
22082
  // Default height, adjust as needed
21988
22083
  layer: props.layer ?? "top",
21989
- rotation: props.pcbRotation ?? 0,
22084
+ rotation: props.pcbRotation ?? globalTransformRotation,
22085
+ insertion_direction: this._getPcbComponentInsertionDirection(
22086
+ props.layer ?? "top",
22087
+ globalTransformRotation
22088
+ ),
21990
22089
  source_component_id: this.source_component_id,
21991
22090
  subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
21992
22091
  do_not_place: props.doNotPlace ?? false,
@@ -22203,6 +22302,7 @@ var SolderJumper = class extends NormalComponent3 {
22203
22302
  const { db } = this.root;
22204
22303
  const { _parsedProps: props } = this;
22205
22304
  const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
22305
+ const globalTransformRotation = this.getGlobalTransformRotation();
22206
22306
  const pcb_component = db.pcb_component.insert({
22207
22307
  center: { x: pcbX, y: pcbY },
22208
22308
  width: 2,
@@ -22210,7 +22310,11 @@ var SolderJumper = class extends NormalComponent3 {
22210
22310
  height: 3,
22211
22311
  // Default height, adjust as needed
22212
22312
  layer: props.layer ?? "top",
22213
- rotation: props.pcbRotation ?? 0,
22313
+ rotation: props.pcbRotation ?? globalTransformRotation,
22314
+ insertion_direction: this._getPcbComponentInsertionDirection(
22315
+ props.layer ?? "top",
22316
+ globalTransformRotation
22317
+ ),
22214
22318
  source_component_id: this.source_component_id,
22215
22319
  subcircuit_id: this.getSubcircuit().subcircuit_id ?? void 0,
22216
22320
  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.1183",
4
+ "version": "0.0.1185",
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.510",
50
+ "@tscircuit/props": "^0.0.512",
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",