From b178a1b04f7d5d2f8f46dfb3d53c7bce298d720e Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 27 Jan 2021 15:53:44 +0100 Subject: [PATCH] 3mf export - Do not export unneeded space --- src/libslic3r/Format/3mf.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index c85e4bcd3..fada01ea2 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -2193,9 +2193,9 @@ namespace Slic3r { std::stringstream stream; stream << "\n"; stream << "\n"; - stream << " \n"; - stream << " \n"; - stream << " \n"; + stream << " \n"; + stream << " \n"; + stream << " \n"; stream << ""; std::string out = stream.str(); @@ -2232,8 +2232,8 @@ namespace Slic3r { std::stringstream stream; stream << "\n"; stream << "\n"; - stream << " \n"; - stream << " \n"; + stream << " \n"; + stream << " \n"; stream << ""; std::string out = stream.str(); @@ -2379,7 +2379,7 @@ namespace Slic3r { else { stream << " <" << COMPONENTS_TAG << ">\n"; - stream << " <" << COMPONENT_TAG << " objectid=\"" << object_id << "\" />\n"; + stream << " <" << COMPONENT_TAG << " objectid=\"" << object_id << "\"/>\n"; stream << " \n"; } @@ -2502,7 +2502,7 @@ namespace Slic3r { ptr = format_coordinate(v.y(), ptr); boost::spirit::karma::generate(ptr, "\" z=\""); ptr = format_coordinate(v.z(), ptr); - boost::spirit::karma::generate(ptr, "\" />\n"); + boost::spirit::karma::generate(ptr, "\"/>\n"); *ptr = '\0'; output_buffer += buf; if (! flush()) @@ -2540,7 +2540,7 @@ namespace Slic3r { boost::spirit::karma::generate(ptr, boost::spirit::lit(" <") << TRIANGLE_TAG << " v1=\"" << boost::spirit::int_ << "\" v2=\"" << boost::spirit::int_ << - "\" v3=\"" << boost::spirit::int_ << "\" ", + "\" v3=\"" << boost::spirit::int_ << "\"", idx[0] + volume_it->second.first_vertex_id, idx[1] + volume_it->second.first_vertex_id, idx[2] + volume_it->second.first_vertex_id); @@ -2550,18 +2550,20 @@ namespace Slic3r { std::string custom_supports_data_string = volume->supported_facets.get_triangle_as_string(i); if (! custom_supports_data_string.empty()) { + output_buffer += " "; output_buffer += CUSTOM_SUPPORTS_ATTR; output_buffer += "=\""; output_buffer += custom_supports_data_string; - output_buffer += "\" "; + output_buffer += "\""; } std::string custom_seam_data_string = volume->seam_facets.get_triangle_as_string(i); if (! custom_seam_data_string.empty()) { + output_buffer += " "; output_buffer += CUSTOM_SEAM_ATTR; output_buffer += "=\""; output_buffer += custom_seam_data_string; - output_buffer += "\" "; + output_buffer += "\""; } output_buffer += "/>\n"; @@ -2603,7 +2605,7 @@ namespace Slic3r { stream << " "; } } - stream << "\" " << PRINTABLE_ATTR << "=\"" << item.printable << "\" />\n"; + stream << "\" " << PRINTABLE_ATTR << "=\"" << item.printable << "\"/>\n"; } stream << " \n";