Is there an easy way to create edge between edges on fletcher?

I’ve checked the manual, and it seems the only way to create an edge between edges is by doing it manually.

#diagram(spacing: 2cm, {
let (A, B) = ((0,0), (1,0))
node(A, $cal(A)$)
node(B, $cal(B)$)
edge(A, B, $F$, "->", bend: +35deg)
edge(A, B, $G$, "->", bend: -35deg)
let h = 0.2
edge((.5,-h), (.5,+h), $alpha$, "=>")
})

Is there a way to get the coordinates of the midpoint of an edge? Or maybe a trick to pass an edge as an argument to another edge?

Currently not, sadly. However, now that fletcher has support for cetz anchors, this could be easily added by allowing edges to be named and giving them path anchors, like in cetz:

#cetz.canvas({
	import cetz.draw
	draw.line((0,0), (1,2), (3,1), stroke: 1pt, name: "hi")
	draw.content("hi.75%", $ circle $)
})

I’ve just made a feature request for it: Edge names and anchors · Issue #96 · Jollywatt/typst-fletcher · GitHub

1 Like