Overview
Circuit JSON (AKA tscircuit soup) is the name of the built low-level JSON circuit representation. It contains
all the information needed to visually represent a schematic, PCB, produce Gerber files, produce
bill of materials, run SPICE simulations, view warnings and more. It is designed to easily
interoperate with a SQL database.
Circuit JSON is an array of objects, a tscircuit soup object looks like this:
Typically a component like a resistor will be made up of many soup objects. All tscircuit
components (from the API reference section) have methods that convert themselves into soup.
Sometimes a component will analyze the soup produce by it’s children to produce it’s own
soup. For example, a <group />
will build soup for it’s children, then route traces.
Units
You can use any standard unit e.g. 0.1in
or 2.54mm
, these are automatically
translated to the numeric value for the “default unit” after parsing.
Source
source_component_base
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | No | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
source_group
Property | Type | Required | Description |
---|
type | string | Yes | |
source_group_id | string | Yes | |
name | string | No | |
source_led
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | Yes | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
source_net
Property | Type | Required | Description |
---|
type | string | Yes | |
source_net_id | string | Yes | |
name | string | Yes | |
member_source_group_ids | array | Yes | |
is_power | boolean | No | |
is_ground | boolean | No | |
is_digital_signal | boolean | No | |
is_analog_signal | boolean | No | |
trace_width | number | No | |
source_port
Property | Type | Required | Description |
---|
type | string | Yes | |
pin_number | number | No | |
port_hints | array | No | |
name | string | Yes | |
source_port_id | string | Yes | |
source_component_id | string | Yes | |
source_simple_bug
@deprecated
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | Yes | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
source_simple_capacitor
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | Yes | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
capacitance | string, number | Yes | |
source_simple_chip
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | Yes | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
source_simple_diode
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | Yes | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
source_simple_ground
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | Yes | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
source_simple_power_source
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | Yes | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
voltage | string, number | Yes | |
source_simple_resistor
Property | Type | Required | Description |
---|
type | string | Yes | |
ftype | string | Yes | |
source_component_id | string | Yes | |
name | string | Yes | |
manufacturer_part_number | string | No | |
supplier_part_numbers | object | No | |
resistance | string, number | Yes | |
source_trace
Property | Type | Required | Description |
---|
type | string | Yes | |
source_trace_id | string | Yes | |
connected_source_port_ids | array | Yes | |
connected_source_net_ids | array | Yes | |
Schematic
schematic_box
Draws a box on the schematic
Property | Type | Required | Description |
---|
type | string | Yes | |
schematic_component_id | string | Yes | |
width | string, number | Yes | |
height | string, number | Yes | |
x | string, number | Yes | |
y | string, number | Yes | |
schematic_component
Property | Type | Required | Description |
---|
type | string | Yes | |
rotation | string, number | No | |
size | object | Yes | |
center | object | Yes | |
source_component_id | string | Yes | |
schematic_component_id | string | Yes | |
pin_spacing | undefined | No | |
pin_styles | object | No | |
box_width | undefined | No | |
symbol_name | string | No | |
port_arrangement | undefined | No | |
port_labels | object | No | |
schematic_error
Defines a schematic error on the schematic
Property | Type | Required | Description |
---|
schematic_error_id | string | Yes | |
type | string | Yes | |
error_type | string | Yes | |
message | string | Yes | |
schematic_line
Property | Type | Required | Description |
---|
type | string | Yes | |
schematic_component_id | string | Yes | |
x1 | string, number | Yes | |
x2 | string, number | Yes | |
y1 | string, number | Yes | |
y2 | string, number | Yes | |
schematic_net_label
Property | Type | Required | Description |
---|
type | string | Yes | |
source_net_id | string | Yes | |
center | object | Yes | |
anchor_side | string | Yes | |
text | string | Yes | |
schematic_path
Property | Type | Required | Description |
---|
type | string | Yes | |
schematic_component_id | string | Yes | |
fill_color | string | No | |
is_filled | boolean | No | |
points | array | Yes | |
schematic_port
Defines a port on a schematic component
Property | Type | Required | Description |
---|
type | string | Yes | |
schematic_port_id | string | Yes | |
source_port_id | string | Yes | |
schematic_component_id | string | No | |
center | object | Yes | |
facing_direction | string | No | |
schematic_text
Property | Type | Required | Description |
---|
type | string | Yes | |
schematic_component_id | string | Yes | |
schematic_text_id | string | Yes | |
text | string | Yes | |
position | object | Yes | |
rotation | number | No | |
anchor | string | No | |
schematic_trace
Property | Type | Required | Description |
---|
type | string | Yes | |
schematic_trace_id | string | Yes | |
source_trace_id | string | Yes | |
edges | array | Yes | |
Pcb
pcb_board
Defines the board outline of the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_board_id | string | No | |
width | string, number | Yes | |
height | string, number | Yes | |
center | object | Yes | |
outline | array | No | |
pcb_component
Defines a component on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_component_id | string | No | |
source_component_id | string | Yes | |
center | object | Yes | |
layer | undefined | Yes | |
rotation | string, number | Yes | |
width | undefined | Yes | |
height | undefined | Yes | |
pcb_fabrication_note_path
Defines a fabrication path on the PCB for fabricators or assemblers
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_fabrication_note_path_id | string | No | |
pcb_component_id | string | Yes | |
layer | string | Yes | |
route | array | Yes | |
stroke_width | undefined | Yes | |
color | string | No | |
pcb_fabrication_note_text
Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_fabrication_note_text_id | string | No | |
font | string | No | |
font_size | string, number | No | |
pcb_component_id | string | Yes | |
text | string | Yes | |
layer | string | Yes | |
anchor_position | object | No | |
anchor_alignment | string | No | |
color | string | No | |
pcb_placement_error
Defines a placement error on the PCB
Property | Type | Required | Description |
---|
pcb_error_id | string | Yes | |
type | string | Yes | |
error_type | string | Yes | |
message | string | Yes | |
pcb_port
Defines a port on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_port_id | string | Yes | |
source_port_id | string | Yes | |
pcb_component_id | string | Yes | |
x | string, number | Yes | |
y | string, number | Yes | |
layers | array | Yes | |
pcb_port_not_matched_error
Defines a trace error on the PCB
Property | Type | Required | Description |
---|
pcb_error_id | string | Yes | |
type | string | Yes | |
error_type | string | Yes | |
message | string | Yes | |
pcb_component_ids | array | Yes | |
pcb_silkscreen_circle
Defines a silkscreen circle on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_silkscreen_circle_id | string | Yes | |
pcb_component_id | string | Yes | |
center | object | Yes | |
radius | undefined | Yes | |
layer | string | Yes | |
pcb_silkscreen_line
Defines a silkscreen line on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_silkscreen_line_id | string | Yes | |
pcb_component_id | string | Yes | |
stroke_width | string, number | No | |
x1 | string, number | Yes | |
y1 | string, number | Yes | |
x2 | string, number | Yes | |
y2 | string, number | Yes | |
layer | string | Yes | |
pcb_silkscreen_oval
Defines a silkscreen oval on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_silkscreen_oval_id | string | Yes | |
pcb_component_id | string | Yes | |
center | object | Yes | |
radius_x | undefined | Yes | |
radius_y | undefined | Yes | |
layer | string | Yes | |
pcb_silkscreen_path
Defines a silkscreen path on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_silkscreen_path_id | string | Yes | |
pcb_component_id | string | Yes | |
layer | string | Yes | |
route | array | Yes | |
stroke_width | undefined | Yes | |
pcb_silkscreen_rect
Defines a silkscreen rect on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
pcb_silkscreen_rect_id | string | Yes | |
pcb_component_id | string | Yes | |
center | object | Yes | |
width | undefined | Yes | |
height | undefined | Yes | |
layer | string | Yes | |
pcb_silkscreen_text
Defines silkscreen text on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
font | string | No | |
font_size | string, number | No | |
pcb_component_id | string | Yes | |
text | string | Yes | |
layer | string | Yes | |
anchor_position | object | No | |
anchor_alignment | string | No | |
pcb_text
Defines text on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
text | string | Yes | |
x | string, number | Yes | |
y | string, number | Yes | |
align | string | Yes | |
width | string, number | Yes | |
height | string, number | Yes | |
lines | number | Yes | |
pcb_trace
Property | Type | Required | Description |
---|
type | string | Yes | |
source_trace_id | string | No | |
pcb_component_id | string | No | |
pcb_trace_id | string | Yes | |
route_thickness_mode | string | No | |
should_round_corners | boolean | No | |
route | array | Yes | |
pcb_trace_error
Defines a trace error on the PCB
Property | Type | Required | Description |
---|
pcb_error_id | string | Yes | |
type | string | Yes | |
error_type | string | Yes | |
message | string | Yes | |
center | object | No | |
pcb_trace_id | string | Yes | |
source_trace_id | string | Yes | |
pcb_component_ids | array | Yes | |
pcb_port_ids | array | Yes | |
pcb_trace_hint
A hint that can be used to generate a PCB trace
Property | Type | Required | Description |
---|
pcb_trace_hint_id | string | Yes | |
type | string | Yes | |
pcb_port_id | string | Yes | |
pcb_component_id | string | Yes | |
route | array | Yes | |
pcb_via
Defines a via on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
x | string, number | Yes | |
y | string, number | Yes | |
outer_diameter | string, number | No | |
hole_diameter | string, number | No | |
from_layer | undefined | No | |
to_layer | undefined | No | |
layers | array | Yes | |
Misc
any_circuit_element
any_source_component
cad_component
Defines a component on the PCB
Property | Type | Required | Description |
---|
type | string | Yes | |
cad_component_id | string | Yes | |
pcb_component_id | string | Yes | |
source_component_id | string | Yes | |
position | object | Yes | |
rotation | object | No | |
size | object | No | |
layer | undefined | No | |
footprinter_string | string | No | |
model_obj_url | string | No | |
model_stl_url | string | No | |
model_3mf_url | string | No | |
model_jscad | undefined | No | |
capacitance
current
distance
inductance
layer_ref
layer_string
length
pcb_hole
Defines a hole on the PCB
pcb_keepout
pcb_plated_hole
Defines a plated hole on the PCB
pcb_route_hint
Property | Type | Required | Description |
---|
x | string, number | Yes | |
y | string, number | Yes | |
via | boolean | No | |
via_to_layer | undefined | No | |
pcb_route_hints
pcb_smtpad
Defines an SMT pad on the PCB
point
Property | Type | Required | Description |
---|
x | string, number | Yes | |
y | string, number | Yes | |
point3
Property | Type | Required | Description |
---|
x | string, number | Yes | |
y | string, number | Yes | |
z | string, number | Yes | |
position
Property | Type | Required | Description |
---|
x | string, number | Yes | |
y | string, number | Yes | |
position3
Property | Type | Required | Description |
---|
x | string, number | Yes | |
y | string, number | Yes | |
z | string, number | Yes | |
resistance
rotation
route_hint_point
Property | Type | Required | Description |
---|
x | string, number | Yes | |
y | string, number | Yes | |
via | boolean | No | |
to_layer | undefined | No | |
trace_width | string, number | No | |
schematic_pin_styles
size
Property | Type | Required | Description |
---|
width | number | Yes | |
height | number | Yes | |
supplier_name
time
visible_layer
voltage