![]() |
Prusa Slicer 2.6.0
|
#include "../libslic3r.h"#include "../Exception.hpp"#include "../Model.hpp"#include "../Utils.hpp"#include "../LocalesUtils.hpp"#include "../GCode.hpp"#include "../Geometry.hpp"#include "../GCode/ThumbnailData.hpp"#include "../Semver.hpp"#include "../Time.hpp"#include "../I18N.hpp"#include "3mf.hpp"#include <limits>#include <stdexcept>#include <optional>#include <string_view>#include <boost/assign.hpp>#include <boost/bimap.hpp>#include <boost/filesystem.hpp>#include <boost/algorithm/string/split.hpp>#include <boost/algorithm/string/replace.hpp>#include <boost/spirit/include/karma.hpp>#include <boost/spirit/include/qi_int.hpp>#include <boost/log/trivial.hpp>#include <boost/property_tree/xml_parser.hpp>#include <expat.h>#include <Eigen/Dense>#include "miniz_extension.hpp"#include "TextConfiguration.hpp"#include <fast_float/fast_float.h>
Include dependency graph for 3mf.cpp:Go to the source code of this file.
Classes | |
| class | version_error |
| class | Slic3r::_3MF_Base |
| class | Slic3r::_3MF_Importer |
| struct | Slic3r::_3MF_Importer::Component |
| struct | Slic3r::_3MF_Importer::Geometry |
| struct | Slic3r::_3MF_Importer::CurrentObject |
| struct | Slic3r::_3MF_Importer::CurrentConfig |
| struct | Slic3r::_3MF_Importer::Instance |
| struct | Slic3r::_3MF_Importer::Metadata |
| struct | Slic3r::_3MF_Importer::ObjectMetadata |
| struct | Slic3r::_3MF_Importer::ObjectMetadata::VolumeMetadata |
| struct | Slic3r::_3MF_Importer::CutObjectInfo |
| struct | Slic3r::_3MF_Importer::CutObjectInfo::Connector |
| struct | Slic3r::TextConfigurationSerialization |
| class | Slic3r::_3MF_Exporter |
| struct | Slic3r::_3MF_Exporter::BuildItem |
| struct | Slic3r::_3MF_Exporter::Offsets |
| struct | Slic3r::_3MF_Exporter::ObjectData |
Namespaces | |
| namespace | Slic3r |
Macros | |
| #define | EXPORT_3MF_USE_SPIRIT_KARMA_FP 0 |
Typedefs | |
| using | Slic3r::TypeToName = boost::bimap< EmbossStyle::Type, std::string_view > |
| TextConfiguration serialization. | |
Functions | |
| const char * | get_attribute_value_charptr (const char **attributes, unsigned int attributes_size, const char *attribute_key) |
| std::string | get_attribute_value_string (const char **attributes, unsigned int attributes_size, const char *attribute_key) |
| float | get_attribute_value_float (const char **attributes, unsigned int attributes_size, const char *attribute_key) |
| int | get_attribute_value_int (const char **attributes, unsigned int attributes_size, const char *attribute_key) |
| bool | get_attribute_value_bool (const char **attributes, unsigned int attributes_size, const char *attribute_key) |
| Slic3r::Transform3d | get_transform_from_3mf_specs_string (const std::string &mat_str) |
| float | get_unit_factor (const std::string &unit) |
| bool | is_valid_object_type (const std::string &type) |
| static void | Slic3r::check_painting_version (unsigned int loaded_version, unsigned int highest_supported_version, const std::string &error_msg) |
| static void | Slic3r::reset_stream (std::stringstream &stream) |
| static void | Slic3r::handle_legacy_project_loaded (unsigned int version_project_file, DynamicPrintConfig &config, const boost::optional< Semver > &prusaslicer_generator_version) |
| bool | Slic3r::is_project_3mf (const std::string &filename) |
| bool | Slic3r::load_3mf (const char *path, DynamicPrintConfig &config, ConfigSubstitutionContext &config_substitutions, Model *model, bool check_version) |
| bool | Slic3r::store_3mf (const char *path, Model *model, const DynamicPrintConfig *config, bool fullpath_sources, const ThumbnailData *thumbnail_data, bool zip64) |
Variables | |
| const unsigned int | VERSION_3MF = 1 |
| const unsigned int | VERSION_3MF_COMPATIBLE = 2 |
| const char * | SLIC3RPE_3MF_VERSION = "slic3rpe:Version3mf" |
| const unsigned int | FDM_SUPPORTS_PAINTING_VERSION = 1 |
| const unsigned int | SEAM_PAINTING_VERSION = 1 |
| const unsigned int | MM_PAINTING_VERSION = 1 |
| const std::string | SLIC3RPE_FDM_SUPPORTS_PAINTING_VERSION = "slic3rpe:FdmSupportsPaintingVersion" |
| const std::string | SLIC3RPE_SEAM_PAINTING_VERSION = "slic3rpe:SeamPaintingVersion" |
| const std::string | SLIC3RPE_MM_PAINTING_VERSION = "slic3rpe:MmPaintingVersion" |
| const std::string | MODEL_FOLDER = "3D/" |
| const std::string | MODEL_EXTENSION = ".model" |
| const std::string | MODEL_FILE = "3D/3dmodel.model" |
| const std::string | CONTENT_TYPES_FILE = "[Content_Types].xml" |
| const std::string | RELATIONSHIPS_FILE = "_rels/.rels" |
| const std::string | THUMBNAIL_FILE = "Metadata/thumbnail.png" |
| const std::string | PRINT_CONFIG_FILE = "Metadata/Slic3r_PE.config" |
| const std::string | MODEL_CONFIG_FILE = "Metadata/Slic3r_PE_model.config" |
| const std::string | LAYER_HEIGHTS_PROFILE_FILE = "Metadata/Slic3r_PE_layer_heights_profile.txt" |
| const std::string | LAYER_CONFIG_RANGES_FILE = "Metadata/Prusa_Slicer_layer_config_ranges.xml" |
| const std::string | SLA_SUPPORT_POINTS_FILE = "Metadata/Slic3r_PE_sla_support_points.txt" |
| const std::string | SLA_DRAIN_HOLES_FILE = "Metadata/Slic3r_PE_sla_drain_holes.txt" |
| const std::string | CUSTOM_GCODE_PER_PRINT_Z_FILE = "Metadata/Prusa_Slicer_custom_gcode_per_print_z.xml" |
| const std::string | CUT_INFORMATION_FILE = "Metadata/Prusa_Slicer_cut_information.xml" |
| static constexpr const char * | MODEL_TAG = "model" |
| static constexpr const char * | RESOURCES_TAG = "resources" |
| static constexpr const char * | OBJECT_TAG = "object" |
| static constexpr const char * | MESH_TAG = "mesh" |
| static constexpr const char * | VERTICES_TAG = "vertices" |
| static constexpr const char * | VERTEX_TAG = "vertex" |
| static constexpr const char * | TRIANGLES_TAG = "triangles" |
| static constexpr const char * | TRIANGLE_TAG = "triangle" |
| static constexpr const char * | COMPONENTS_TAG = "components" |
| static constexpr const char * | COMPONENT_TAG = "component" |
| static constexpr const char * | BUILD_TAG = "build" |
| static constexpr const char * | ITEM_TAG = "item" |
| static constexpr const char * | METADATA_TAG = "metadata" |
| static constexpr const char * | CONFIG_TAG = "config" |
| static constexpr const char * | VOLUME_TAG = "volume" |
| static constexpr const char * | UNIT_ATTR = "unit" |
| static constexpr const char * | NAME_ATTR = "name" |
| static constexpr const char * | TYPE_ATTR = "type" |
| static constexpr const char * | ID_ATTR = "id" |
| static constexpr const char * | X_ATTR = "x" |
| static constexpr const char * | Y_ATTR = "y" |
| static constexpr const char * | Z_ATTR = "z" |
| static constexpr const char * | V1_ATTR = "v1" |
| static constexpr const char * | V2_ATTR = "v2" |
| static constexpr const char * | V3_ATTR = "v3" |
| static constexpr const char * | OBJECTID_ATTR = "objectid" |
| static constexpr const char * | TRANSFORM_ATTR = "transform" |
| static constexpr const char * | PRINTABLE_ATTR = "printable" |
| static constexpr const char * | INSTANCESCOUNT_ATTR = "instances_count" |
| static constexpr const char * | CUSTOM_SUPPORTS_ATTR = "slic3rpe:custom_supports" |
| static constexpr const char * | CUSTOM_SEAM_ATTR = "slic3rpe:custom_seam" |
| static constexpr const char * | MMU_SEGMENTATION_ATTR = "slic3rpe:mmu_segmentation" |
| static constexpr const char * | KEY_ATTR = "key" |
| static constexpr const char * | VALUE_ATTR = "value" |
| static constexpr const char * | FIRST_TRIANGLE_ID_ATTR = "firstid" |
| static constexpr const char * | LAST_TRIANGLE_ID_ATTR = "lastid" |
| static constexpr const char * | OBJECT_TYPE = "object" |
| static constexpr const char * | VOLUME_TYPE = "volume" |
| static constexpr const char * | NAME_KEY = "name" |
| static constexpr const char * | MODIFIER_KEY = "modifier" |
| static constexpr const char * | VOLUME_TYPE_KEY = "volume_type" |
| static constexpr const char * | MATRIX_KEY = "matrix" |
| static constexpr const char * | SOURCE_FILE_KEY = "source_file" |
| static constexpr const char * | SOURCE_OBJECT_ID_KEY = "source_object_id" |
| static constexpr const char * | SOURCE_VOLUME_ID_KEY = "source_volume_id" |
| static constexpr const char * | SOURCE_OFFSET_X_KEY = "source_offset_x" |
| static constexpr const char * | SOURCE_OFFSET_Y_KEY = "source_offset_y" |
| static constexpr const char * | SOURCE_OFFSET_Z_KEY = "source_offset_z" |
| static constexpr const char * | SOURCE_IN_INCHES_KEY = "source_in_inches" |
| static constexpr const char * | SOURCE_IN_METERS_KEY = "source_in_meters" |
| static constexpr const char * | SOURCE_IS_BUILTIN_VOLUME_KEY = "source_is_builtin_volume" |
| static constexpr const char * | MESH_STAT_EDGES_FIXED = "edges_fixed" |
| static constexpr const char * | MESH_STAT_DEGENERATED_FACETS = "degenerate_facets" |
| static constexpr const char * | MESH_STAT_FACETS_REMOVED = "facets_removed" |
| static constexpr const char * | MESH_STAT_FACETS_RESERVED = "facets_reversed" |
| static constexpr const char * | MESH_STAT_BACKWARDS_EDGES = "backwards_edges" |
| static constexpr const char * | TEXT_TAG = "slic3rpe:text" |
| static constexpr const char * | TEXT_DATA_ATTR = "text" |
| static constexpr const char * | STYLE_NAME_ATTR = "style_name" |
| static constexpr const char * | FONT_DESCRIPTOR_ATTR = "font_descriptor" |
| static constexpr const char * | FONT_DESCRIPTOR_TYPE_ATTR = "font_descriptor_type" |
| static constexpr const char * | CHAR_GAP_ATTR = "char_gap" |
| static constexpr const char * | LINE_GAP_ATTR = "line_gap" |
| static constexpr const char * | LINE_HEIGHT_ATTR = "line_height" |
| static constexpr const char * | DEPTH_ATTR = "depth" |
| static constexpr const char * | USE_SURFACE_ATTR = "use_surface" |
| static constexpr const char * | BOLDNESS_ATTR = "boldness" |
| static constexpr const char * | SKEW_ATTR = "skew" |
| static constexpr const char * | DISTANCE_ATTR = "distance" |
| static constexpr const char * | ANGLE_ATTR = "angle" |
| static constexpr const char * | COLLECTION_NUMBER_ATTR = "collection" |
| static constexpr const char * | FONT_FAMILY_ATTR = "family" |
| static constexpr const char * | FONT_FACE_NAME_ATTR = "face_name" |
| static constexpr const char * | FONT_STYLE_ATTR = "style" |
| static constexpr const char * | FONT_WEIGHT_ATTR = "weight" |
| const unsigned int | VALID_OBJECT_TYPES_COUNT = 1 |
| const char * | VALID_OBJECT_TYPES [] |
| const char * | INVALID_OBJECT_TYPES [] |
| struct Slic3r::_3MF_Importer::ObjectMetadata |
Collaboration diagram for Slic3r::_3MF_Importer::ObjectMetadata:| Class Members | ||
|---|---|---|
| typedef vector< VolumeMetadata > | VolumeMetadataList | |
| Class Members | ||
|---|---|---|
| MetadataList | metadata | |
| VolumeMetadataList | volumes | |
| struct Slic3r::_3MF_Importer::CutObjectInfo |
Collaboration diagram for Slic3r::_3MF_Importer::CutObjectInfo:| Class Members | ||
|---|---|---|
| vector< Connector > | connectors | |
| CutObjectBase | id | |
| struct Slic3r::_3MF_Importer::CutObjectInfo::Connector |
| #define EXPORT_3MF_USE_SPIRIT_KARMA_FP 0 |
| bool get_attribute_value_bool | ( | const char ** | attributes, |
| unsigned int | attributes_size, | ||
| const char * | attribute_key | ||
| ) |
References get_attribute_value_charptr().
Referenced by Slic3r::_3MF_Importer::_handle_start_item().
Here is the call graph for this function:
Here is the caller graph for this function:| const char * get_attribute_value_charptr | ( | const char ** | attributes, |
| unsigned int | attributes_size, | ||
| const char * | attribute_key | ||
| ) |
Referenced by get_attribute_value_bool(), get_attribute_value_float(), get_attribute_value_int(), and get_attribute_value_string().
Here is the caller graph for this function:| float get_attribute_value_float | ( | const char ** | attributes, |
| unsigned int | attributes_size, | ||
| const char * | attribute_key | ||
| ) |
References fast_float::from_chars(), and get_attribute_value_charptr().
Referenced by Slic3r::_3MF_Importer::_handle_start_vertex(), and Slic3r::TextConfigurationSerialization::read().
Here is the call graph for this function:
Here is the caller graph for this function:| int get_attribute_value_int | ( | const char ** | attributes, |
| unsigned int | attributes_size, | ||
| const char * | attribute_key | ||
| ) |
References get_attribute_value_charptr().
Referenced by Slic3r::_3MF_Importer::_handle_start_component(), Slic3r::_3MF_Importer::_handle_start_config_object(), Slic3r::_3MF_Importer::_handle_start_config_volume(), Slic3r::_3MF_Importer::_handle_start_config_volume_mesh(), Slic3r::_3MF_Importer::_handle_start_item(), Slic3r::_3MF_Importer::_handle_start_object(), Slic3r::_3MF_Importer::_handle_start_triangle(), and Slic3r::TextConfigurationSerialization::read().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string get_attribute_value_string | ( | const char ** | attributes, |
| unsigned int | attributes_size, | ||
| const char * | attribute_key | ||
| ) |
References get_attribute_value_charptr().
Referenced by Slic3r::_3MF_Importer::_handle_start_component(), Slic3r::_3MF_Importer::_handle_start_config_metadata(), Slic3r::_3MF_Importer::_handle_start_item(), Slic3r::_3MF_Importer::_handle_start_metadata(), Slic3r::_3MF_Importer::_handle_start_model(), Slic3r::_3MF_Importer::_handle_start_object(), Slic3r::_3MF_Importer::_handle_start_triangle(), and Slic3r::TextConfigurationSerialization::read().
Here is the call graph for this function:
Here is the caller graph for this function:| Slic3r::Transform3d get_transform_from_3mf_specs_string | ( | const std::string & | mat_str | ) |
References Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign >::Identity().
Referenced by Slic3r::_3MF_Importer::_handle_start_component(), Slic3r::_3MF_Importer::_handle_start_item(), and Slic3r::TextConfigurationSerialization::read().
Here is the call graph for this function:
Here is the caller graph for this function:| float get_unit_factor | ( | const std::string & | unit | ) |
Referenced by Slic3r::_3MF_Importer::_handle_start_model().
Here is the caller graph for this function:| bool is_valid_object_type | ( | const std::string & | type | ) |
References VALID_OBJECT_TYPES, and VALID_OBJECT_TYPES_COUNT.
Referenced by Slic3r::_3MF_Importer::_handle_start_object().
Here is the caller graph for this function:
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
| const std::string CONTENT_TYPES_FILE = "[Content_Types].xml" |
Referenced by Slic3r::_3MF_Exporter::_add_content_types_file_to_archive().
| const std::string CUSTOM_GCODE_PER_PRINT_Z_FILE = "Metadata/Prusa_Slicer_custom_gcode_per_print_z.xml" |
|
staticconstexpr |
|
staticconstexpr |
| const std::string CUT_INFORMATION_FILE = "Metadata/Prusa_Slicer_cut_information.xml" |
|
staticconstexpr |
|
staticconstexpr |
| const unsigned int FDM_SUPPORTS_PAINTING_VERSION = 1 |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Referenced by Slic3r::_3MF_Exporter::_add_model_config_file_to_archive().
| const char* INVALID_OBJECT_TYPES[] |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
| const std::string LAYER_CONFIG_RANGES_FILE = "Metadata/Prusa_Slicer_layer_config_ranges.xml" |
| const std::string LAYER_HEIGHTS_PROFILE_FILE = "Metadata/Slic3r_PE_layer_heights_profile.txt" |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Referenced by Slic3r::_3MF_Exporter::_add_mesh_to_object_stream(), Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_3MF_Importer::_handle_end_config_xml_element(), Slic3r::_3MF_Importer::_handle_end_model_xml_element(), Slic3r::_3MF_Importer::_handle_start_config_xml_element(), and Slic3r::_3MF_Importer::_handle_start_model_xml_element().
|
staticconstexpr |
Referenced by Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_3MF_Exporter::_add_model_file_to_archive(), Slic3r::_3MF_Importer::_handle_end_config_xml_element(), Slic3r::_3MF_Importer::_handle_end_model_xml_element(), Slic3r::_3MF_Importer::_handle_start_config_xml_element(), and Slic3r::_3MF_Importer::_handle_start_model_xml_element().
| const unsigned int MM_PAINTING_VERSION = 1 |
|
staticconstexpr |
| const std::string MODEL_CONFIG_FILE = "Metadata/Slic3r_PE_model.config" |
| const std::string MODEL_EXTENSION = ".model" |
Referenced by Slic3r::_3MF_Importer::_load_model_from_file().
| const std::string MODEL_FILE = "3D/3dmodel.model" |
| const std::string MODEL_FOLDER = "3D/" |
Referenced by Slic3r::_3MF_Importer::_load_model_from_file().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Referenced by Slic3r::_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_3MF_Exporter::_add_object_to_model_stream(), Slic3r::_3MF_Importer::_handle_end_config_xml_element(), Slic3r::_3MF_Importer::_handle_end_model_xml_element(), Slic3r::_3MF_Importer::_handle_start_config_xml_element(), and Slic3r::_3MF_Importer::_handle_start_model_xml_element().
|
staticconstexpr |
|
staticconstexpr |
| const std::string PRINT_CONFIG_FILE = "Metadata/Slic3r_PE.config" |
|
staticconstexpr |
| const std::string RELATIONSHIPS_FILE = "_rels/.rels" |
Referenced by Slic3r::_3MF_Exporter::_add_relationships_file_to_archive().
|
staticconstexpr |
| const unsigned int SEAM_PAINTING_VERSION = 1 |
|
staticconstexpr |
| const std::string SLA_DRAIN_HOLES_FILE = "Metadata/Slic3r_PE_sla_drain_holes.txt" |
| const std::string SLA_SUPPORT_POINTS_FILE = "Metadata/Slic3r_PE_sla_support_points.txt" |
| const char* SLIC3RPE_3MF_VERSION = "slic3rpe:Version3mf" |
| const std::string SLIC3RPE_FDM_SUPPORTS_PAINTING_VERSION = "slic3rpe:FdmSupportsPaintingVersion" |
| const std::string SLIC3RPE_MM_PAINTING_VERSION = "slic3rpe:MmPaintingVersion" |
| const std::string SLIC3RPE_SEAM_PAINTING_VERSION = "slic3rpe:SeamPaintingVersion" |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
| const std::string THUMBNAIL_FILE = "Metadata/thumbnail.png" |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Referenced by Slic3r::_3MF_Importer::_handle_start_model().
|
staticconstexpr |
|
staticconstexpr |
Referenced by Slic3r::_3MF_Importer::_handle_start_triangle().
|
staticconstexpr |
Referenced by Slic3r::_3MF_Importer::_handle_start_triangle().
|
staticconstexpr |
Referenced by Slic3r::_3MF_Importer::_handle_start_triangle().
| const char* VALID_OBJECT_TYPES[] |
Referenced by is_valid_object_type().
| const unsigned int VALID_OBJECT_TYPES_COUNT = 1 |
Referenced by is_valid_object_type().
|
staticconstexpr |
| const unsigned int VERSION_3MF = 1 |
Referenced by Slic3r::_3MF_Exporter::_add_model_file_to_archive().
| const unsigned int VERSION_3MF_COMPATIBLE = 2 |
Referenced by Slic3r::_3MF_Importer::_handle_end_metadata().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Referenced by Slic3r::_3MF_Importer::_handle_start_vertex().
|
staticconstexpr |
Referenced by Slic3r::_3MF_Importer::_handle_start_vertex().
|
staticconstexpr |
Referenced by Slic3r::_3MF_Importer::_handle_start_vertex().