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
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
Dynamic reference in loops
String expressions, such as concatenating a prefix with a loop index, are also valid.
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()
at v5
wire down 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)
to "name" works for referencing a static named point in a wire chain:
from "std" import *
some_component = create component:
pins:
1: "A"
2: "B"
3: "C"
at some_component pin 1
wire right 200
point "tmp1"
add label("point-tmp1")
wire right 100
at some_component pin 3
wire right 100
wire auto_
to "tmp1"