Skip to content

Commit

Permalink
Add data structure for 3MF Material Extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir55 committed Jun 24, 2017
1 parent 7c1ed68 commit c4b133e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
14 changes: 14 additions & 0 deletions xs/src/libslic3r/IO/TMF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,21 @@ struct TMFEditor
// Close the material color group if it's open.
if(color_group_written)
append_buffer("</m:colorgroup>\n");

// Write material extension composite materials.
// for (const auto &material : model->composite_materials) {
// if(!composite_materials_written){
// append_buffer("<m:colorgroup id=\"2\">\n");
// color_group_written = true;
// }
// append_buffer("<m:color color=\"" + material.second->attributes["color"] + "\" />\n");
// }
//
// // Close the material color group if it's open.
// if(color_group_written)
// append_buffer("</m:colorgroup>\n");
return true;

}

/// Write object of the current model. This function is called by writeModel() function.
Expand Down
10 changes: 8 additions & 2 deletions xs/src/libslic3r/Model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ class Model
///< , each instance having its own transformation (shift, scale, rotation).

ModelMaterialMap color_group;
///< Colors ModelMaterials specific to 3MF format read/write. This is a material group in the 3MF material extension.
///< Colors materials specific to 3MF format read/write. This is a material group in the 3MF material extension.

std::map<int, ModelMaterialMap> material_groups;
///< Material groups specific to 3MF format read/write. Material groups are found in the 3MF material extension.

std::map<int, std::string> material_groups_types;
///< Type of each material group according to 3MF material extension.

std::map<std::string, std::string> metadata;
///< Model Metadata <name, value>, this is needed for 3MF format read/write.
///< Model metadata <name, value>, this is needed for 3MF format read/write.

/// Model constructor.
Model();
Expand Down

0 comments on commit c4b133e

Please sign in to comment.