Feat/zigzag at #35

Open
dstadelm wants to merge 4 commits from dstadelm/circuiteria:feat/zigzag-at into main
pull from: dstadelm/circuiteria:feat/zigzag-at
First-time contributor

Add the possibility to define where the zigzag bends using anchors. E.g. one zigzag can be the master and others use the master to follow where there bends shall be. Helps for wire routing in general.

Add the possibility to define where the zigzag bends using anchors. E.g. one zigzag can be the master and others use the master to follow where there bends shall be. Helps for wire routing in general.
dstadelm added 4 commits 2026-10-21 22:56:40 +00:00
CeTZ 0.5.2 requires 3D coordinate vectors (x, y, z) for raw
coordinate tuples passed to coordinate.resolve(). Update internal
wire computations (dodge, guided) to use 3-element tuples, fix
.last() to .at(1) for y-component access on resolved coordinates,
and add a normalize-coord utility that automatically pads user-
provided 2D points (x, y) to (x, y, 0) so users do not need to
specify the z dimension.
Add the `zigzag-at` parameter to place the middle bend of a zigzag wire
on the axis of a referenced anchor. It overrides `zigzag-ratio`, which
now defaults to `auto` (resolving to 50%) so the two are mutually
exclusive. Accepted forms are an anchor name, any CeTZ coordinate, or
the scalar offset `(rel: <length>, to: <coord>)`.

Add the generic helpers this relies on and that other wire styles reuse:
- `normalize-scalar-offset(at, axis)` turns a scalar offset into an x or
  y offset; `normalize-zigzag-at` is a wrapper around it.
- `detect-port-side(anchor, ctx)` deduces the cardinal side a port faces
  by comparing it with its element's `.center` anchor.

Add the `zigzag-at` example.
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u https://git.kb28.ch/dstadelm/circuiteria feat/zigzag-at:dstadelm-feat/zigzag-at
git checkout dstadelm-feat/zigzag-at
Sign in to join this conversation.