1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2025-04-21 12:27:27 +03:00

ptrude/: functions for path stretching and calculation of proportional length

This commit is contained in:
Werner Almesberger
2011-07-31 08:46:59 -03:00
parent c202eda676
commit 7ef626988c
2 changed files with 136 additions and 14 deletions

View File

@@ -22,6 +22,14 @@ struct vertex {
double d; /* max. distance of corner from ideal arc; 0 = prev */
const char *tag;
struct vertex *next;
/*
* "len" is set by path_set_len to the distance to the next vertex, or
* 0 if this is the last vertex in the path. round_path adjusts "len"
* such that it corresponds to the length of the same part of the
* original path.
*/
double len;
};
struct path {
@@ -32,7 +40,9 @@ struct path {
void free_path(struct path *path);
double path_set_length(struct path *path);
struct path *round_path(const struct path *path, double r, double d);
struct path *stretch_path(const struct path *path, double d);
struct path *load_path(FILE *file);
void save_path(FILE *file, const struct path *path);