tscircuit / dsn-converter

MIT License
0 stars 1 forks source link

update the parsing of pcb json #6

Closed imrishabh18 closed 2 months ago

imrishabh18 commented 2 months ago

This is how the new circuit json looks like.

[
  {
    "type": "pcb_smtpad",
    "pcb_smtpad_id": "RoundRect[T]Pad_540x640_135.514_um_0.000000_0_1",
    "pcb_component_id": "Resistor_SMD:R_0402_1005Metric",
    "pcb_port_id": "RoundRect[T]Pad_540x640_135.514_um_0.000000_0_1",
    "shape": "rect",
    "x": 149.48,
    "y": 105,
    "width": 0.54,
    "height": 0.64,
    "layer": "top",
    "port_hints": [
      "1"
    ]
  },
  {
    "type": "pcb_smtpad",
    "pcb_smtpad_id": "RoundRect[T]Pad_540x640_135.514_um_0.000000_0_2",
    "pcb_component_id": "Resistor_SMD:R_0402_1005Metric",
    "pcb_port_id": "RoundRect[T]Pad_540x640_135.514_um_0.000000_0_2",
    "shape": "rect",
    "x": 150.5,
    "y": 105,
    "width": 0.54,
    "height": 0.64,
    "layer": "top",
    "port_hints": [
      "2"
    ]
  },
  {
    "type": "pcb_smtpad",
    "pcb_smtpad_id": "RoundRect[T]Pad_900x950_225.856_um_0.000000_0_1",
    "pcb_component_id": "Capacitor_SMD:C_0603_1608Metric",
    "pcb_port_id": "RoundRect[T]Pad_900x950_225.856_um_0.000000_0_1",
    "shape": "rect",
    "x": 154.245,
    "y": 105,
    "width": 0.9,
    "height": 0.95,
    "layer": "top",
    "port_hints": [
      "1"
    ]
  },
  {
    "type": "pcb_smtpad",
    "pcb_smtpad_id": "RoundRect[T]Pad_900x950_225.856_um_0.000000_0_2",
    "pcb_component_id": "Capacitor_SMD:C_0603_1608Metric",
    "pcb_port_id": "RoundRect[T]Pad_900x950_225.856_um_0.000000_0_2",
    "shape": "rect",
    "x": 155.795,
    "y": 105,
    "width": 0.9,
    "height": 0.95,
    "layer": "top",
    "port_hints": [
      "2"
    ]
  },
  {
    "type": "pcb_trace",
    "pcb_trace_id": "bff2dc94-ce6d-46ea-b3f3-c4d4a34a12f0",
    "source_trace_id": "Net-(C1-Pad1)",
    "route_thickness_mode": "constant",
    "should_round_corners": false,
    "route": [
      {
        "route_type": "wire",
        "x": 150.5,
        "y": 105,
        "width": 0.2,
        "layer": "top"
      },
      {
        "route_type": "wire",
        "x": 154.54,
        "y": 105,
        "width": 0.2,
        "layer": "top"
      }
    ]
  },
  {
    "type": "pcb_board",
    "pcb_board_id": "4db82917-cd24-45fb-bd07-830ca5b5db42",
    "outline": [
      {
        "x": 158,
        "y": 108
      },
      {
        "x": 147.5,
        "y": 108
      },
      {
        "x": 147.5,
        "y": 102
      },
      {
        "x": 158,
        "y": 102
      },
      {
        "x": 158,
        "y": 108
      }
    ]
  }
]