mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2024-12-23 09:55:32 +02:00
17afa3e2bb
- cameo/path.h, cameo/path.c (path_replace): replace a path in a list of paths with a different path - cameo/path.h, cameo/path.c (path_find_leftmost): find the leftmost path in a list of paths - cameo/path.h, cameo/path.c (path_free): move freeing of points to separate function free_points, for sharing with path_replace - cameo/cameo.c (main): move path processing to new function process_paths - cameo/cameo.c (process_paths): treat the leftmost path a outside path and process it last. Treat all others as inside paths.
40 lines
1003 B
C
40 lines
1003 B
C
/*
|
|
* path.h - Toolpath operations
|
|
*
|
|
* Written 2010 by Werner Almesberger
|
|
* Copyright 2010 Werner Almesberger
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
|
|
#ifndef PATH_H
|
|
#define PATH_H
|
|
|
|
|
|
struct point {
|
|
double x, y, z; /* mm */
|
|
struct point *next;
|
|
};
|
|
|
|
struct path {
|
|
struct point *first, *last;
|
|
double r_tool; /* mm */
|
|
struct path *next;
|
|
};
|
|
|
|
|
|
struct path *path_new(double r_tool);
|
|
void path_add(struct path *path, double x, double y, double z);
|
|
void path_replace(struct path *old, struct path *new);
|
|
struct path *path_reverse(const struct path *path);
|
|
int path_tool_is_left(const struct path *path);
|
|
struct path *path_offset(const struct path *path, int left, int notch);
|
|
struct path *path_find_leftmost(struct path *path);
|
|
void path_free(struct path *path);
|
|
|
|
#endif /* !PATH_H */
|