Skip to main content

point

point

This keyword creates a named location in the circuit graph that can be referenced later.

The format for this command: point <string_expr>, where <string_expr> is a string literal or any expression that evaluates to a string. The named point can be referenced later using at "name", to "name", or via a variable or expression.

Static string

from "std" import *

v3v3 = supply("3.3V")
gnd = dgnd()

at v3v3
wire down 100 right 100

point "tmp1"

wire right 200 down 100
add cap(100n)
wire down 100
to gnd

at "tmp1"
wire down 100
add res(10k)
wire down 100
to gnd
line 6:13.3Vline 16:1Component C1: line 12:1C1100nline 14:4GNDComponent R1: line 18:1R110kline 20:4GND

Variable

A string stored in a variable can be passed directly to point:

from "std" import *

gnd = dgnd()

tmp_name = "my_point"
point tmp_name

wire right 100
at "my_point"
wire down 100
to gnd
line 9:1line 11:4GND

Expression (string concatenation)

String expressions, such as concatenating a prefix with a loop index, are also valid:

from "std" import *

gnd = dgnd()
names = []

for i in range(0, 5):
point "hello_" + i
array_push(names, "hello_" + i)

if i < 4:
wire right 300

Dynamic reference in loops

To reference dynamically-named points inside a loop, use at array_get(names, i) where names holds the list of point name strings:

from "std" import *

v5 = supply("5V")
gnd = dgnd()
wire d 100

names = []
gnds = []

for i in range(0, 5):
point "hello_" + i
array_push(names, "hello_" + i)

if i < 4:
wire right 300

for i in range(0, 5):
at array_get(names, i)

wire down 100
add cap(100n)
wire down 100

tmp_name = "gnd_" + i
array_push(gnds, tmp_name)

point tmp_name

for i in range(0, 5):
at gnd
wire up 100
to array_get(gnds, i)
line 18:5line 18:5line 18:5line 18:5line 18:5Component C1_5: line 21:5C1_5100nline 32:8line 30:5GNDComponent C1_4: line 21:5C1_4100nline 32:8line 30:5GNDComponent C1_3: line 21:5C1_3100nline 32:8line 30:5GNDComponent C1_2: line 21:5C1_2100nline 32:8line 30:5GNDComponent C1_1: line 21:5C1_1100nline 32:8line 30:5GND

to "name" works for referencing a static named point in a wire chain:

point "tmp1"

at some_component pin 3
wire right 100
wire auto
to "tmp1"
[0] ParseError at 3:4-3:18: Could not find component: some_component Render failed due to syntax or parsing errors