Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorremi durand <remi-j.durand@thalesgroup.com>2021-08-07 18:57:14 +0300
committerremi durand <remi-j.durand@thalesgroup.com>2021-08-07 18:57:14 +0300
commit4c2038d748b802198507dca046b62e4afc1aca4d (patch)
treea87659ceaa6b8af155997327288a5e3fed754632
parentd88d4bcd558f5d6a83ee4b5542394a62e6e71f66 (diff)
parentf88f224452cee36acfb472622966bb0e77739457 (diff)
Merge branch 'merill-merge'2.3.56.8
-rwxr-xr-xBuildLinux.sh165
-rw-r--r--src/PrusaSlicer.cpp1
-rw-r--r--src/libslic3r/Format/3mf.cpp25
-rw-r--r--src/libslic3r/Print.cpp2
-rw-r--r--src/libslic3r/PrintConfig.cpp8
-rw-r--r--src/platform/unix/BuildLinuxImage.sh.in23
-rw-r--r--src/slic3r/GUI/GLCanvas3D.cpp34
-rw-r--r--src/slic3r/GUI/GLCanvas3D.hpp5
-rw-r--r--src/slic3r/GUI/Tab.cpp11
-rw-r--r--src/slic3r/Utils/Process.cpp7
10 files changed, 184 insertions, 97 deletions
diff --git a/BuildLinux.sh b/BuildLinux.sh
index 41d7b0114..0107695d9 100755
--- a/BuildLinux.sh
+++ b/BuildLinux.sh
@@ -3,14 +3,28 @@
export ROOT=`pwd`
export NCORES=`nproc --all`
-while getopts ":ih" opt; do
+
+while getopts ":dsiuh" opt; do
case ${opt} in
+ u )
+ UPDATE_LIB="1"
+ ;;
i )
- export BUILD_IMAGE="1"
+ BUILD_IMAGE="1"
+ ;;
+ d )
+ BUILD_DEPS="1"
;;
- h ) echo "Usage: ./BuildLinux.sh [-i][-u]"
+ s )
+ BUILD_SLIC3R="1"
+ ;;
+ h ) echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s]"
echo " -i: Generate appimage (optional)"
+ echo " -d: build deps (optional)"
+ echo " -s: build slic3r (optional)"
echo " -u: only update clock & dependency packets (optional and need sudo)"
+ echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
+ echo " and then './BuildLinux.sh -dsi'"
exit 0
;;
esac
@@ -22,33 +36,40 @@ then
mkdir build
fi
-
-if [[ -n "$BUILD_IMAGE" ]]
+if [[ -n "$UPDATE_LIB" ]]
then
echo -n "Updating linux ..."
- {
- hwclock -s
- apt update
- apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev
- } > $ROOT/build/Build.log # Capture all command output
+ hwclock -s
+ apt update
+ apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git
echo "done"
exit 0
fi
-echo -n "[1/9] Updating submodules..."
+FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2.0-dev)
+echo "FOUND_GTK2=$FOUND_GTK2)"
+if [[ -z "$FOUND_GTK2" ]]
+then
+ echo "Error, you must install the dependencies before."
+ echo "Use option -u with sudo"
+ exit 0
+fi
+
+echo "[1/9] Updating submodules..."
{
# update submodule profiles
pushd resources/profiles
git submodule update --init
popd
-} > $ROOT/build/Build.log # Capture all command output
+}
+# > $ROOT/build/Build.log # Capture all command output
-echo -n "[2/9] Changing date in version..."
+echo "[2/9] Changing date in version..."
{
# change date in version
- sed "s/+UNKNOWN/_$(date '+%F')/" version.inc > version.date.inc
- mv version.date.inc version.inc
-} &> $ROOT/build/Build.log # Capture all command output
+ sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
+}
+# &> $ROOT/build/Build.log # Capture all command output
echo "done"
# mkdir in deps
@@ -57,66 +78,76 @@ then
mkdir deps/build
fi
-echo -n "[3/9] Configuring dependencies..."
-{
- # cmake deps
- pushd deps/build
- cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13"
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[4/9] Building dependencies..."
-{
- # make deps
- make -j$NCORES
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[5/9] Renaming wxscintilla library..."
-{
- # rename wxscintilla
- pushd destdir/usr/local/lib
- cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
- popd
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[6/9] Cleaning dependencies..."
-{
- # clean deps
- rm -rf dep_*
- popd
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[7/9] Configuring Slic3r..."
-{
- # cmake
- pushd build
- cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
-
-echo -n "[8/9] Building Slic3r..."
-{
- # make Slic3r
- make -j$NCORES Slic3r
+if [[ -n "$BUILD_DEPS" ]]
+then
+ echo "[3/9] Configuring dependencies..."
+
+ # cmake deps
+ pushd deps/build
+ cmake ..
+
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+
+ echo "[4/9] Building dependencies..."
+
+ # make deps
+ make -j$NCORES
+
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+
+ echo "[5/9] Renaming wxscintilla library..."
+
+ # rename wxscintilla
+ pushd destdir/usr/local/lib
+ cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
+ popd
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+
+ echo "[6/9] Cleaning dependencies..."
+
+ # clean deps
+ rm -rf dep_*
+ popd
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+fi
- # make .mo
- make gettext_po_to_mo
-} &> $ROOT/build/Build.log # Capture all command output
-echo "done"
+if [[ -n "$BUILD_SLIC3R" ]]
+then
+ echo "[7/9] Configuring Slic3r..."
+
+ # cmake
+ pushd build
+ cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+
+ echo "[8/9] Building Slic3r..."
+
+ # make Slic3r
+ make -j$NCORES Slic3r
+
+ # make .mo
+ make gettext_po_to_mo
+
+ popd
+ # &> $ROOT/build/Build.log # Capture all command output
+ echo "done"
+fi
# Give proper permissions to script
chmod 755 $ROOT/build/src/BuildLinuxImage.sh
-echo -n "[9/9] Generating Linux app..."
-{
+echo "[9/9] Generating Linux app..."
+ pushd build
if [[ -n "$BUILD_IMAGE" ]]
then
$ROOT/build/src/BuildLinuxImage.sh -i
else
$ROOT/build/src/BuildLinuxImage.sh
fi
-} &> $ROOT/build/Build.log # Capture all command output
+# &> $ROOT/build/Build.log # Capture all command output
echo "done"
diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp
index 08bcf49c9..17811f3c9 100644
--- a/src/PrusaSlicer.cpp
+++ b/src/PrusaSlicer.cpp
@@ -466,6 +466,7 @@ int CLI::run(int argc, char **argv)
if (! m_config.opt_bool("dont_arrange")) {
ArrangeParams arrange_cfg;
arrange_cfg.min_obj_distance = scaled(PrintConfig::min_object_distance(&m_print_config)) * 2;
+ arrange_cfg.min_obj_distance += m_print_config.opt_float("duplicate_distance");
if (dups > 1) {
try {
// if all input objects have defined position(s) apply duplication to the whole model
diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp
index ad8635ba5..f8b4f0970 100644
--- a/src/libslic3r/Format/3mf.cpp
+++ b/src/libslic3r/Format/3mf.cpp
@@ -2806,8 +2806,18 @@ namespace Slic3r {
}
// stores object's config data
- for (const std::string& key : obj->config.keys()) {
- stream << " <" << METADATA_TAG << " " << TYPE_ATTR << "=\"" << OBJECT_TYPE << "\" " << KEY_ATTR << "=\"" << key << "\" " << VALUE_ATTR << "=\"" << obj->config.opt_serialize(key) << "\"/>\n";
+ if (file_path == MODEL_PRUSA_CONFIG_FILE) {
+ for (std::string key : obj->config.keys()) {
+ // convert to prusa config
+ std::string value = obj->config.opt_serialize(key);
+ obj->config.to_prusa(key, value);
+ if (!key.empty())
+ stream << " <" << METADATA_TAG << " " << TYPE_ATTR << "=\"" << OBJECT_TYPE << "\" " << KEY_ATTR << "=\"" << key << "\" " << VALUE_ATTR << "=\"" << value << "\"/>\n";
+ }
+ } else {
+ for (const std::string& key : obj->config.keys()) {
+ stream << " <" << METADATA_TAG << " " << TYPE_ATTR << "=\"" << OBJECT_TYPE << "\" " << KEY_ATTR << "=\"" << key << "\" " << VALUE_ATTR << "=\"" << obj->config.opt_serialize(key) << "\"/>\n";
+ }
}
for (const ModelVolume* volume : obj_metadata.second.object->volumes)
@@ -2868,18 +2878,17 @@ namespace Slic3r {
}
// stores volume's config data
- for (std::string key : volume->config.keys())
- {
- // config
- if (file_path == MODEL_PRUSA_CONFIG_FILE) {
+ if (file_path == MODEL_PRUSA_CONFIG_FILE) {
+ for (std::string key : volume->config.keys()) {
// convert to prusa config
std::string value = volume->config.opt_serialize(key);
volume->config.to_prusa(key, value);
if (!key.empty())
stream << " <" << METADATA_TAG << " " << TYPE_ATTR << "=\"" << VOLUME_TYPE << "\" " << KEY_ATTR << "=\"" << key << "\" " << VALUE_ATTR << "=\"" << value << "\"/>\n";
- } else {
- stream << " <" << METADATA_TAG << " " << TYPE_ATTR << "=\"" << VOLUME_TYPE << "\" " << KEY_ATTR << "=\"" << key << "\" " << VALUE_ATTR << "=\"" << volume->config.opt_serialize(key) << "\"/>\n";
}
+ } else {
+ for (const std::string& key : volume->config.keys())
+ stream << " <" << METADATA_TAG << " " << TYPE_ATTR << "=\"" << VOLUME_TYPE << "\" " << KEY_ATTR << "=\"" << key << "\" " << VALUE_ATTR << "=\"" << volume->config.opt_serialize(key) << "\"/>\n";
}
stream << " </" << VOLUME_TAG << ">\n";
diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp
index 9990027b5..900dae6e7 100644
--- a/src/libslic3r/Print.cpp
+++ b/src/libslic3r/Print.cpp
@@ -1276,7 +1276,7 @@ static inline bool sequential_print_horizontal_clearance_valid(const Print &prin
Polygons convex_hulls_other;
std::map<ObjectID, Polygon> map_model_object_to_convex_hull;
for (const PrintObject *print_object : print.objects()) {
- double dist_grow = PrintConfig::min_object_distance(&print.full_print_config());// &print_object->config());
+ double dist_grow = PrintConfig::min_object_distance(&print.full_print_config()) * 2 ;// &print_object->config());
assert(! print_object->model_object()->instances.empty());
assert(! print_object->instances().empty());
ObjectID model_object_id = print_object->model_object()->id();
diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp
index 031a6d1f1..7716b881e 100644
--- a/src/libslic3r/PrintConfig.cpp
+++ b/src/libslic3r/PrintConfig.cpp
@@ -667,7 +667,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("duplicate_distance", coFloat);
def->label = L("Distance between objects");
def->category = OptionCategory::output;
- def->tooltip = L("Distance used for the auto-arrange feature of the plater.");
+ def->tooltip = L("Default distance used for the auto-arrange feature of the plater.\nSet to 0 to use the last value instead.");
def->sidetext = L("mm");
def->aliases = { "multiply_distance" };
def->min = 0;
@@ -5660,9 +5660,7 @@ double PrintConfig::min_object_distance(const ConfigBase *config, double ref_hei
//test if called from usaslicer::l240 where it's called on an empty config...
if (dd_opt == nullptr) return 0;
- // /2 becasue we only count the grawing for the current object
- const double duplicate_distance = dd_opt->value / 2;
- double base_dist = duplicate_distance;
+ double base_dist = 0;
//std::cout << "START min_object_distance =>" << base_dist << "\n";
const ConfigOptionBool* co_opt = config->option<ConfigOptionBool>("complete_objects");
if (co_opt && co_opt->value) {
@@ -5676,7 +5674,7 @@ double PrintConfig::min_object_distance(const ConfigBase *config, double ref_hei
// min object distance is max(duplicate_distance, clearance_radius)
// /2 becasue we only count the grawing for the current object
//add 1 as safety offset.
- double extruder_clearance_radius = config->option("extruder_clearance_radius")->getFloat() / 2 + 1;
+ double extruder_clearance_radius = config->option("extruder_clearance_radius")->getFloat() / 2;
if (extruder_clearance_radius > base_dist) {
base_dist = extruder_clearance_radius;
}
diff --git a/src/platform/unix/BuildLinuxImage.sh.in b/src/platform/unix/BuildLinuxImage.sh.in
index 24d306612..168e8c7a0 100644
--- a/src/platform/unix/BuildLinuxImage.sh.in
+++ b/src/platform/unix/BuildLinuxImage.sh.in
@@ -16,14 +16,15 @@ while getopts ":ih" opt; do
done
echo -n "[9/9] Generating Linux app..."
-{
-
+#{
# create directory and copy into it
if [ -d "package" ]
then
rm -rf package/*
+ rm -rf package/.* 2&>/dev/null
+ else
+ mkdir package
fi
- mkdir package
mkdir package/bin
# copy Resources
@@ -32,17 +33,23 @@ echo -n "[9/9] Generating Linux app..."
# create bin
echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/@SLIC3R_APP_CMD@" "$@"' >@SLIC3R_APP_CMD@
- chmod u+x @SLIC3R_APP_CMD@
- tar -cvf ../@SLIC3R_APP_KEY@.tar .
-} &> $ROOT/Build.log # Capture all command output
+ chmod ug+x @SLIC3R_APP_CMD@
+ cp -f @SLIC3R_APP_CMD@ package/@SLIC3R_APP_CMD@
+ pushd package
+ tar -cvf ../@SLIC3R_APP_KEY@.tar . &>/dev/null
+ popd
+#} &> $ROOT/Build.log # Capture all command output
echo "done"
if [[ -n "$BUILD_IMAGE" ]]
then
echo -n "Creating Appimage for distribution..."
-{
+#{
+ pushd package
chmod +x ../build_appimage.sh
../build_appimage.sh
-} &> $ROOT/Build.log # Capture all command output
+ popd
+ mv package/"@SLIC3R_APP_KEY@_ubu64.AppImage" "@SLIC3R_APP_KEY@_ubu64.AppImage"
+#} &> $ROOT/Build.log # Capture all command output
echo "done"
fi
diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp
index d61c0b118..495e0ddf7 100644
--- a/src/slic3r/GUI/GLCanvas3D.cpp
+++ b/src/slic3r/GUI/GLCanvas3D.cpp
@@ -1154,6 +1154,29 @@ void GLCanvas3D::load_arrange_settings()
m_arrange_settings_sla.enable_rotation = (en_rot_sla_str == "1" || en_rot_sla_str == "yes");
}
+// update arrange dist from current print conf.
+void GLCanvas3D::set_arrange_settings(const DynamicPrintConfig& conf, PrinterTechnology tech) {
+
+ const ConfigOptionFloat* dd_opt = conf.option<ConfigOptionFloat>("duplicate_distance");
+ const ConfigOptionFloat* dd2_opt = m_config->option<ConfigOptionFloat>("duplicate_distance");
+
+ if (dd_opt && dd_opt != 0) {
+ float dist = 6.f;
+ if (tech == ptSLA) {
+ dist = dd_opt->value;
+ } else if (tech == ptFFF) {
+ const ConfigOptionBool* co_opt = conf.option<ConfigOptionBool>("complete_objects");
+ if (co_opt && co_opt->value) {
+ dist = float(PrintConfig::min_object_distance(m_config) * 2);
+ } else {
+ dist = 0.f;
+ }
+ dist += dd_opt->value;
+ }
+ this->get_arrange_settings().distance = dist;
+ }
+}
+
PrinterTechnology GLCanvas3D::current_printer_technology() const
{
return m_process->current_printer_technology();
@@ -4045,7 +4068,7 @@ bool GLCanvas3D::_render_arrange_menu(float pos_x)
} else if (ptech == ptFFF) {
auto co_opt = m_config->option<ConfigOptionBool>("complete_objects");
if (co_opt && co_opt->value) {
- dist_min = float(PrintConfig::min_object_distance(m_config));
+ dist_min = float(PrintConfig::min_object_distance(m_config) * 2);
postfix = "_fff_seq_print";
} else {
dist_min = 0.f;
@@ -4059,7 +4082,11 @@ bool GLCanvas3D::_render_arrange_menu(float pos_x)
imgui->text(GUI::format_wxstr(_L("Press %1%left mouse button to enter the exact value"), shortkey_ctrl_prefix()));
if (imgui->slider_float(_L("Spacing"), &settings.distance, dist_min, 100.0f, "%5.2f") || dist_min > settings.distance) {
- settings.distance = std::max(dist_min, settings.distance);
+ if (dist_min > settings.distance) {
+ const ConfigOptionFloat* dd_opt = this->m_config->option<ConfigOptionFloat>("duplicate_distance");
+ if (dd_opt)
+ settings.distance = dist_min + dd_opt->value;
+ }
settings_out.distance = settings.distance;
appcfg->set("arrange", dist_key.c_str(), std::to_string(settings_out.distance));
settings_changed = true;
@@ -4075,6 +4102,9 @@ bool GLCanvas3D::_render_arrange_menu(float pos_x)
if (imgui->button(_L("Reset"))) {
settings_out = ArrangeSettings{};
+ const ConfigOptionFloat* dd_opt = this->m_config->option<ConfigOptionFloat>("duplicate_distance");
+ if(dd_opt)
+ settings_out.distance = dist_min + dd_opt->value;
settings_out.distance = std::max(dist_min, settings_out.distance);
appcfg->set("arrange", dist_key.c_str(), std::to_string(settings_out.distance));
appcfg->set("arrange", rot_key.c_str(), settings_out.enable_rotation? "1" : "0");
diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp
index 053470432..7d6238c80 100644
--- a/src/slic3r/GUI/GLCanvas3D.hpp
+++ b/src/slic3r/GUI/GLCanvas3D.hpp
@@ -776,12 +776,9 @@ public:
{
const ArrangeSettings &settings = get_arrange_settings(this);
ArrangeSettings ret = settings;
- if (&settings == &m_arrange_settings_fff_seq_print) {
- ret.distance = std::max(ret.distance, float(PrintConfig::min_object_distance(m_config)));
- }
-
return ret;
}
+ void set_arrange_settings(const DynamicPrintConfig& conf, PrinterTechnology tech);
// Timestamp for FPS calculation and notification fade-outs.
static int64_t timestamp_now() {
diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp
index 43d0392d1..32ac2a30c 100644
--- a/src/slic3r/GUI/Tab.cpp
+++ b/src/slic3r/GUI/Tab.cpp
@@ -44,6 +44,7 @@
#include "GUI_ObjectList.hpp"
#include "Plater.hpp"
#include "MainFrame.hpp"
+#include "GLCanvas3D.hpp"
#include "format.hpp"
#include "PhysicalPrinterDialog.hpp"
#include "UnsavedChangesDialog.hpp"
@@ -3369,6 +3370,16 @@ void Tab::select_preset(std::string preset_name, bool delete_current /*=false*/,
apply_config_from_cache();
load_current_preset();
+
+ // apply duplicate_distance for print preset
+ if (m_type == Preset::TYPE_PRINT) {
+ wxGetApp().mainframe->plater()->canvas3D()->set_arrange_settings(m_presets->get_edited_preset().config, m_presets->get_edited_preset().printer_technology());
+ }
+ if (m_type == Preset::TYPE_PRINTER) {
+ wxGetApp().mainframe->plater()->canvas3D()->set_arrange_settings(m_preset_bundle->prints.get_edited_preset().config, m_presets->get_edited_preset().printer_technology());
+
+ }
+
}
}
diff --git a/src/slic3r/Utils/Process.cpp b/src/slic3r/Utils/Process.cpp
index ab7cf2122..a97df2138 100644
--- a/src/slic3r/Utils/Process.cpp
+++ b/src/slic3r/Utils/Process.cpp
@@ -1,6 +1,7 @@
#include "Process.hpp"
#include <libslic3r/AppConfig.hpp>
+#include <libslic3r/Utils.hpp>
#include "../GUI/GUI.hpp"
// for file_wildcards()
@@ -47,8 +48,10 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
for (const auto& file : paths_to_open)
args.emplace_back(file);
}
- if (instance_type == NewSlicerInstanceType::Slicer && single_instance)
- args.emplace_back(L"--single-instance");
+ if (instance_type == NewSlicerInstanceType::Slicer && single_instance)
+ args.emplace_back(L"--single-instance");
+ args.emplace_back(L"--datadir");
+ args.emplace_back(boost::nowide::widen(Slic3r::data_dir().c_str()).c_str());
args.emplace_back(nullptr);
BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << into_u8(path) << "\"";
// Don't call with wxEXEC_HIDE_CONSOLE, PrusaSlicer in GUI mode would just show the splash screen. It would not open the main window though, it would