mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2024-12-23 00:16:27 +02:00
cameo: changed dog_bone from global variable to argument
- cameo.c (dog_bone, main): moved global variable to "main" - cameo.c (process_path, process_paths, main): pass dog_bone as argument
This commit is contained in:
parent
f80a01a9c0
commit
1f63ef6391
@ -20,10 +20,7 @@
|
||||
#include "gerber.h"
|
||||
|
||||
|
||||
static int dog_bone = 0;
|
||||
|
||||
|
||||
static void process_path(struct path *path, int inside)
|
||||
static void process_path(struct path *path, int inside, int dog_bone)
|
||||
{
|
||||
int left;
|
||||
struct path *new;
|
||||
@ -37,7 +34,7 @@ static void process_path(struct path *path, int inside)
|
||||
}
|
||||
|
||||
|
||||
static void process_paths(struct path *paths)
|
||||
static void process_paths(struct path *paths, int dog_bone)
|
||||
{
|
||||
struct path *leftmost, *path;
|
||||
|
||||
@ -55,11 +52,11 @@ static void process_paths(struct path *paths)
|
||||
leftmost = path_find_leftmost(paths);
|
||||
for (path = paths; path; path = path->next)
|
||||
if (path != leftmost && !path->outside)
|
||||
process_path(path, 1);
|
||||
process_path(path, 1, dog_bone);
|
||||
for (path = paths; path; path = path->next)
|
||||
if (path != leftmost && path->outside)
|
||||
process_path(path, 0);
|
||||
process_path(leftmost, 0);
|
||||
process_path(path, 0, dog_bone);
|
||||
process_path(leftmost, 0, dog_bone);
|
||||
}
|
||||
|
||||
|
||||
@ -78,7 +75,7 @@ static void usage(const char *name)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *in = NULL, *out = NULL;
|
||||
int gerber = 0;
|
||||
int gerber = 0, dog_bone = 0;
|
||||
double r;
|
||||
struct path *paths;
|
||||
int c;
|
||||
@ -113,7 +110,7 @@ int main(int argc, char **argv)
|
||||
paths = gerber_read(in, r);
|
||||
else
|
||||
paths = gnuplot_read(in, r);
|
||||
process_paths(paths);
|
||||
process_paths(paths, dog_bone);
|
||||
gnuplot_write(out, paths);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user