mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2024-12-23 13:24:15 +02:00
cameo/gerber.c (gerber_read): store coordinates as floats after conversion
They all were truncated.
This commit is contained in:
parent
7cb25c5a3f
commit
99592248d9
@ -37,8 +37,9 @@ struct path *gerber_read(const char *name, double r_tool_default)
|
|||||||
int lineno = 0;
|
int lineno = 0;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
struct path *paths = NULL, **anchor = &paths, *path = NULL;
|
struct path *paths = NULL, **anchor = &paths, *path = NULL;
|
||||||
int start_x = 0, start_y = 0;
|
double start_x = 0, start_y = 0;
|
||||||
int x, y, d;
|
int xi, yi, d;
|
||||||
|
double x, y;
|
||||||
|
|
||||||
file = name ? fopen(name, "r") : stdin;
|
file = name ? fopen(name, "r") : stdin;
|
||||||
if (!file) {
|
if (!file) {
|
||||||
@ -64,10 +65,10 @@ struct path *gerber_read(const char *name, double r_tool_default)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sscanf(buf, "X%dY%dD%d*\n", &x, &y, &d) != 3)
|
if (sscanf(buf, "X%dY%dD%d*\n", &xi, &yi, &d) != 3)
|
||||||
continue;
|
continue;
|
||||||
x = KU2MM(x);
|
x = KU2MM(xi);
|
||||||
y = KU2MM(y);
|
y = KU2MM(yi);
|
||||||
switch (d) {
|
switch (d) {
|
||||||
case 1:
|
case 1:
|
||||||
if (!path) {
|
if (!path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user