fn beam(graph: &mut Graph, node: &mut Node, position: Point, direction: Point)
Traces the path of a beam until we hit the flat side of another splitter or exit the grid.