Menu

Key Generation Convention

Splice uses a structured, hierarchical key system to ensure consistent and unique identifiers across all data structures.

BOM Instance Keys

All parts in the BOM use sequential letter-number combinations:

  • Connectors: use prefix X and increment: X1, X2, X3, …
  • Wires: use prefix W and increment: W1, W2, W3, …
  • Cables: use prefix C and increment: C1, C2, C3, …
  • Terminals: use prefix T and increment: T1, T2, T3, …
  • Splices: use prefix SP and increment: SP1, SP2, SP3, …

Mapping Keys (Connections)

Connection keys in the mapping object follow specific patterns:

  • Wire Connections: Use BOM wire key directly (W1, W2, etc.)
  • Cable Core Connections: Use format CableInstance.CoreNumber (e.g., C1.1, C1.2)
  • Bundle Keys: Connector pairs sorted alphabetically as Connector1|Connector2 (e.g., X1|X2)

Position Keys

Position keys directly correspond to BOM instance keys:

  • Connector Positions: connector_positions["X1"] stores position for connector X1
  • Cable Positions: cable_positions["C1"] stores position for cable C1

Wire Anchor Keys

Wire anchor keys store label positioning data and are generated based on connection types.

  • Connector-to-Connector Bundles: X1|X2 (sorted alphabetically)
  • Flying Lead Connections: Individual wire key W1, W2, etc.
  • Cable Core Connections: Cable core key with suffix -1 or -2 to denote cable side, eg. C1.1-1, C1.2-2, etc.

Bundle Labels

Bundle labels store visual labels attached to connectors or cables:

  • Key: Unique UUID for each label
  • connector_instance_id: The connector this label is attached to (e.g., “X1”)
  • cable_instance_id: The cable this label is attached to (e.g., “C1”)
  • label_text: The text displayed on the label
  • wire_keys: Optional array of specific wire keys this label applies to
  • width_mm: Label width in millimeters (default: 9)
  • text_color: Hex color for label text (default: “#000000”)
  • background_color: Hex color for label background (default: “#FFFFFF”)

Label Settings

Global settings for label display:

  • show_labels_on_canvas: Boolean to toggle label visibility
  • default_width_mm: Default width for new labels in millimeters

Key Hierarchy Example

{
  "bom": {
    "X1": "Connector instance",
    "W1": "Wire instance",
    "C1": "Cable instance"
  },
  "data": {
     "mapping": {
       "W1": "Wire connection",
       "C1.1": "Cable core 1 connection",
       "C1.2": "Cable core 2 connection"
     },
     "connector_positions": {
       "X1": "Connector X1 position"
     },
     "cable_positions": {
       "C1": "Cable C1 position"
     },
     "wire_anchors": {
       "X1|X2": "Bundle label anchor",
       "W1": "Flying lead label anchor",
       "C1.1-1": "Cable core label anchor"
     },
     "bundle_labels": {
       "uuid-1234": {
         "connector_instance_id": "X1",
         "label_text": "TO POWER SUPPLY",
         "wire_keys": ["W1", "W2"],
         "width_mm": 9,
         "text_color": "#000000",
         "background_color": "#FFFF00"
       }
     },
     "label_settings": {
       "show_labels_on_canvas": true,
       "default_width_mm": 9
     }
  }
}