From 13b65f01132c41be9ab8d9f92c2c5ca605c366d8 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Sat, 29 May 2021 14:24:31 +0200 Subject: changed repo structure and commited releease files such that default docker-compose worklow commands work in testvm --- src/stlfile.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/stlfile.h (limited to 'src/stlfile.h') diff --git a/src/stlfile.h b/src/stlfile.h new file mode 100644 index 0000000..d321282 --- /dev/null +++ b/src/stlfile.h @@ -0,0 +1,54 @@ +#ifndef STLFILE_H +#define STLFILE_H + +#include +#include +#include +#include +#include + +#include "util.h" + +enum { + KW_INVALID = -1, + KW_UNKNOWN, + KW_SOLID_BEGIN, + KW_SOLID_END, + KW_FACET_BEGIN, + KW_FACET_END, + KW_LOOP_BEGIN, + KW_LOOP_END, + KW_VERTEX +}; + +enum { + STATE_SOLID, + STATE_FACET, + STATE_LOOP +}; + +enum { + TYPE_ASCII, + TYPE_BIN +}; + +struct stack { + int *data; + size_t count, cap; +}; + +struct parseinfo { + char header[80], *hash, *modelname, *solidname; + uint32_t loopcount; + unsigned filesize; + float bbmin[3], bbmax[3]; + int type, valid; +}; + +int parse_file(struct parseinfo *info, char *buf, size_t len); +int save_info(struct parseinfo *info, FILE *f); +int load_info(struct parseinfo *info, FILE *f); +void print_info(struct parseinfo *info); +void free_info(struct parseinfo *info); + +#endif /* STLFILE_H */ -- cgit v1.2.3-71-gd317