Hi,
I am trying to create a (fletcher) diagram that uses a node that looks like an arrow, like this:
I have created a new node shape, which looks like this:
#import "@preview/fletcher:0.5.8": *
#let arrow(node, extrude) = {
let (w,h) = node.size
let x = w/2 * 1.5
let y = h/2 * 1.5
let a_width = h/3
let a_len = w/2
let obj = draw.line(
(-x, 0pt),
(-a_len, -y),
(-a_len, -a_width),
(+a_len, -a_width),
(+a_len, -y),
(+x, 0pt),
(+x, 0pt),
(+a_len, +y),
(+a_len, +a_width),
(-a_len, +a_width),
(-a_len, +y),
(-x, 0pt),
close: true
)
draw.group(obj)
},
This brings me to the following:
How do I get the edges to connect to the stroke of the arrow?
Full figure:
#set page(width: auto, height: auto)
#import "@preview/fletcher:0.5.8": *
#diagram(
node-stroke: 0.5pt,
spacing: (1em, 1em),
let arrow(node, extrude) = {
let (w,h) = node.size
let x = w/2 * 1.5
let y = h/2 * 1.5
let a_width = h/3
let a_len = w/2
let obj = draw.line(
(-x, 0pt),
(-a_len, -y),
(-a_len, -a_width),
(+a_len, -a_width),
(+a_len, -y),
(+x, 0pt),
(+x, 0pt),
(+a_len, +y),
(+a_len, +a_width),
(-a_len, +a_width),
(-a_len, +y),
(-x, 0pt),
close: true
)
draw.group(obj)
},
node((0,-2), [node2], name: <node2>),
edge(<node2.south>, <node1.north>, "O-@"),
node(enclose: ((-5,0), (5,0)) , [node1], shape: arrow, name: <node1>),
)