Skip to content

Commit a9f5842

Browse files
committed
fixes: linux&mac memory error, wipe, add speed comments
2 parents 57a9bdb + f579644 commit a9f5842

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+551
-298
lines changed

BuildLinux.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@ then
5454
exit 0
5555
fi
5656

57-
# mkdir build
58-
if [ ! -d "build" ]
57+
if [[ -n "$FOUND_GTK3" ]]
5958
then
60-
mkdir build
59+
echo "Found GTK3"
60+
else
61+
if [[ -n "$FOUND_GTK2" ]]
62+
then
63+
echo "Found GTK2"
64+
fi
6165
fi
6266

63-
6467
if [[ -n "$UPDATE_LIB" ]]
6568
then
6669
echo -n -e "Updating linux ...\n"
@@ -118,6 +121,12 @@ echo "[2/9] Changing date in version..."
118121
}
119122
echo "done"
120123

124+
# mkdir build
125+
if [ ! -d "build" ]
126+
then
127+
mkdir build
128+
fi
129+
121130
# mkdir in deps
122131
if [ ! -d "deps/build" ]
123132
then

create_release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ def get_version():
8383
print("gtk2 appimage: " +str(resp));
8484
z = zipfile.ZipFile(io.BytesIO(resp.content));
8585
z.extractall(release_path);
86-
os.rename(release_path+"/"+program_name+"_ubu64.AppImage", release_path+"/"+program_name+"-ubuntu_18.04-gtk2-" + version + ".AppImage");
86+
os.rename(release_path+"/"+program_name+"_ubu64.AppImage", release_path+"/"+program_name+"-ubuntu_20.04-gtk2-" + version + ".AppImage");
8787
if entry["name"] == "rc-"+program_name+"-gtk3.AppImage" and not found_linux_appimage_gtk3:
8888
found_linux_appimage_gtk3 = True;
8989
print("ask for: "+entry["archive_download_url"]);
9090
resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
9191
print("gtk3 appimage: " +str(resp));
9292
z = zipfile.ZipFile(io.BytesIO(resp.content));
9393
z.extractall(release_path);
94-
os.rename(release_path+"/"+program_name+"_ubu64.AppImage", release_path+"/"+program_name+"-ubuntu_18.04-" + version + ".AppImage");
94+
os.rename(release_path+"/"+program_name+"_ubu64.AppImage", release_path+"/"+program_name+"-ubuntu_20.04-" + version + ".AppImage");
9595
if entry["name"] == "rc_linux_gtk3.tar" and not found_linux:
9696
found_linux = True;
9797
print("ask for: "+entry["archive_download_url"]);

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,5 +303,5 @@ else ()
303303
install(TARGETS Slic3r RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
304304

305305
# Install the symlink for gcodeviewer
306-
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink slic3r ${GCODEVIEWER_APP_CMD} WORKING_DIRECTORY \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})")
306+
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SLIC3R_APP_CMD} ${GCODEVIEWER_APP_CMD} WORKING_DIRECTORY \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})")
307307
endif ()

src/libslic3r/AppConfig.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
#include "libslic3r/libslic3r.h"
2-
#include "libslic3r/Utils.hpp"
31
#include "AppConfig.hpp"
2+
3+
#include "libslic3r.h"
4+
#include "format.hpp"
45
#include "Exception.hpp"
6+
#include "I18N.hpp"
57
#include "LocalesUtils.hpp"
68
#include "Thread.hpp"
7-
#include "format.hpp"
9+
#include "Utils.hpp"
810

911
#include <utility>
1012
#include <vector>
@@ -13,7 +15,6 @@
1315
#include <boost/algorithm/string/predicate.hpp>
1416
#include <boost/filesystem/directory.hpp>
1517
#include <boost/filesystem/operations.hpp>
16-
#include <boost/filesystem/path.hpp>
1718
#include <boost/format/format_fwd.hpp>
1819
#include <boost/locale.hpp>
1920
#include <boost/log/trivial.hpp>

src/libslic3r/AppConfig.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <string>
77

88
#include <boost/algorithm/string/trim_all.hpp>
9+
#include <boost/filesystem/path.hpp>
910

1011
#include "libslic3r/Config.hpp"
1112
#include "libslic3r/Semver.hpp"

