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

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)
line 6:15Vline 20:5line 20:5line 20:5line 20:5line 20:5Component C1_5: line 23:5C1_5100nline 34:8line 32:5GNDComponent C1_4: line 23:5C1_4100nline 34:8line 32:5GNDComponent C1_3: line 23:5C1_3100nline 34:8line 32:5GNDComponent C1_2: line 23:5C1_2100nline 34:8line 32:5GNDComponent C1_1: line 23:5C1_1100nline 34:8line 32:5GND

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"
Component J1: line 3:1A1C3B2J1line 18:4Net label point-tmp1: line 12:1point-tmp1