@tscircuit/core 0.0.794 → 0.0.795

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
@@ -635,7 +635,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
635
635
  trace_width?: string | number | undefined;
636
636
  }>, "many">>;
637
637
  pcbPathRelativeTo: z.ZodOptional<z.ZodString>;
638
- pcbPath: z.ZodOptional<z.ZodArray<z.ZodObject<{
638
+ pcbPath: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
639
639
  x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
640
640
  y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
641
641
  }, "strip", z.ZodTypeAny, {
@@ -644,7 +644,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
644
644
  }, {
645
645
  x: string | number;
646
646
  y: string | number;
647
- }>, "many">>;
647
+ }>, z.ZodString]>, "many">>;
648
648
  schDisplayLabel: z.ZodOptional<z.ZodString>;
649
649
  schStroke: z.ZodOptional<z.ZodString>;
650
650
  highlightColor: z.ZodOptional<z.ZodString>;
@@ -675,10 +675,10 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
675
675
  trace_width?: number | undefined;
676
676
  }[] | undefined;
677
677
  pcbPathRelativeTo?: string | undefined;
678
- pcbPath?: {
678
+ pcbPath?: (string | {
679
679
  x: number;
680
680
  y: number;
681
- }[] | undefined;
681
+ })[] | undefined;
682
682
  schDisplayLabel?: string | undefined;
683
683
  schStroke?: string | undefined;
684
684
  }, {
@@ -703,10 +703,10 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
703
703
  trace_width?: string | number | undefined;
704
704
  }[] | undefined;
705
705
  pcbPathRelativeTo?: string | undefined;
706
- pcbPath?: {
706
+ pcbPath?: (string | {
707
707
  x: string | number;
708
708
  y: string | number;
709
- }[] | undefined;
709
+ })[] | undefined;
710
710
  schDisplayLabel?: string | undefined;
711
711
  schStroke?: string | undefined;
712
712
  }>, z.ZodObject<{
@@ -752,7 +752,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
752
752
  trace_width?: string | number | undefined;
753
753
  }>, "many">>;
754
754
  pcbPathRelativeTo: z.ZodOptional<z.ZodString>;
755
- pcbPath: z.ZodOptional<z.ZodArray<z.ZodObject<{
755
+ pcbPath: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
756
756
  x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
757
757
  y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
758
758
  }, "strip", z.ZodTypeAny, {
@@ -761,7 +761,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
761
761
  }, {
762
762
  x: string | number;
763
763
  y: string | number;
764
- }>, "many">>;
764
+ }>, z.ZodString]>, "many">>;
765
765
  schDisplayLabel: z.ZodOptional<z.ZodString>;
766
766
  schStroke: z.ZodOptional<z.ZodString>;
767
767
  highlightColor: z.ZodOptional<z.ZodString>;
@@ -800,10 +800,10 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
800
800
  trace_width?: number | undefined;
801
801
  }[] | undefined;
802
802
  pcbPathRelativeTo?: string | undefined;
803
- pcbPath?: {
803
+ pcbPath?: (string | {
804
804
  x: number;
805
805
  y: number;
806
- }[] | undefined;
806
+ })[] | undefined;
807
807
  schDisplayLabel?: string | undefined;
808
808
  schStroke?: string | undefined;
809
809
  }, {
@@ -831,10 +831,10 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> implements Tra
831
831
  trace_width?: string | number | undefined;
832
832
  }[] | undefined;
833
833
  pcbPathRelativeTo?: string | undefined;
834
- pcbPath?: {
834
+ pcbPath?: (string | {
835
835
  x: string | number;
836
836
  y: string | number;
837
- }[] | undefined;
837
+ })[] | undefined;
838
838
  schDisplayLabel?: string | undefined;
839
839
  schStroke?: string | undefined;
840
840
  }>]>;
@@ -2000,9 +2000,11 @@ declare class Board extends Group<typeof boardProps> {
2000
2000
  silkscreenColor: zod.ZodOptional<zod.ZodType<_tscircuit_props.BoardColor, zod.ZodTypeDef, _tscircuit_props.BoardColor>>;
2001
2001
  topSilkscreenColor: zod.ZodOptional<zod.ZodType<_tscircuit_props.BoardColor, zod.ZodTypeDef, _tscircuit_props.BoardColor>>;
2002
2002
  bottomSilkscreenColor: zod.ZodOptional<zod.ZodType<_tscircuit_props.BoardColor, zod.ZodTypeDef, _tscircuit_props.BoardColor>>;
2003
+ doubleSidedAssembly: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
2003
2004
  }, "strip", zod.ZodTypeAny, {
2004
2005
  material: "fr4" | "fr1";
2005
2006
  layers: 2 | 4;
2007
+ doubleSidedAssembly: boolean;
2006
2008
  symbol?: _tscircuit_props.SymbolProp | undefined;
2007
2009
  key?: any;
2008
2010
  pcbX?: number | undefined;
@@ -2588,6 +2590,7 @@ declare class Board extends Group<typeof boardProps> {
2588
2590
  silkscreenColor?: _tscircuit_props.BoardColor | undefined;
2589
2591
  topSilkscreenColor?: _tscircuit_props.BoardColor | undefined;
2590
2592
  bottomSilkscreenColor?: _tscircuit_props.BoardColor | undefined;
2593
+ doubleSidedAssembly?: boolean | undefined;
2591
2594
  }>;
2592
2595
  };