src/libslic3r/Config.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,9 @@ class ConfigOptionFloatsTempl : public ConfigOptionVector<double>
820820
return false;
821821
return true;
822822
} else {
823-
return idx < values.size() ? (std::isnan(this->values[idx]) || NIL_VALUE() == this->values[idx]) :
824-
values.empty() ? (std::isnan(this->default_value) || NIL_VALUE() == this->default_value) :
825-
(std::isnan(this->values.front()) || NIL_VALUE() == this->values.front());
823+
return idx < int32_t(values.size()) ? (std::isnan(this->values[idx]) || NIL_VALUE() == this->values[idx]) :
824+
values.empty() ? (std::isnan(this->default_value) || NIL_VALUE() == this->default_value) :
825+
(std::isnan(this->values.front()) || NIL_VALUE() == this->values.front());
826826
}
827827
}
828828
double get_float(size_t idx = 0) const override { return get_at(idx); }
@@ -1004,9 +1004,9 @@ class ConfigOptionIntsTempl : public ConfigOptionVector<int32_t>
10041004
return false;
10051005
return true;
10061006
} else {
1007-
return idx < values.size() ? NIL_VALUE() == this->values[idx] :
1008-
values.empty() ? NIL_VALUE() == this->default_value :
1009-
NIL_VALUE() == this->values.front();
1007+
return idx < int32_t(values.size()) ? NIL_VALUE() == this->values[idx] :
1008+
values.empty() ? NIL_VALUE() == this->default_value :
1009+
NIL_VALUE() == this->values.front();
10101010
}
10111011
}
10121012
int32_t get_int(size_t idx = 0) const override { return get_at(idx); }
@@ -1349,9 +1349,9 @@ class ConfigOptionFloatsOrPercentsTempl : public ConfigOptionVector<FloatOrPerce
13491349
return false;
13501350
return true;
13511351
} else {
1352-
return idx < values.size() ? (std::isnan(this->values[idx].value) || NIL_VALUE() == this->values[idx]) :
1353-
values.empty() ? (std::isnan(this->default_value.value) || NIL_VALUE() == this->default_value) :
1354-
(std::isnan(this->values.front().value) || NIL_VALUE() == this->values.front());
1352+
return idx < int32_t(values.size()) ? (std::isnan(this->values[idx].value) || NIL_VALUE() == this->values[idx]) :
1353+
values.empty() ? (std::isnan(this->default_value.value) || NIL_VALUE() == this->default_value) :
1354+
(std::isnan(this->values.front().value) || NIL_VALUE() == this->values.front());
13551355
}
13561356
}
13571357
double get_abs_value(size_t i, double ratio_over) const {
@@ -1718,9 +1718,9 @@ class ConfigOptionBoolsTempl : public ConfigOptionVector<unsigned char>
17181718
return false;
17191719
return true;
17201720
} else {
1721-
return idx < values.size() ? NIL_VALUE() == this->values[idx] :
1722-
values.empty() ? NIL_VALUE() == this->default_value :
1723-
NIL_VALUE() == this->values.front();
1721+
return idx < int32_t(values.size()) ? NIL_VALUE() == this->values[idx] :
1722+
values.empty() ? NIL_VALUE() == this->default_value :
1723+
NIL_VALUE() == this->values.front();
17241724
}
17251725
}
17261726
bool get_bool(size_t idx = 0) const override { return ConfigOptionVector<unsigned char>::get_at(idx) != 0; }

src/libslic3r/ExtrusionEntity.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "ExtrusionEntityCollection.hpp"
33
#include "ExPolygonCollection.hpp"
44
#include "ClipperUtils.hpp"
5+
#include "Config.hpp"
56
#include "Extruder.hpp"
67
#include "Flow.hpp"
78
#include <cmath>
@@ -592,6 +593,13 @@ bool HasRoleVisitor::search(const ExtrusionEntitiesPtr &entities, HasRoleVisitor
592593
return visitor.found;
593594
}
594595

596+
void SimplifyVisitor::use(ExtrusionPath& path) {
597+
path.simplify(m_scaled_resolution, m_use_arc_fitting, scale_d(m_arc_fitting_tolearance->get_abs_value(path.width)));
598+
}
599+
void SimplifyVisitor::use(ExtrusionPath3D& path3D) {
600+
path3D.simplify(m_scaled_resolution, m_use_arc_fitting, scale_d(m_arc_fitting_tolearance->get_abs_value(path3D.width)));
601+
}
602+
595603
//class ExtrusionTreeVisitor : ExtrusionVisitor {
596604
//public:
597605
// //virtual void use(ExtrusionEntity &entity) { assert(false); };

src/libslic3r/ExtrusionEntity.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -637,18 +637,15 @@ struct HasThisRoleVisitor : public HasRoleVisitor{
637637

638638

639639
//call simplify for all paths.
640+
class ConfigOptionFloatOrPercent;
640641
class SimplifyVisitor : public ExtrusionVisitorRecursive {
641642
bool m_use_arc_fitting;
642643
coordf_t m_scaled_resolution;
643644
const ConfigOptionFloatOrPercent* m_arc_fitting_tolearance;
644645
public:
645646
SimplifyVisitor(coordf_t scaled_resolution, bool use_arc_fitting, const ConfigOptionFloatOrPercent* arc_fitting_tolearance) : m_scaled_resolution(scaled_resolution), m_use_arc_fitting(use_arc_fitting), m_arc_fitting_tolearance(arc_fitting_tolearance){}
646-
virtual void use(ExtrusionPath& path) override {
647-
path.simplify(m_scaled_resolution, m_use_arc_fitting, scale_d(m_arc_fitting_tolearance->get_abs_value(path.width)));
648-
}
649-
virtual void use(ExtrusionPath3D& path3D) override {
650-
path3D.simplify(m_scaled_resolution, m_use_arc_fitting, scale_d(m_arc_fitting_tolearance->get_abs_value(path3D.width)));
651-
}
647+
virtual void use(ExtrusionPath& path) override;
648+
virtual void use(ExtrusionPath3D& path3D) override;
652649
};
653650
class GetPathsVisitor : public ExtrusionVisitorRecursive {
654651
public:

src/libslic3r/Flow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <assert.h>
77

88
#include <boost/algorithm/string/predicate.hpp>
9+
#include <boost/algorithm/string/replace.hpp>
910

1011
// Mark string for localization and translate.
1112
#define L(s) Slic3r::I18N::translate(s)

src/libslic3r/Format/BBConfig.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
#include <map>
1010
#include <string>
1111

12+
#include <boost/algorithm/string/replace.hpp>
13+
#include <boost/log/trivial.hpp>
14+
#include <boost/property_tree/ini_parser.hpp>
15+
#include <boost/property_tree/ptree.hpp>
16+
1217
namespace Slic3r {
1318

1419
namespace BBConfiguration {

0 commit comments

Comments
 (0)