Date:2010-12-15 16:26:44 (13 years 3 months ago)
Author:Werner Almesberger
Commit:99592248d9a286c50adc76bcb49347b51ba0785c
Message:cameo/gerber.c (gerber_read): store coordinates as floats after conversion

They all were truncated.
Files: cameo/gerber.c (2 diffs)

Change Details

cameo/gerber.c
3737    int lineno = 0;
3838    char buf[1024];
3939    struct path *paths = NULL, **anchor = &paths, *path = NULL;
40    int start_x = 0, start_y = 0;
41    int x, y, d;
40    double start_x = 0, start_y = 0;
41    int xi, yi, d;
42    double x, y;
4243
4344    file = name ? fopen(name, "r") : stdin;
4445    if (!file) {
...... 
6465            }
6566            continue;
6667        }
67        if (sscanf(buf, "X%dY%dD%d*\n", &x, &y, &d) != 3)
68        if (sscanf(buf, "X%dY%dD%d*\n", &xi, &yi, &d) != 3)
6869            continue;
69        x = KU2MM(x);
70        y = KU2MM(y);
70        x = KU2MM(xi);
71        y = KU2MM(yi);
7172        switch (d) {
7273        case 1:
7374            if (!path) {

Archive Download the corresponding diff file

Branches:
master



interactive