Custom shapes and fixed connection locations

I am trying to use Graphviz to create images of simple logic circuits using the standard inverters, two-input AND/OR gates.

I have written it as a simple directed graph with rankdir=LR (because that's what I want) and I'm using the image attribute.

I created PNGs for the 3 types of gates such that the port connections are symmetrical. For instance,
Inverter = input connection is exactly half distance between the top and bottom
Two-input gates = inputs are at the 0.25 and 0.75 points.
And for all three gates the single output is exactly half distance between top and bottom.

The problem is that when Graphviz connects the edge to the node, it does it at any point on the bounding box of the node. I would really like it to be at the connection point as specified in my source PNG (ie., at the 0.25 and 0.75 points)

Is there any way to do this? I know about the 8 compass points in the node ports but having ":w" on all inputs didn't really help.

Recent comments