diff --git a/doc/examples.typ b/doc/examples.typ index ba606cb..d968bf9 100644 --- a/doc/examples.typ +++ b/doc/examples.typ @@ -140,4 +140,11 @@ element.block(id: "b3", w: 2, h: 3, wire.wire("w1", ("b1-port-out", "b3-port-in1")) wire.wire("w2", ("b2-port-out", "b3-port-in2"), style: "zigzag") +```) + +#let intersection = example(``` +wire.wire("w1", ((0, 0), (1, 1)), style: "zigzag") +wire.wire("w2", ((0, 0), (1, -.5)), + style: "zigzag", zigzag-ratio: 80%) +wire.intersection("w1.zig") ```) \ No newline at end of file diff --git a/manual.pdf b/manual.pdf index 590122d..8b9e8ec 100644 Binary files a/manual.pdf and b/manual.pdf differ diff --git a/src/wire.typ b/src/wire.typ index 389ff01..07a3ac1 100644 --- a/src/wire.typ +++ b/src/wire.typ @@ -7,6 +7,11 @@ #let signal-width = 1pt #let bus-width = 1.5pt +/// Draws a wire intersection at the given anchor +/// #examples.intersection +/// - pt (point): A CeTZ compatible point / anchor +/// - radius (number): The radius of the intersection +/// - fill (color): The fill color #let intersection(pt, radius: .1, fill: black) = { draw.circle(pt, radius: radius, stroke: none, fill: fill) }