diff options
Diffstat (limited to 'src/path.h')
| -rw-r--r-- | src/path.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/path.h b/src/path.h new file mode 100644 index 0000000..2355021 --- /dev/null +++ b/src/path.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /// src/path.h | ||
| 2 | // | ||
| 3 | // Copyright (C) 2026 by Martin Michalec <martin@michalec.dev> | ||
| 4 | // | ||
| 5 | // SPDX-License-Identifier: MIT | ||
| 6 | // | ||
| 7 | /// Commentary: | ||
| 8 | // | ||
| 9 | /// Code: | ||
| 10 | |||
| 11 | #ifndef INCLUDED_PATH_H | ||
| 12 | #define INCLUDED_PATH_H | ||
| 13 | |||
| 14 | #include "utils.h" | ||
| 15 | #include "rs274ngc_cst.h" | ||
| 16 | #include "vec2.h" | ||
| 17 | |||
| 18 | #define PEF_TRAVERSING (1 << 0) // 0 means technological | ||
| 19 | #define PEF_ARC (1 << 1) // 0 means line | ||
| 20 | #define PEF_CCW (1 << 2) // 0 means CW | ||
| 21 | #define PEF_RELATIVE (1 << 3) // 0 means absolute | ||
| 22 | #define PEF_INCH (1 << 4) // 0 means mm | ||
| 23 | // ... | ||
| 24 | |||
| 25 | struct path_element { | ||
| 26 | struct sv line; | ||
| 27 | double x, y; // end coords (abs mm) | ||
| 28 | double f; // feed rate (mm/s) | ||
| 29 | double i, j; // centers for arcs (abs mm) | ||
| 30 | int flags; | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct path { | ||
| 34 | struct path_element *items; | ||
| 35 | uint32_t count; | ||
| 36 | uint32_t capacity; | ||
| 37 | double initial_x; | ||
| 38 | double initial_y; | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct path build_path (struct rs274ngc_cst_parser parser); | ||
| 42 | struct vec2 path_element_start (const struct path *, const struct path_element *); | ||
| 43 | |||
| 44 | #endif // INCLUDED_PATH_H | ||
| 45 | |||
| 46 | /// src/path.h ends here | ||
