diff --git a/xs/src/libslic3r/Format/AMF.cpp b/xs/src/libslic3r/Format/AMF.cpp index 96e35e5287..ffb9d5b9ec 100644 --- a/xs/src/libslic3r/Format/AMF.cpp +++ b/xs/src/libslic3r/Format/AMF.cpp @@ -485,7 +485,7 @@ bool load_amf(const char *path, Model *model) } int done = feof(pFile); if (XML_Parse(parser, buff, len, done) == XML_STATUS_ERROR) { - printf("AMF parser: Parse error at line %u:\n%s\n", + printf("AMF parser: Parse error at line %ul:\n%s\n", XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser))); break; @@ -527,7 +527,7 @@ bool store_amf(const char *path, Model *model) std::string instances; for (size_t object_id = 0; object_id < model->objects.size(); ++ object_id) { ModelObject *object = model->objects[object_id]; - fprintf(file, " \n", object_id); + fprintf(file, " \n", object_id); for (const std::string &key : object->config.keys()) fprintf(file, " %s\n", key.c_str(), object->config.serialize(key).c_str()); if (! object->name.empty()) @@ -556,9 +556,9 @@ bool store_amf(const char *path, Model *model) for (size_t i = 0; i < stl.stats.shared_vertices; ++ i) { fprintf(file, " \n"); fprintf(file, " \n"); - fprintf(file, " %s\n", stl.v_shared[i].x); - fprintf(file, " %s\n", stl.v_shared[i].x); - fprintf(file, " %s\n", stl.v_shared[i].x); + fprintf(file, " %f\n", stl.v_shared[i].x); + fprintf(file, " %f\n", stl.v_shared[i].y); + fprintf(file, " %f\n", stl.v_shared[i].z); fprintf(file, " \n"); fprintf(file, " \n"); } @@ -592,10 +592,10 @@ bool store_amf(const char *path, Model *model) for (ModelInstance *instance : object->instances) { char buf[512]; sprintf(buf, - " \n" - " %s\n" - " %s\n" - " %s\n" + " \n" + " %lf\n" + " %lf\n" + " %lf\n" " \n", object_id, instance->offset.x, diff --git a/xs/src/libslic3r/Format/objparser.cpp b/xs/src/libslic3r/Format/objparser.cpp index de622799e5..753fc462b0 100644 --- a/xs/src/libslic3r/Format/objparser.cpp +++ b/xs/src/libslic3r/Format/objparser.cpp @@ -1,4 +1,5 @@ #include +#include #include "objparser.hpp"