Number: 1524
Title: still spline edges after setting attribute splines=false
Submitter: Stephan Hennig
Date: 2008-11-18
Subsys: dot
Version: 2.20.3
System: *-*-*
Severity: minor
Problem:
Symptom: Zooming into the output of the attached graph that sets attribute 'splines' to false, one can see that edges A->B and B->C are not drawn as plain line segments, but nearly straight Bézier curves. It looks like Graphviz tries to emulate line segments by "straight" Bézier curves, but numeric precision isn't good enough to obtain satisfying results. That is, control points are intended to lay on the ray between the endpoints, but they slightly diverge. The symptom can be observed with different output formats (GIF, PNG, JPG, EPS, PS, PS2, PDF).

Expected behaviour: According to documentation after setting graph attribute splines to false, edges are drawn as line segments, not Bézier curves. Graphviz should use true line segments:


(i) to avoid problems in numeric calculations during rendering,

(ii) to speed-up rendering of many edges in post-processing applications if output format is a vector format,

(iii) to yield smaller files (omitting unnecessary control points), if output format is a vector format.


Input:
digraph {
  graph[
    splines = false,
//    dpi = 600,
  ];
  A -> B;
  A -> C;
  B -> C;
}
Comments:
[erg] I have entered your bug report as a modification request. At present, edges are represented internally as a collection of B-splines. Line segments from point p to point q are represented as the Bezier (p,p,q,q). This may be tweaked due to clipping to node boundaries and adding arrowheads, but the resulting Bezier should be indistinguishable at any reasonable scale from a line segment, especially since we now represent points as two doubles.

Allowing explicit polylines would offer the advantages you suggest, but it would take a fair amount of effort to add this, and there are other changes we feel would be of more importance to users.
Owner: *
Status: Request