Values and units#
Input values#
Every length, frequency, angle or count parameter accepts a number or a string.
| You pass | Read as |
|---|---|
3 or 3.0 (a length) |
3 in the project's unit (em.Project(..., units="mm")) |
"3" (a length) |
the same as 3 |
"3mm", "120mil", "0.5in", "25um", "1.2cm", "0.002m", "500nm" |
that length in its own unit |
3 (a frequency) |
3 GHz |
"2.4GHz", "800MHz", "50kHz", "1e9Hz" |
that frequency |
"w/2 + 1mm" |
an expression of design variables, evaluated in SI |
45 (an angle) |
45 degrees |
Length units: m, cm, mm, um, nm, in, mil.
Expressions#
Expressions are evaluated in SI (metres, hertz), so give units on the numbers inside them:
"w/2 + 1mm", not "w/2 + 1" (which would add 1 metre). Variables hold SI values:
prj.variables["w"] = "3mm"
prj.variables["w"] # 0.003 (metres)
prj.variables.expression("w") # "3mm"
Expressions may use + - * / **, parentheses, comparisons, the functions sin cos tan asin acos atan
atan2 sinh cosh tanh sqrt log log10 exp abs min max floor ceil, the constants pi and e,
if(condition, a, b), and pwl(dataset, x) for datasets. Trigonometric
functions take radians.
A value given as an expression stays linked: when a variable it uses changes, every object built from it is rebuilt, and ports and boundaries on its faces follow.
prj.variables["L"] = "50mm"
air = prj.modeler.box("Air", size=(22.86, 10.16, "L"))
prj.variables["L"] = "60mm" # the box is now 60 mm long
Output values#
| Returned by | Unit |
|---|---|
prj.variables[name] |
SI (metres, hertz, plain numbers) |
Object.bounding_box() |
project units |
Object.volume, Object.area |
project units cubed / squared |
FaceRef.centroid, FaceRef.area |
metres, m² (a face reference's own fields) |
Object.shape |
a build123d shape in metres |
prj.picks.distance() |
project units |
SParameterResult.frequencies_ghz |
GHz |
SParameterResult.get_db(i, j) / get_phase_deg(i, j) |
dB / degrees |
Result.network() |
scikit-rf Network (frequencies in Hz inside) |
Result.eigenmodes() |
[(frequency_GHz, Q), ...] |
te10_studio.postprocess.networks functions |
f_GHz, t_ns, ohms, as named |
RF tool functions (te10_studio.rftools) |
SI: metres, hertz, ohms |