Merge remote-tracking branch 'origin/master' into ys_search

This commit is contained in:
YuSanka 2020-04-03 10:48:54 +02:00
commit 2a9190c27d
3 changed files with 14 additions and 7 deletions

1
deps/CMakeLists.txt vendored
View File

@ -35,6 +35,7 @@ set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination direct
option(DEP_DEBUG "Build debug variants (only applicable on Windows)" ON) option(DEP_DEBUG "Build debug variants (only applicable on Windows)" ON)
option(DEP_WX_STABLE "Build against wxWidgets stable 3.0 as opposed to default 3.1 (Linux only)" OFF) option(DEP_WX_STABLE "Build against wxWidgets stable 3.0 as opposed to default 3.1 (Linux only)" OFF)
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
# On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL. # On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL.
# FIXME: # FIXME:

View File

@ -99,6 +99,12 @@ else ()
set(DEP_WX_TAG "v3.1.1-patched") set(DEP_WX_TAG "v3.1.1-patched")
endif() endif()
if (DEP_WX_GTK3)
set(WX_GTK_VERSION "3")
else ()
set(WX_GTK_VERSION "2")
endif()
ExternalProject_Add(dep_wxwidgets ExternalProject_Add(dep_wxwidgets
EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_ALL 1
GIT_REPOSITORY "https://github.com/prusa3d/wxWidgets" GIT_REPOSITORY "https://github.com/prusa3d/wxWidgets"
@ -108,7 +114,7 @@ ExternalProject_Add(dep_wxwidgets
CONFIGURE_COMMAND ./configure CONFIGURE_COMMAND ./configure
"--prefix=${DESTDIR}/usr/local" "--prefix=${DESTDIR}/usr/local"
--disable-shared --disable-shared
--with-gtk=2 --with-gtk=${WX_GTK_VERSION}
--with-opengl --with-opengl
--enable-unicode --enable-unicode
--enable-graphics_ctx --enable-graphics_ctx

View File

@ -981,13 +981,13 @@ namespace Slic3r {
return current_absolute_position; return current_absolute_position;
}; };
// delta_pos must have size >= 4 // delta_pos must have size >= Num_Axis
auto move_length = [](const float* delta_pos) { auto move_length = [](const float* delta_pos) {
float xyz_length = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z])); float xyz_length = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]));
return (xyz_length > 0.0f) ? xyz_length : std::abs(delta_pos[E]); return (xyz_length > 0.0f) ? xyz_length : std::abs(delta_pos[E]);
}; };
// delta_pos must have size >= 4 // delta_pos must have size >= Num_Axis
auto is_extruder_only_move = [](const float* delta_pos) { auto is_extruder_only_move = [](const float* delta_pos) {
return (delta_pos[X] == 0.0f) && (delta_pos[Y] == 0.0f) && (delta_pos[Z] == 0.0f) && (delta_pos[E] != 0.0f); return (delta_pos[X] == 0.0f) && (delta_pos[Y] == 0.0f) && (delta_pos[Z] == 0.0f) && (delta_pos[E] != 0.0f);
}; };
@ -996,7 +996,7 @@ namespace Slic3r {
increment_g1_line_id(); increment_g1_line_id();
// updates axes positions from line // updates axes positions from line
std::array<float, Num_Axis> new_pos; float new_pos[Num_Axis];
for (unsigned char a = X; a < Num_Axis; ++a) for (unsigned char a = X; a < Num_Axis; ++a)
{ {
new_pos[a] = axis_absolute_position((EAxis)a, line); new_pos[a] = axis_absolute_position((EAxis)a, line);
@ -1011,7 +1011,7 @@ namespace Slic3r {
// calculates block movement deltas // calculates block movement deltas
float max_abs_delta = 0.0f; float max_abs_delta = 0.0f;
std::array<float, Num_Axis> delta_pos; float delta_pos[Num_Axis];
for (unsigned char a = X; a < Num_Axis; ++a) for (unsigned char a = X; a < Num_Axis; ++a)
{ {
delta_pos[a] = new_pos[a] - get_axis_position((EAxis)a); delta_pos[a] = new_pos[a] - get_axis_position((EAxis)a);
@ -1025,7 +1025,7 @@ namespace Slic3r {
// calculates block feedrate // calculates block feedrate
m_curr.feedrate = std::max(get_feedrate(), (delta_pos[E] == 0.0f) ? get_minimum_travel_feedrate() : get_minimum_feedrate()); m_curr.feedrate = std::max(get_feedrate(), (delta_pos[E] == 0.0f) ? get_minimum_travel_feedrate() : get_minimum_feedrate());
block.distance = move_length(delta_pos.data()); block.distance = move_length(delta_pos);
float invDistance = 1.0f / block.distance; float invDistance = 1.0f / block.distance;
float min_feedrate_factor = 1.0f; float min_feedrate_factor = 1.0f;
@ -1052,7 +1052,7 @@ namespace Slic3r {
} }
// calculates block acceleration // calculates block acceleration
float acceleration = is_extruder_only_move(delta_pos.data()) ? get_retract_acceleration() : get_acceleration(); float acceleration = is_extruder_only_move(delta_pos) ? get_retract_acceleration() : get_acceleration();
for (unsigned char a = X; a < Num_Axis; ++a) for (unsigned char a = X; a < Num_Axis; ++a)
{ {