2593
2596
  get boardThickness(): number;
@@ -20215,6 +20218,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
20215
20218
  width: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
20216
20219
  height: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
20217
20220
  rectBorderRadius: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
20221
+ cornerRadius: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
20218
20222
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
20219
20223
  coveredWithSolderMask: zod.ZodOptional<zod.ZodBoolean>;
20220
20224
  }, "strip", zod.ZodTypeAny, {
@@ -20236,6 +20240,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
20236
20240
  name?: string | undefined;
20237
20241
  portHints?: (string | number)[] | undefined;
20238
20242
  rectBorderRadius?: number | undefined;
20243
+ cornerRadius?: number | undefined;
20239
20244
  coveredWithSolderMask?: boolean | undefined;
20240
20245
  }, {
20241
20246
  shape: "rect";
@@ -20258,6 +20263,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
20258
20263
  name?: string | undefined;
20259
20264
  portHints?: (string | number)[] | undefined;
20260
20265
  rectBorderRadius?: string | number | undefined;
20266
+ cornerRadius?: string | number | undefined;
20261
20267
  coveredWithSolderMask?: boolean | undefined;
20262
20268
  }>, zod.ZodObject<Omit<{
20263
20269
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -20287,6 +20293,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
20287
20293
  width: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
20288
20294
  height: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
20289
20295
  ccwRotation: zod.ZodNumber;
20296
+ cornerRadius: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
20290
20297
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
20291
20298
  coveredWithSolderMask: zod.ZodOptional<zod.ZodBoolean>;
20292
20299
  }, "strip", zod.ZodTypeAny, {
@@ -20308,6 +20315,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
20308
20315
  relative?: boolean | undefined;
20309
20316
  name?: string | undefined;
20310
20317
  portHints?: (string | number)[] | undefined;
20318
+ cornerRadius?: number | undefined;
20311
20319
  coveredWithSolderMask?: boolean | undefined;
20312
20320
  }, {
20313
20321
  shape: "rotated_rect";
@@ -20330,6 +20338,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
20330
20338
  relative?: boolean | undefined;
20331
20339
  name?: string | undefined;
20332
20340
  portHints?: (string | number)[] | undefined;
20341
+ cornerRadius?: string | number | undefined;
20333
20342
  coveredWithSolderMask?: boolean | undefined;
20334
20343
  }>, zod.ZodObject<Omit<{
20335
20344
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -31960,6 +31969,11 @@ declare class Switch extends NormalComponent<typeof switchProps> {
31960
31969
  spdt: zod.ZodOptional<zod.ZodBoolean>;
31961
31970
  dpst: zod.ZodOptional<zod.ZodBoolean>;
31962
31971
  dpdt: zod.ZodOptional<zod.ZodBoolean>;
31972
+ simSwitchFrequency: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
31973
+ simCloseAt: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
31974
+ simOpenAt: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
31975
+ simStartClosed: zod.ZodOptional<zod.ZodBoolean>;
31976
+ simStartOpen: zod.ZodOptional<zod.ZodBoolean>;
31963
31977
  connections: zod.ZodOptional<zod.ZodPipeline<zod.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, zod.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
31964
31978
  }, "strip", zod.ZodTypeAny, {
31965
31979
  name: string;
@@ -32147,6 +32161,11 @@ declare class Switch extends NormalComponent<typeof switchProps> {
32147
32161
  spdt?: boolean | undefined;
32148
32162
  dpst?: boolean | undefined;
32149
32163
  dpdt?: boolean | undefined;
32164
+ simSwitchFrequency?: number | undefined;
32165
+ simCloseAt?: number | undefined;
32166
+ simOpenAt?: number | undefined;
32167
+ simStartClosed?: boolean | undefined;
32168
+ simStartOpen?: boolean | undefined;
32150
32169
  }, {
32151
32170
  name: string;
32152
32171
  symbol?: _tscircuit_props.SymbolProp | undefined;
@@ -32335,6 +32354,11 @@ declare class Switch extends NormalComponent<typeof switchProps> {
32335
32354
  dpst?: boolean | undefined;
32336
32355
  dpdt?: boolean | undefined;
32337
32356
  isNormallyClosed?: boolean | undefined;
32357
+ simSwitchFrequency?: string | number | undefined;
32358
+ simCloseAt?: string | number | undefined;
32359
+ simOpenAt?: string | number | undefined;
32360
+ simStartClosed?: boolean | undefined;
32361
+ simStartOpen?: boolean | undefined;
32338
32362
  }>, SwitchProps, {
32339
32363
  name: string;
32340
32364
  symbol?: _tscircuit_props.SymbolProp | undefined;
@@ -32523,6 +32547,11 @@ declare class Switch extends NormalComponent<typeof switchProps> {
32523
32547
  dpst?: boolean | undefined;
32524
32548
  dpdt?: boolean | undefined;
32525
32549
  isNormallyClosed?: boolean | undefined;
32550
+ simSwitchFrequency?: string | number | undefined;
32551
+ simCloseAt?: string | number | undefined;
32552
+ simOpenAt?: string | number | undefined;
32553
+ simStartClosed?: boolean | undefined;
32554
+ simStartOpen?: boolean | undefined;
32526
32555
  }>;
32527
32556
  shouldRenderAsSchematicBox: boolean;
32528
32557
  };
package/dist/index.js CHANGED
@@ -6384,14 +6384,35 @@ function Trace_doInitialPcbManualTraceRender(trace) {
6384
6384
  });
6385
6385
  const transform = anchorPort?._computePcbGlobalTransformBeforeLayout?.() || identity3();
6386
6386
  for (const pt of props.pcbPath) {
6387
- const transformed = applyToPoint6(transform, {
6388
- x: pt.x,
6389
- y: pt.y
6390
- });
6387
+ let coordinates;
6388
+ let isGlobalPosition = false;
6389
+ if (typeof pt === "string") {
6390
+ const resolvedPort = trace.getSubcircuit().selectOne(pt, {
6391
+ type: "port"
6392
+ });
6393
+ if (!resolvedPort) {
6394
+ db.pcb_trace_error.insert({
6395
+ error_type: "pcb_trace_error",
6396
+ source_trace_id: trace.source_trace_id,
6397
+ message: `Could not resolve pcbPath selector "${pt}" for ${trace}`,
6398
+ pcb_trace_id: trace.pcb_trace_id,
6399
+ pcb_component_ids: [],
6400
+ pcb_port_ids: []
6401
+ });
6402
+ continue;
6403
+ }
6404
+ const portPos = resolvedPort._getGlobalPcbPositionAfterLayout();
6405
+ coordinates = { x: portPos.x, y: portPos.y };
6406
+ isGlobalPosition = true;
6407
+ } else {
6408
+ coordinates = { x: pt.x, y: pt.y };
6409
+ isGlobalPosition = false;
6410
+ }
6411
+ const finalCoordinates = isGlobalPosition ? coordinates : applyToPoint6(transform, coordinates);
6391
6412
  route.push({
6392
6413
  route_type: "wire",
6393
- x: transformed.x,
6394
- y: transformed.y,
6414
+ x: finalCoordinates.x,
6415
+ y: finalCoordinates.y,
6395
6416
  width,
6396
6417
  layer
6397
6418
  });
@@ -16868,7 +16889,7 @@ import { identity as identity6 } from "transformation-matrix";
16868
16889
  var package_default = {
16869
16890
  name: "@tscircuit/core",
16870
16891
  type: "module",
16871
- version: "0.0.793",
16892
+ version: "0.0.794",
16872
16893
  types: "dist/index.d.ts",
16873
16894
  main: "dist/index.js",
16874
16895
  module: "dist/index.js",
@@ -16908,7 +16929,7 @@ var package_default = {
16908
16929
  "@tscircuit/matchpack": "^0.0.16",
16909
16930
  "@tscircuit/math-utils": "^0.0.21",
16910
16931
  "@tscircuit/miniflex": "^0.0.4",
16911
- "@tscircuit/props": "0.0.363",
16932
+ "@tscircuit/props": "0.0.369",
16912
16933
  "@tscircuit/schematic-autolayout": "^0.0.6",
16913
16934
  "@tscircuit/schematic-match-adapt": "^0.0.16",
16914
16935
  "@tscircuit/schematic-trace-solver": "^0.0.41",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.794",
4
+ "version": "0.0.795",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -41,7 +41,7 @@
41
41
  "@tscircuit/matchpack": "^0.0.16",
42
42
  "@tscircuit/math-utils": "^0.0.21",
43
43
  "@tscircuit/miniflex": "^0.0.4",
44
- "@tscircuit/props": "0.0.363",
44
+ "@tscircuit/props": "0.0.369",
45
45
  "@tscircuit/schematic-autolayout": "^0.0.6",
46
46
  "@tscircuit/schematic-match-adapt": "^0.0.16",
47
47
  "@tscircuit/schematic-trace-solver": "^0.0.41",