KLayout Manual: Main Index » KLayout User Manual » KLayout Basics » Ruler Properties Ruler Properties
These are the properties that can be configured for rulers:
- Labels: depending on the outline of the ruler, up to three labels an be present.
Each label can be configure individually to either show a text or the measurement
values. The main label is always present, X and Y labels are only present, if the ruler
has an explicit vertical or horizontal component (all outline styles except "diagonal").
- Style: the style determines how the ruler or it's components are drawn. This can be
"ruler-like" (with ticks), arrow style or a plain line.
- Outline: the outline determines how the two points forming the ruler are connected
to render the ruler shape. This is either just one line ("diagonal"), a horizontal and a vertical line
(in some outline styles combined with the diagonal line) or a box given by the two points of the
ruler.
- Angle constraint: the orientation of the ruler can be restricted in several ways, i.e.
just being horizontal. By default, the ruler uses the global setting. It can however be configured
to provide it's own constraint.
- Object snapping: each ruler can be configure to snap to the closest object edge or vertex.
By default, the rulers use the global setting. It may be disabled however for each ruler.
The label format is an arbitrary text with embedded expressions that may represent a measurement
value. Each such expression starts with a dollar sign, followed by the expression string. The expression
syntax supportis the basic operations ("*", "/", "+", "-" ..), bitwise operations ("|", "&", ..),
the conditional operator ("x:y?z") as well as some functions, i.e. "abs", "sqrt", "exp". It includes a "sprintf"
function. These are some examples:
- $X: The value of the X variable (the horizontal distance, see below for a complete list of variables).
- $(sprintf('%.2f',X)): The value of the 'X' variable formatted as two digit fixed precision value.
- $(abs(X)+abs(Y)): The manhattan distance of the ruler.
- $min(X,Y): The minimum of X and Y.
A description of the expression syntax and the functions available can be found in About Expressions.
This is a list of all variables available:
- D: The length of the ruler in micron units.
- L: The manhattan length of the ruler in micron units.
- U: The x-position of the ruler's first point in micron units.
- V: The y-position of the ruler's first point in micron units.
- P: The x-position of the ruler's second point in micron units.
- Q: The y-position of the ruler's second point in micron units.
- X: The horizontal extension of the ruler in micron units.
- Y: The vertical extension of the ruler in micron units.
- A: The area enclosed by the ruler (if it was a box) in square millimeters.
|