Number: 134
Title: Problem with Edge concentrators and -Tplain output in dot
Submitter: Tim Dwyer
Date: Sun Apr 21 22:02:14 2002
Subsys: Dot
Version: 1.8.2
System: x86-*-
Severity: minor
Problem:
with concentrate=true set and while using -Tplain to generate "simple" output from dot I've noticed that the edges generated do not seem to match those produced by the normal output (with concentrate=true set).

Worse, large graphs seem to cause a segfault!

Try the input file below both with and without -Tplain and note the difference between the edge curves generated for a->b and c->b
Input:

digraph states {
  graph [concentrate=true]
  a -> b
  a -> c -> b
  c -> d
  d -> b
}
Comments:
This would be really handy to have working, because my only other option is to write a (java) parser for the full file format!
Fix:
This is the simplest fix I could think of. Don't know if this is appropriate for everybody but it does the job for me.

--- diff (<=yours >=mine) ---
274c274
<       int                     i;
---
>       int                     i,j,splinePoints;
292c292,296
<                       bz = e->u.spl->list[0];
---
>             splinePoints = 0;
>             for (i = 0; i < e->u.spl->size; i++) {
>                           bz = e->u.spl->list[i];
>                 splinePoints += bz.size;
>             }
297,298c301,305
<                       fprintf(f," %d",bz.size);
<                       for (i = 0; i < bz.size; i++) printptf(f,bz.list[i]);
---
>                       fprintf(f," %d",splinePoints);
>             for (i = 0; i < e->u.spl->size; i++) {
>                           bz = e->u.spl->list[i];
>                           for (j = 0; j < bz.size; j++) printptf(f,bz.list[i]);
>             }

Owner: ellson
Status: Fixed (22 April 2002)