Skip to content

Commit

Permalink
some fixes: win build doc, 3mf safety read, svg export without square
Browse files Browse the repository at this point in the history
fix color.ini file
  • Loading branch information
supermerill committed Nov 11, 2020
1 parent a44039c commit f27bd26
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/How to build - Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ msbuild /m ALL_BUILD.vcxproj

and then build superslicer (in ./build):
```
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="PATH_TO_SuperSlicer\deps\destdir\usr\local"
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="PATH_TO_SuperSlicer\deps\build\destdir\usr\local"
msbuild /m /P:Configuration=Release INSTALL.vcxproj
```
You can also build it in visual studio, for that open the .sln.
Expand Down
2 changes: 1 addition & 1 deletion resources/ui_layout/colors.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Solid infill = D732D7
Top solid infill = FF1A1A
Ironing = FF6868
Bridge infill = 9999FF
Internal Bridge infill = AAAADD
Internal bridge infill = AAAADD
Thin wall = FFC000
Gap fill = FFFFFF
Skirt = 845321
Expand Down
9 changes: 5 additions & 4 deletions src/libslic3r/Format/3mf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,16 +1219,16 @@ namespace Slic3r {

pt::ptree tree = code.second;
double print_z = tree.get<double> ("<xmlattr>.print_z" );
int extruder = tree.get<int> ("<xmlattr>.extruder");
std::string color = tree.get<std::string> ("<xmlattr>.color" );
int extruder = tree.get<int> ("<xmlattr>.extruder", 0);
std::string color = tree.get<std::string> ("<xmlattr>.color" ,"" );

CustomGCode::Type type;
std::string extra;
if (tree.find("type") == tree.not_found())
{
// It means that data was saved in old version (2.2.0 and older) of PrusaSlicer
// read old data ...
std::string gcode = tree.get<std::string> ("<xmlattr>.gcode");
std::string gcode = tree.get<std::string> ("<xmlattr>.gcode", "");
// ... and interpret them to the new data
type = gcode == "M600" ? CustomGCode::ColorChange :
gcode == "M601" ? CustomGCode::PausePrint :
Expand All @@ -1239,7 +1239,7 @@ namespace Slic3r {
else
{
type = static_cast<CustomGCode::Type>(tree.get<int>("<xmlattr>.type"));
extra = tree.get<std::string>("<xmlattr>.extra");
extra = tree.get<std::string>("<xmlattr>.extra", "");
}
m_model->custom_gcode_per_print_z.gcodes.push_back(CustomGCode::Item{print_z, type, extruder, color, extra}) ;
}
Expand Down Expand Up @@ -2805,6 +2805,7 @@ bool _3MF_Exporter::_add_custom_gcode_per_print_z_file_to_archive( mz_zip_archiv
code_tree.put("<xmlattr>.print_z" , code.print_z );
code_tree.put("<xmlattr>.type" , static_cast<int>(code.type));
code_tree.put("<xmlattr>.extruder" , code.extruder );
code_tree.put("<xmlattr>.color" , code.color );
code_tree.put("<xmlattr>.info" , code.color );
code_tree.put("<xmlattr>.extra" , code.extra );

Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/SVG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool SVG::open(const char* afilename)
" <polyline fill=\"darkblue\" points=\"0,0 10,5 0,10 1,5\" />\n"
" </marker>\n"
);
fprintf(this->f, "<rect fill='white' stroke='none' x='0' y='0' width='%f' height='%f'/>\n", 2000.f, 2000.f);
//fprintf(this->f, "<rect fill='white' stroke='none' x='0' y='0' width='%f' height='%f'/>\n", 2000.f, 2000.f);
return true;
}

Expand All @@ -43,7 +43,7 @@ bool SVG::open(const char* afilename, const BoundingBox &bbox, const coord_t bbo
" <polyline fill=\"darkblue\" points=\"0,0 10,5 0,10 1,5\" />\n"
" </marker>\n",
h, w);
fprintf(this->f, "<rect fill='white' stroke='none' x='0' y='0' width='%f' height='%f'/>\n", w, h);
//fprintf(this->f, "<rect fill='white' stroke='none' x='0' y='0' width='%f' height='%f'/>\n", w, h);
return true;
}

Expand Down

0 comments on commit f27bd26

Please sign in to comment.