From cb070b2d3f2b6e241e3be1b7e0eeb90fc755255f Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Thu, 12 Nov 2026 01:28:13 +0300 Subject: publish --- src/path.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/path.h (limited to 'src/path.h') 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 @@ +/// src/path.h +// +// Copyright (C) 2026 by Martin Michalec +// +// SPDX-License-Identifier: MIT +// +/// Commentary: +// +/// Code: + +#ifndef INCLUDED_PATH_H +#define INCLUDED_PATH_H + +#include "utils.h" +#include "rs274ngc_cst.h" +#include "vec2.h" + +#define PEF_TRAVERSING (1 << 0) // 0 means technological +#define PEF_ARC (1 << 1) // 0 means line +#define PEF_CCW (1 << 2) // 0 means CW +#define PEF_RELATIVE (1 << 3) // 0 means absolute +#define PEF_INCH (1 << 4) // 0 means mm +// ... + +struct path_element { + struct sv line; + double x, y; // end coords (abs mm) + double f; // feed rate (mm/s) + double i, j; // centers for arcs (abs mm) + int flags; +}; + +struct path { + struct path_element *items; + uint32_t count; + uint32_t capacity; + double initial_x; + double initial_y; +}; + +struct path build_path (struct rs274ngc_cst_parser parser); +struct vec2 path_element_start (const struct path *, const struct path_element *); + +#endif // INCLUDED_PATH_H + +/// src/path.h ends here -- cgit v1.3.1