Re: [graphviz-interest] Straight line drawn as a curve (Petersen.gv)
"Emden R. Gansner" <[email protected]>
| Newsgroups | gmane.comp.video.graphviz |
|---|---|
| Message-ID | <[email protected]> |
On 8/21/13 5:49 AM, Ryan Schmidt wrote:
> Why has Graphviz drawn this line as three connected Bezier curves? The X-coordinate of each point is identical; it seems that this could just as easily have been a straight line from 17,647.95 directly to 17,108.05.
Short answer: it is an overlooked optimization.
After placing the nodes on discrete ranks, dot adds dummy nodes to each long edge so that all edges
join adjacent ranks. This graph is used for reducing
crossings and node positioning. During edge routing, dot constructs a collection of boxes in which
the edge is routed to avoid nodes, other edges, etc. It
also recognizes stretches where it can just use a straight line segment. For the edge 0 -- 5, the
edge is constructed by creating a Bezier through some boxes
at the beginning, followed by a vertical line (represented as a degenerate Bezier), and ending with
another Bezier through some boxes at the end. In this case,
it just happens to occur that the first and last Beziers are also vertical line segments collinear
with the middle segment. This would be fairly rare, so there is
no check for it, and no attempt to simplify the final output.
Emden
_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest