circuit-json 0.0.518 → 0.0.519

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/README.md CHANGED
@@ -1432,7 +1432,10 @@ interface UnknownErrorFindingPart extends BaseCircuitJsonError {
1432
1432
 
1433
1433
  ```typescript
1434
1434
  /** Resolved cable geometry in circuit-world XYZ, mm, +Z up. Path samples are
1435
- * points; first and last are wire exits. Connector poses follow path tangents.
1435
+ * points; first and last are wire exits. Optional pin 1 positions are absolute
1436
+ * points at the connector mating faces, resolved by the circuit producer.
1437
+ * Their transverse offsets from the endpoint centerlines fix connector roll.
1438
+ * Omitted positions preserve legacy parallel-transport orientation.
1436
1439
  * Rendering consumes this path without rerouting or adding sag. */
1437
1440
  interface CadCable {
1438
1441
  type: "cad_cable"
@@ -1440,6 +1443,8 @@ interface CadCable {
1440
1443
  name: string
1441
1444
  from_source_component_id: string
1442
1445
  to_source_component_id: string
1446
+ from_connector_pin1_position?: Point3
1447
+ to_connector_pin1_position?: Point3
1443
1448
  cableprinter_string: string
1444
1449
  path: Point3[]
1445
1450
  }
package/dist/index.d.mts CHANGED
@@ -39790,6 +39790,48 @@ declare const cad_cable: z.ZodObject<{
39790
39790
  name: z.ZodString;
39791
39791
  from_source_component_id: z.ZodString;
39792
39792
  to_source_component_id: z.ZodString;
39793
+ from_connector_pin1_position: z.ZodOptional<z.ZodEffects<z.ZodObject<{
39794
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
39795
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
39796
+ z: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
39797
+ }, "strip", z.ZodTypeAny, {
39798
+ x: number;
39799
+ y: number;
39800
+ z: number;
39801
+ }, {
39802
+ x: string | number;
39803
+ y: string | number;
39804
+ z: string | number;
39805
+ }>, {
39806
+ x: number;
39807
+ y: number;
39808
+ z: number;
39809
+ }, {
39810
+ x: string | number;
39811
+ y: string | number;
39812
+ z: string | number;
39813
+ }>>;
39814
+ to_connector_pin1_position: z.ZodOptional<z.ZodEffects<z.ZodObject<{
39815
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
39816
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
39817
+ z: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
39818
+ }, "strip", z.ZodTypeAny, {
39819
+ x: number;
39820
+ y: number;
39821
+ z: number;
39822
+ }, {
39823
+ x: string | number;
39824
+ y: string | number;
39825
+ z: string | number;
39826
+ }>, {
39827
+ x: number;
39828
+ y: number;
39829
+ z: number;
39830
+ }, {
39831
+ x: string | number;
39832
+ y: string | number;
39833
+ z: string | number;
39834
+ }>>;
39793
39835
  cableprinter_string: z.ZodString;
39794
39836
  path: z.ZodEffects<z.ZodArray<z.ZodObject<{
39795
39837
  x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
@@ -39824,6 +39866,16 @@ declare const cad_cable: z.ZodObject<{
39824
39866
  from_source_component_id: string;
39825
39867
  to_source_component_id: string;
39826
39868
  cableprinter_string: string;
39869
+ from_connector_pin1_position?: {
39870
+ x: number;
39871
+ y: number;
39872
+ z: number;
39873
+ } | undefined;
39874
+ to_connector_pin1_position?: {
39875
+ x: number;
39876
+ y: number;
39877
+ z: number;
39878
+ } | undefined;
39827
39879
  }, {
39828
39880
  path: {
39829
39881
  x: string | number;
@@ -39836,10 +39888,23 @@ declare const cad_cable: z.ZodObject<{
39836
39888
  from_source_component_id: string;
39837
39889
  to_source_component_id: string;
39838
39890
  cableprinter_string: string;
39891
+ from_connector_pin1_position?: {
39892
+ x: string | number;
39893
+ y: string | number;
39894
+ z: string | number;
39895
+ } | undefined;
39896
+ to_connector_pin1_position?: {
39897
+ x: string | number;
39898
+ y: string | number;
39899
+ z: string | number;
39900
+ } | undefined;
39839
39901
  }>;
39840
39902
  type CadCableInput = z.input<typeof cad_cable>;
39841
39903
  /** Resolved cable geometry in circuit-world XYZ, mm, +Z up. Path samples are
39842
- * points; first and last are wire exits. Connector poses follow path tangents.
39904
+ * points; first and last are wire exits. Optional pin 1 positions are absolute
39905
+ * points at the connector mating faces, resolved by the circuit producer.
39906
+ * Their transverse offsets from the endpoint centerlines fix connector roll.
39907
+ * Omitted positions preserve legacy parallel-transport orientation.
39843
39908
  * Rendering consumes this path without rerouting or adding sag.
39844
39909
  */
39845
39910
  interface CadCable {
@@ -39848,6 +39913,8 @@ interface CadCable {
39848
39913
  name: string;
39849
39914
  from_source_component_id: string;
39850
39915
  to_source_component_id: string;
39916
+ from_connector_pin1_position?: Point3;
39917
+ to_connector_pin1_position?: Point3;
39851
39918
  cableprinter_string: string;
39852
39919
  path: Point3[];
39853
39920
  }
@@ -61003,6 +61070,48 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
61003
61070
  name: z.ZodString;
61004
61071
  from_source_component_id: z.ZodString;
61005
61072
  to_source_component_id: z.ZodString;
61073
+ from_connector_pin1_position: z.ZodOptional<z.ZodEffects<z.ZodObject<{
61074
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
61075
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
61076
+ z: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
61077
+ }, "strip", z.ZodTypeAny, {
61078
+ x: number;
61079
+ y: number;
61080
+ z: number;
61081
+ }, {
61082
+ x: string | number;
61083
+ y: string | number;
61084
+ z: string | number;
61085
+ }>, {
61086
+ x: number;
61087
+ y: number;
61088
+ z: number;
61089
+ }, {
61090
+ x: string | number;
61091
+ y: string | number;
61092
+ z: string | number;
61093
+ }>>;
61094
+ to_connector_pin1_position: z.ZodOptional<z.ZodEffects<z.ZodObject<{
61095
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
61096
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
61097
+ z: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
61098
+ }, "strip", z.ZodTypeAny, {
61099
+ x: number;
61100
+ y: number;
61101
+ z: number;
61102
+ }, {
61103
+ x: string | number;
61104
+ y: string | number;
61105
+ z: string | number;
61106
+ }>, {
61107
+ x: number;
61108
+ y: number;
61109
+ z: number;
61110
+ }, {
61111
+ x: string | number;
61112
+ y: string | number;
61113
+ z: string | number;
61114
+ }>>;
61006
61115
  cableprinter_string: z.ZodString;
61007
61116
  path: z.ZodEffects<z.ZodArray<z.ZodObject<{
61008
61117
  x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
@@ -61037,6 +61146,16 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
61037
61146
  from_source_component_id: string;
61038
61147
  to_source_component_id: string;
61039
61148
  cableprinter_string: string;
61149
+ from_connector_pin1_position?: {
61150
+ x: number;
61151
+ y: number;
61152
+ z: number;
61153
+ } | undefined;
61154
+ to_connector_pin1_position?: {
61155
+ x: number;
61156
+ y: number;
61157
+ z: number;
61158
+ } | undefined;
61040
61159
  }, {
61041
61160
  path: {
61042
61161
  x: string | number;
@@ -61049,6 +61168,16 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
61049
61168
  from_source_component_id: string;
61050
61169
  to_source_component_id: string;
61051
61170
  cableprinter_string: string;
61171
+ from_connector_pin1_position?: {
61172
+ x: string | number;
61173
+ y: string | number;
61174
+ z: string | number;
61175
+ } | undefined;
61176
+ to_connector_pin1_position?: {
61177
+ x: string | number;
61178
+ y: string | number;
61179
+ z: string | number;
61180
+ } | undefined;
61052
61181
  }>, z.ZodObject<{
61053
61182
  message: z.ZodString;
61054
61183
  is_fatal: z.ZodOptional<z.ZodBoolean>;
@@ -83589,6 +83718,48 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
83589
83718
  name: z.ZodString;
83590
83719
  from_source_component_id: z.ZodString;
83591
83720
  to_source_component_id: z.ZodString;
83721
+ from_connector_pin1_position: z.ZodOptional<z.ZodEffects<z.ZodObject<{
83722
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
83723
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
83724
+ z: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
83725
+ }, "strip", z.ZodTypeAny, {
83726
+ x: number;
83727
+ y: number;
83728
+ z: number;
83729
+ }, {
83730
+ x: string | number;
83731
+ y: string | number;
83732
+ z: string | number;
83733
+ }>, {
83734
+ x: number;
83735
+ y: number;
83736
+ z: number;
83737
+ }, {
83738
+ x: string | number;
83739
+ y: string | number;
83740
+ z: string | number;
83741
+ }>>;
83742
+ to_connector_pin1_position: z.ZodOptional<z.ZodEffects<z.ZodObject<{
83743
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
83744
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
83745
+ z: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
83746
+ }, "strip", z.ZodTypeAny, {
83747
+ x: number;
83748
+ y: number;
83749
+ z: number;
83750
+ }, {
83751
+ x: string | number;
83752
+ y: string | number;
83753
+ z: string | number;
83754
+ }>, {
83755
+ x: number;
83756
+ y: number;
83757
+ z: number;
83758
+ }, {
83759
+ x: string | number;
83760
+ y: string | number;
83761
+ z: string | number;
83762
+ }>>;
83592
83763
  cableprinter_string: z.ZodString;
83593
83764
  path: z.ZodEffects<z.ZodArray<z.ZodObject<{
83594
83765
  x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
@@ -83623,6 +83794,16 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
83623
83794
  from_source_component_id: string;
83624
83795
  to_source_component_id: string;
83625
83796
  cableprinter_string: string;
83797
+ from_connector_pin1_position?: {
83798
+ x: number;
83799
+ y: number;
83800
+ z: number;
83801
+ } | undefined;
83802
+ to_connector_pin1_position?: {
83803
+ x: number;
83804
+ y: number;
83805
+ z: number;
83806
+ } | undefined;
83626
83807
  }, {
83627
83808
  path: {
83628
83809
  x: string | number;
@@ -83635,6 +83816,16 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
83635
83816
  from_source_component_id: string;
83636
83817
  to_source_component_id: string;
83637
83818
  cableprinter_string: string;
83819
+ from_connector_pin1_position?: {
83820
+ x: string | number;
83821
+ y: string | number;
83822
+ z: string | number;
83823
+ } | undefined;
83824
+ to_connector_pin1_position?: {
83825
+ x: string | number;
83826
+ y: string | number;
83827
+ z: string | number;
83828
+ } | undefined;
83638
83829
  }>, z.ZodObject<{
83639
83830
  message: z.ZodString;
83640
83831
  is_fatal: z.ZodOptional<z.ZodBoolean>;
package/dist/index.mjs CHANGED
@@ -4438,12 +4438,20 @@ expectTypesMatch(true);
4438
4438
 
4439
4439
  // src/cad/cad_cable.ts
4440
4440
  import { z as z197 } from "zod";
4441
+ var connectorPin1Position = point3.refine(
4442
+ (point2) => [point2.x, point2.y, point2.z].every(Number.isFinite),
4443
+ "Connector pin 1 positions must be finite"
4444
+ ).describe(
4445
+ "Resolved pin 1 position at the connector mating face, in right-handed circuit world, millimeters: +X right, +Y top, +Z above. An absolute point, not a direction. Computed by the circuit producer from endpoint geometry. Together with the endpoint path tangent, fixes connector roll and identifies its pin 1 side; renderers must not infer it from footprints."
4446
+ );
4441
4447
  var cad_cable = z197.object({
4442
4448
  type: z197.literal("cad_cable"),
4443
4449
  cad_cable_id: z197.string(),
4444
4450
  name: z197.string().min(1),
4445
4451
  from_source_component_id: z197.string(),
4446
4452
  to_source_component_id: z197.string(),
4453
+ from_connector_pin1_position: connectorPin1Position.optional(),
4454
+ to_connector_pin1_position: connectorPin1Position.optional(),
4447
4455
  cableprinter_string: z197.string().min(1).describe(
4448
4456
  'Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'
4449
4457
  ),