72eab1620cb35bfb48f75b755b3813f88b6c8f62
Introduce a new `zigzag-at` parameter on `wire.wire` as an alternative
to `zigzag-ratio` for positioning the middle bend segment of a
`style: "zigzag"` wire. Instead of a fraction of the endpoint span,
the bend is placed on the axis of a referenced anchor via CeTZ's
perpendicular operator (`|-`):
- zigzag-dir "vertical": segment sits at anchor.x
- zigzag-dir "horizontal": segment sits at anchor.y
Accepted forms:
- str — raw CeTZ anchor name (e.g. port anchor
"elmt-port-id" or "elmt.center")
- array / native CeTZ dict — used as-is
- (rel: <length>, to: <coord>) with scalar rel — ergonomic axial
offset, rewritten to (rel: (dx, 0), to: ...) for vertical dir or
(rel: (0, dy), to: ...) for horizontal dir
`zigzag-ratio` default flipped from `50%` to `auto` (still resolves
to 50%) to allow detecting an explicit user override. Panics on
misuse:
- `zigzag-at` set together with an explicit `zigzag-ratio`
- `zigzag-at` set with a non-zigzag `style`
Add `examples.zigzag-at` demonstrating both the string-anchor and the
ergonomic offset forms.
circuiteria
Circuiteria is a Typst package for drawing block circuit diagrams using the CeTZ package.
Examples
|
|
| A bit of everything | |
|
|
| Wires everywhere | |
|
|
| Groups | Rotated |
Note
These circuit layouts were copied from a digital design course given by prof. S. Zahno and recreated using this package
Click on the example image to jump to the code.
Usage
For more information, see the manual
To use this package, simply import circuiteria and call the circuit function:
#import "@preview/circuiteria:0.2.1"
#circuiteria.circuit({
import circuiteria: *
...
})
Description
Drawing block circuits with Typst made easy, using CeTZ
https://typst.app/universe/package/circuiteria
Readme
Apache-2.0
4.2 MiB
7 Stars
4 Watchers
7 Forks
