Measure
Precisely measure distances and align blocks effortlessly with Neural Sketch.
The \nskMeasure
command provides a powerful yet intuitive mechanism to accurately measure distances and align diagram components within your Neural Sketch diagrams. Whether you need blocks of precisely matching sizes, exact spacing between elements, or consistent alignment, this command simplifies your workflow.
Basic Usage
To measure distances between two points or anchor coordinates, use the \nskMeasure
macro as follows:
Once you've performed the measurement, you can immediately reuse the resulting length via the built-in macro \nskDistance
.
Example: Matching Block Widths
Here's how you can measure the width between two blocks and then set a new block to precisely match that measured width:
This ensures c
matches precisely the combined width of a
and b
, providing visual consistency and exact alignment across your diagram elements.
Available Options
Option | Type | Description | Default |
---|---|---|---|
axis | Enum (horizontal , vertical ) | Axis along which the measurement is taken. | horizontal |
from | Anchor | Starting anchor coordinate for measurement. | required |
to | Anchor | Ending anchor coordinate for measurement. | required |
Practical Use Cases
- Consistent Spacing: Maintain equal spacing between elements across your figures.
- Dynamic Sizing: Create adaptive blocks or containers that adjust sizes based on other elements.
- Perfect Alignment: Ensure elements line up precisely, essential for professional-quality diagrams.
Best Practices
- Always explicitly state the axis to ensure clarity.
- Use descriptive block IDs for
from
andto
anchors to maintain readability. - Consider adding descriptive labels or annotations to measured elements to facilitate reviewing and editing.
Reference
Prop | Type | Default |
---|---|---|
axis? | choice | horizontal |
from? | token list | {} |
to? | token list | {} |