mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-10 10:47:16 +00:00
Merge branch 'main' into color-mixing
This commit is contained in:
@@ -59,6 +59,13 @@ if (APPLE)
|
|||||||
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# Keep MSVC's default /W3 out of CMAKE_<LANG>_FLAGS so it can be applied to our own
|
||||||
|
# targets only. Silencing a bundled target would otherwise override a warning level,
|
||||||
|
# which cl reports as D9025 for every file it compiles.
|
||||||
|
if (POLICY CMP0092)
|
||||||
|
cmake_policy(SET CMP0092 NEW)
|
||||||
|
endif ()
|
||||||
|
|
||||||
project(OrcaSlicer)
|
project(OrcaSlicer)
|
||||||
|
|
||||||
# Backward compatibility for old CMake versions
|
# Backward compatibility for old CMake versions
|
||||||
@@ -126,6 +133,8 @@ option(SLIC3R_GUI "Compile OrcaSlicer with GUI components (OpenGL,
|
|||||||
option(SLIC3R_FHS "Assume OrcaSlicer is to be installed in a FHS directory structure" 0)
|
option(SLIC3R_FHS "Assume OrcaSlicer is to be installed in a FHS directory structure" 0)
|
||||||
option(SLIC3R_PROFILE "Compile OrcaSlicer with an invasive Shiny profiler" 0)
|
option(SLIC3R_PROFILE "Compile OrcaSlicer with an invasive Shiny profiler" 0)
|
||||||
option(SLIC3R_PCH "Use precompiled headers" 1)
|
option(SLIC3R_PCH "Use precompiled headers" 1)
|
||||||
|
option(SLIC3R_WARNINGS "Emit compiler warnings for OrcaSlicer sources" 1)
|
||||||
|
option(SLIC3R_BUNDLED_WARNINGS "Emit compiler warnings for bundled third-party sources" 0)
|
||||||
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
|
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
|
||||||
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
|
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
|
||||||
option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0)
|
option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0)
|
||||||
@@ -335,14 +344,16 @@ if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
|||||||
|
|
||||||
# clang-cl can interpret SYSTEM header paths if -imsvc is used
|
# clang-cl can interpret SYSTEM header paths if -imsvc is used
|
||||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-imsvc")
|
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-imsvc")
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall \
|
|
||||||
-Wno-old-style-cast -Wno-reserved-id-macro -Wno-c++98-compat-pedantic")
|
|
||||||
else ()
|
else ()
|
||||||
set(IS_CLANG_CL FALSE)
|
set(IS_CLANG_CL FALSE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
|
# CMP0092 only applies when the cache is created; an existing tree keeps its /W3,
|
||||||
|
# which a silenced bundled target would then override (D9025, once per file).
|
||||||
|
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
# /MP only matters for the VS generators, where CMake turns it into the
|
# /MP only matters for the VS generators, where CMake turns it into the
|
||||||
# MultiProcessorCompilation property. Ninja parallelises on its own, and
|
# MultiProcessorCompilation property. Ninja parallelises on its own, and
|
||||||
# clang-cl warns "argument unused" if the flag reaches it.
|
# clang-cl warns "argument unused" if the flag reaches it.
|
||||||
@@ -526,8 +537,15 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals" )
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
|
if ((NOT MSVC OR IS_CLANG_CL) AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
|
||||||
if (NOT MINGW)
|
if (IS_CLANG_CL)
|
||||||
|
# clang-cl reads -Wall as MSVC /Wall, which clang maps to -Weverything. /W4 is
|
||||||
|
# its -Wall -Wextra and, unlike /clang:-Wall, is ordered with the -Wno-* below
|
||||||
|
# instead of after them. The -Wextra-only warnings are dropped again so the set
|
||||||
|
# matches what -Wall gives the GNU/Clang builds.
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
|
||||||
|
add_compile_options(-Wno-unused-parameter -Wno-ignored-qualifiers -Wno-missing-field-initializers)
|
||||||
|
elseif (NOT MINGW)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
|
||||||
endif ()
|
endif ()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder" )
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder" )
|
||||||
@@ -1089,8 +1107,57 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
# Bundled sources set their own warning flags, and a plain -Wall there means /Wall
|
||||||
|
# (= -Weverything) under clang-cl. Target options are applied after the ones a target
|
||||||
|
# set on itself, so these win. Targets are discovered rather than listed so a newly
|
||||||
|
# bundled library needs no maintenance here.
|
||||||
|
function(orcaslicer_silence_third_party_warnings _dir)
|
||||||
|
get_property(_subdirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
|
||||||
|
foreach (_subdir IN LISTS _subdirs)
|
||||||
|
orcaslicer_silence_third_party_warnings("${_subdir}")
|
||||||
|
endforeach ()
|
||||||
|
get_property(_targets DIRECTORY "${_dir}" PROPERTY BUILDSYSTEM_TARGETS)
|
||||||
|
foreach (_target IN LISTS _targets)
|
||||||
|
get_target_property(_type ${_target} TYPE)
|
||||||
|
if (NOT _type STREQUAL "INTERFACE_LIBRARY" AND NOT _type STREQUAL "UTILITY")
|
||||||
|
if (MSVC AND NOT IS_CLANG_CL)
|
||||||
|
# Drop any level the target set for itself, or -w overrides it and cl
|
||||||
|
# reports D9025 once per file.
|
||||||
|
get_target_property(_opts ${_target} COMPILE_OPTIONS)
|
||||||
|
if (_opts)
|
||||||
|
string(REGEX REPLACE "/W[0-4]|/Wall" "" _opts "${_opts}")
|
||||||
|
string(REGEX REPLACE ";;+" ";" _opts "${_opts}")
|
||||||
|
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${_opts}")
|
||||||
|
endif ()
|
||||||
|
# CMake maps a level into the VS generator's WarningLevel element, while a
|
||||||
|
# bare -w stays on the command line and trips D9025 there, once per file.
|
||||||
|
target_compile_options(${_target} PRIVATE /W0)
|
||||||
|
else ()
|
||||||
|
target_compile_options(${_target} PRIVATE -w)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
# libslic3r, OrcaSlicer GUI and the OrcaSlicer executable.
|
# libslic3r, OrcaSlicer GUI and the OrcaSlicer executable.
|
||||||
add_subdirectory(deps_src)
|
add_subdirectory(deps_src)
|
||||||
|
|
||||||
|
if (NOT SLIC3R_BUNDLED_WARNINGS)
|
||||||
|
orcaslicer_silence_third_party_warnings("${CMAKE_CURRENT_SOURCE_DIR}/deps_src")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Warning level for the targets added below: our sources, plus glad and libvgcode,
|
||||||
|
# which are vendored but live under src/. The deps_src libraries were configured just
|
||||||
|
# above. CMP0092 left MSVC without a default level, so it is set here.
|
||||||
|
if (NOT SLIC3R_WARNINGS)
|
||||||
|
add_compile_options(-w)
|
||||||
|
elseif (MSVC AND NOT IS_CLANG_CL)
|
||||||
|
# /we4715 is C4715, no return from a non-void function, matching the
|
||||||
|
# -Werror=return-type the GNU/Clang builds apply.
|
||||||
|
add_compile_options(/W3 /we4715)
|
||||||
|
endif ()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OrcaSlicer_app_gui)
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OrcaSlicer_app_gui)
|
||||||
|
|
||||||
@@ -1102,6 +1169,10 @@ endif()
|
|||||||
|
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
if (NOT SLIC3R_BUNDLED_WARNINGS)
|
||||||
|
# Catch2 is vendored under tests/ and sets its own warning flags too.
|
||||||
|
orcaslicer_silence_third_party_warnings("${CMAKE_CURRENT_SOURCE_DIR}/tests/catch2")
|
||||||
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT WIN32 AND NOT APPLE)
|
if (NOT WIN32 AND NOT APPLE)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4142,10 +4142,10 @@ msgid "PA Profile"
|
|||||||
msgstr "Профіль PA"
|
msgstr "Профіль PA"
|
||||||
|
|
||||||
msgid "Factor K"
|
msgid "Factor K"
|
||||||
msgstr "Коэф. K"
|
msgstr "Коеф. K"
|
||||||
|
|
||||||
msgid "Factor N"
|
msgid "Factor N"
|
||||||
msgstr "Коэф. N"
|
msgstr "Коеф. N"
|
||||||
|
|
||||||
msgid "Setting AMS slot information while printing is not supported"
|
msgid "Setting AMS slot information while printing is not supported"
|
||||||
msgstr "Зміна інформації про слоти AMS під час друку не підтримується"
|
msgstr "Зміна інформації про слоти AMS під час друку не підтримується"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Qidi",
|
"name": "Qidi",
|
||||||
"version": "02.04.00.10",
|
"version": "02.04.00.11",
|
||||||
"force_update": "0",
|
"force_update": "0",
|
||||||
"description": "Qidi configurations",
|
"description": "Qidi configurations",
|
||||||
"machine_model_list": [
|
"machine_model_list": [
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
"close_fan_the_first_x_layers": [
|
"close_fan_the_first_x_layers": [
|
||||||
"3"
|
"3"
|
||||||
],
|
],
|
||||||
|
"during_print_exhaust_fan_speed": [
|
||||||
|
"0"
|
||||||
|
],
|
||||||
"fan_cooling_layer_time": [
|
"fan_cooling_layer_time": [
|
||||||
"10"
|
"10"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
"close_fan_the_first_x_layers": [
|
"close_fan_the_first_x_layers": [
|
||||||
"3"
|
"3"
|
||||||
],
|
],
|
||||||
|
"during_print_exhaust_fan_speed": [
|
||||||
|
"0"
|
||||||
|
],
|
||||||
"fan_cooling_layer_time": [
|
"fan_cooling_layer_time": [
|
||||||
"10"
|
"10"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
"close_fan_the_first_x_layers": [
|
"close_fan_the_first_x_layers": [
|
||||||
"3"
|
"3"
|
||||||
],
|
],
|
||||||
|
"during_print_exhaust_fan_speed": [
|
||||||
|
"0"
|
||||||
|
],
|
||||||
"fan_cooling_layer_time": [
|
"fan_cooling_layer_time": [
|
||||||
"10"
|
"10"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ void simplify(Polygon &thiss, const int64_t smallest_line_segment_squared, const
|
|||||||
//h^2 = L^2 / b^2 [factor the divisor]
|
//h^2 = L^2 / b^2 [factor the divisor]
|
||||||
const int64_t height_2 = double(area_removed_so_far) * double(area_removed_so_far) / double(base_length_2);
|
const int64_t height_2 = double(area_removed_so_far) * double(area_removed_so_far) / double(base_length_2);
|
||||||
// Orca: The value of `height_2` is squared, so we need to compare it with the squared value
|
// Orca: The value of `height_2` is squared, so we need to compare it with the squared value
|
||||||
if ((height_2 <= Slic3r::sqr(scaled<coord_t>(0.005)) //Almost exactly colinear (barring rounding errors).
|
if ((height_2 <= Slic3r::sqr(colinear_vertex_tolerance()) //Almost exactly colinear (barring rounding errors).
|
||||||
&& Line::distance_to_infinite(current, previous, next) <= scaled<double>(0.005))) // make sure that height_2 is not small because of cancellation of positive and negative areas
|
&& Line::distance_to_infinite(current, previous, next) <= double(colinear_vertex_tolerance()))) // make sure that height_2 is not small because of cancellation of positive and negative areas
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (length2 < smallest_line_segment_squared
|
if (length2 < smallest_line_segment_squared
|
||||||
|
|||||||
@@ -133,8 +133,8 @@ void ExtrusionLine::simplify(const int64_t smallest_line_segment_squared, const
|
|||||||
const auto height_2 = int64_t(double(area_removed_so_far) * double(area_removed_so_far) / double(base_length_2));
|
const auto height_2 = int64_t(double(area_removed_so_far) * double(area_removed_so_far) / double(base_length_2));
|
||||||
const int64_t extrusion_area_error = calculateExtrusionAreaDeviationError(previous, current, next);
|
const int64_t extrusion_area_error = calculateExtrusionAreaDeviationError(previous, current, next);
|
||||||
// Orca: The value of `height_2` is squared, so we need to compare it with the squared value
|
// Orca: The value of `height_2` is squared, so we need to compare it with the squared value
|
||||||
if ((height_2 <= Slic3r::sqr(scaled<coord_t>(0.005)) // Almost exactly colinear (barring rounding errors).
|
if ((height_2 <= Slic3r::sqr(colinear_vertex_tolerance()) // Almost exactly colinear (barring rounding errors).
|
||||||
&& Line::distance_to_infinite(current.p, previous.p, next.p) <= scaled<double>(0.005)) // Make sure that height_2 is not small because of cancellation of positive and negative areas
|
&& Line::distance_to_infinite(current.p, previous.p, next.p) <= double(colinear_vertex_tolerance())) // Make sure that height_2 is not small because of cancellation of positive and negative areas
|
||||||
// We shouldn't remove middle junctions of colinear segments if the area changed for the C-P segment is exceeding the maximum allowed
|
// We shouldn't remove middle junctions of colinear segments if the area changed for the C-P segment is exceeding the maximum allowed
|
||||||
&& extrusion_area_error <= maximum_extrusion_area_deviation)
|
&& extrusion_area_error <= maximum_extrusion_area_deviation)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ class Flow;
|
|||||||
namespace Slic3r::Arachne
|
namespace Slic3r::Arachne
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// ORCA: Tolerance of the "almost exactly colinear" early-out shared by the two simplify() passes
|
||||||
|
// (this file and WallToolPaths.cpp). That test drops a vertex regardless of the user's Maximum wall
|
||||||
|
// resolution/deviation, so it has to stay at the scale of coordinate rounding noise. A larger value
|
||||||
|
// silently decimates finely tessellated curves: on a circle, one vertex may be removed whenever the
|
||||||
|
// sagitta of the resulting chord falls below the tolerance, which halves the point count and turns
|
||||||
|
// smooth arcs into corners the firmware has to decelerate through.
|
||||||
|
inline coord_t colinear_vertex_tolerance() { return coord_t(SCALED_EPSILON); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Represents a polyline (not just a line) that is to be extruded with variable
|
* Represents a polyline (not just a line) that is to be extruded with variable
|
||||||
* line width.
|
* line width.
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
|
|||||||
if (properties_shown) {
|
if (properties_shown) {
|
||||||
float label_w = 0.0f;
|
float label_w = 0.0f;
|
||||||
float value_w = 0.0f;
|
float value_w = 0.0f;
|
||||||
properties_rows.reserve(13);
|
properties_rows.reserve(14);
|
||||||
auto add_row = [&properties_rows, &label_w, &value_w](std::string label, std::string value) {
|
auto add_row = [&properties_rows, &label_w, &value_w](std::string label, std::string value) {
|
||||||
label_w = std::max(label_w, ImGui::CalcTextSize(label.c_str()).x);
|
label_w = std::max(label_w, ImGui::CalcTextSize(label.c_str()).x);
|
||||||
value_w = std::max(value_w, ImGui::CalcTextSize(value.c_str()).x);
|
value_w = std::max(value_w, ImGui::CalcTextSize(value.c_str()).x);
|
||||||
@@ -433,6 +433,27 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode
|
|||||||
add_row(_u8L("Width"), buff);
|
add_row(_u8L("Width"), buff);
|
||||||
if (is_extrusion) sprintf(buff, ("%.3f " + _u8L("mm")).c_str(), vertex.height); else strcpy(buff, NA_CSTR);
|
if (is_extrusion) sprintf(buff, ("%.3f " + _u8L("mm")).c_str(), vertex.height); else strcpy(buff, NA_CSTR);
|
||||||
add_row(_u8L("Height"), buff);
|
add_row(_u8L("Height"), buff);
|
||||||
|
// ORCA: Length of the move ending at the current vertex. Arc moves (G2/G3) are discretized
|
||||||
|
// into several vertices sharing the same gcode line id, so accumulate the whole run to report
|
||||||
|
// the arc length instead of the length of a single chord.
|
||||||
|
if (vertex_id > 0 && (is_extrusion || vertex.is_travel() || vertex.is_wipe())) {
|
||||||
|
const size_t vertices_count = viewer->get_vertices_count();
|
||||||
|
size_t first_id = vertex_id;
|
||||||
|
while (first_id > 0 && viewer->get_vertex_at(first_id - 1).gcode_id == vertex.gcode_id)
|
||||||
|
--first_id;
|
||||||
|
size_t last_id = vertex_id;
|
||||||
|
while (last_id + 1 < vertices_count && viewer->get_vertex_at(last_id + 1).gcode_id == vertex.gcode_id)
|
||||||
|
++last_id;
|
||||||
|
float length = 0.0f;
|
||||||
|
for (size_t i = std::max<size_t>(first_id, 1); i <= last_id; ++i) {
|
||||||
|
length += (libvgcode::convert(viewer->get_vertex_at(i).position) -
|
||||||
|
libvgcode::convert(viewer->get_vertex_at(i - 1).position)).norm();
|
||||||
|
}
|
||||||
|
sprintf(buff, ("%.3f " + _u8L("mm")).c_str(), length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
strcpy(buff, NA_CSTR);
|
||||||
|
add_row(_u8L("Length"), buff);
|
||||||
sprintf(buff, "%d", vertex.layer_id + 1);
|
sprintf(buff, "%d", vertex.layer_id + 1);
|
||||||
add_row(_u8L("Layer"), buff);
|
add_row(_u8L("Layer"), buff);
|
||||||
sprintf(buff, ("%.1f " + _u8L("mm/s")).c_str(), vertex.feedrate);
|
sprintf(buff, ("%.1f " + _u8L("mm/s")).c_str(), vertex.feedrate);
|
||||||
|
|||||||
Reference in New Issue
Block a user