diff --git a/build_linux.sh b/build_linux.sh index 6d65a10e41..59a0f824b8 100755 --- a/build_linux.sh +++ b/build_linux.sh @@ -8,9 +8,10 @@ SCRIPT_PATH=$(dirname "$(readlink -f "${0}")") pushd "${SCRIPT_PATH}" > /dev/null function usage() { - echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-F][-g][-h][-i][-j N][-p][-r][-s][-t][-u][-l][-L]" + echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-F][-g][-h][-i][-j N][-J N][-p][-r][-s][-t][-u][-l][-L]" echo " -1: limit builds to one core (where possible)" echo " -j N: limit builds to N cores (where possible)" + echo " -J N: build up to N dependencies at a time, each still using -j jobs (default: 1)" echo " -b: build in Debug mode" echo " -c: force a clean build" echo " -C: enable ANSI-colored compile output (GNU/Clang only)" @@ -36,12 +37,13 @@ function usage() { } SLIC3R_PRECOMPILED_HEADERS="ON" +DEPS_PARALLEL="" unset name BUILD_DIR=build BUILD_CONFIG=Release FORWARDED_ARGS=() -while getopts ":1j:bcCdDeFghiprstulL" opt ; do +while getopts ":1j:J:bcCdDeFghiprstulL" opt ; do case ${opt} in 1 ) export CMAKE_BUILD_PARALLEL_LEVEL=1 @@ -51,6 +53,10 @@ while getopts ":1j:bcCdDeFghiprstulL" opt ; do export CMAKE_BUILD_PARALLEL_LEVEL=$OPTARG FORWARDED_ARGS+=("-j" "$OPTARG") ;; + J ) + DEPS_PARALLEL=$OPTARG + FORWARDED_ARGS+=("-J" "$OPTARG") + ;; b ) BUILD_DIR=build-dbg BUILD_CONFIG=Debug @@ -135,6 +141,11 @@ if [[ -n "${CLEAN_DOCKER_IMAGE}" ]] && [[ -z "${USE_DOCKER}" ]] ; then exit 1 fi +if [[ -n "${DEPS_PARALLEL}" ]] && ! [[ "${DEPS_PARALLEL}" =~ ^[1-9][0-9]*$ ]] ; then + echo "Error: -J expects a positive integer." + exit 1 +fi + function check_available_memory_and_disk() { FREE_MEM_GB=$(free --gibi --total | grep 'Mem' | rev | cut --delimiter=" " --fields=1 | rev) MIN_MEM_GB=10 @@ -537,7 +548,29 @@ if [[ -n "${BUILD_DEPS}" ]] ; then fi print_and_run cmake -S deps -B deps/$BUILD_DIR "${CMAKE_C_CXX_COMPILER_CLANG[@]}" "${CMAKE_LLD_LINKER_ARGS[@]}" "${CMAKE_CCACHE_ARGS[@]}" -G Ninja "${COLORED_OUTPUT}" "${BUILD_ARGS[@]}" - print_and_run cmake --build deps/$BUILD_DIR -j1 + # The top-level build runs one dependency at a time by default, which keeps the console + # output readable and lets that dependency's own build use all of CMAKE_BUILD_PARALLEL_LEVEL. + # -J raises the top level instead, and -j still applies in full to every dependency, so the + # worst case is -J times -j compile jobs at once. Ninja has no job server to share a pool + # across the nested builds, so that ceiling is not enforced anywhere: pick -J to suit the RAM. + DEPS_JOBS=1 + if [[ -n "${DEPS_PARALLEL}" ]] ; then + DEPS_JOBS=${DEPS_PARALLEL} + SAVED_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL-} + export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-$(nproc)} + echo "Building up to ${DEPS_JOBS} dependencies at a time, ${CMAKE_BUILD_PARALLEL_LEVEL} jobs each: up to $(( DEPS_JOBS * CMAKE_BUILD_PARALLEL_LEVEL )) compile jobs at once." + fi + + print_and_run cmake --build deps/$BUILD_DIR -j"${DEPS_JOBS}" + + if [[ -n "${DEPS_PARALLEL}" ]] ; then + # Give the whole -j back to the OrcaSlicer build below. + if [[ -n "${SAVED_PARALLEL_LEVEL}" ]] ; then + export CMAKE_BUILD_PARALLEL_LEVEL=${SAVED_PARALLEL_LEVEL} + else + unset CMAKE_BUILD_PARALLEL_LEVEL + fi + fi fi if [[ -n "${BUILD_ORCA}" ]] || [[ -n "${BUILD_TESTS}" ]] ; then diff --git a/deps/CGAL/CGAL.cmake b/deps/CGAL/CGAL.cmake index a350677c27..a388638314 100644 --- a/deps/CGAL/CGAL.cmake +++ b/deps/CGAL/CGAL.cmake @@ -5,10 +5,10 @@ endif () orcaslicer_add_cmake_project( CGAL # GIT_REPOSITORY https://github.com/CGAL/cgal.git - # GIT_TAG 3654f780ae0c64675cabaef0e5ddaf904c48b4b7 # releases/CGAL-5.6.3 + # GIT_TAG 28811b671a12b5caa9e3688569dadbc6b3728fe6 # v6.2.1 # For whatever reason, this keeps downloading forever (repeats downloads if finished) - URL https://github.com/CGAL/cgal/releases/download/v5.6.3/CGAL-5.6.3.zip - URL_HASH SHA256=5d577acb4a9918ccb960491482da7a3838f8d363aff47e14d703f19fd84733d4 + URL https://github.com/CGAL/cgal/releases/download/v6.2.1/CGAL-6.2.1.zip + URL_HASH SHA256=eebd737d9b7f0199647ba5c1f9f6c7a3d0651aacef9c2fd4dedc52da6c25edbe DEPENDS dep_Boost dep_Eigen dep_GMP dep_MPFR ) diff --git a/deps_src/libigl/igl/copyleft/cgal/CGAL_includes.hpp b/deps_src/libigl/igl/copyleft/cgal/CGAL_includes.hpp index 38d2fc7497..6f3e3c0a1f 100644 --- a/deps_src/libigl/igl/copyleft/cgal/CGAL_includes.hpp +++ b/deps_src/libigl/igl/copyleft/cgal/CGAL_includes.hpp @@ -33,8 +33,8 @@ // Axis-aligned bounding box tree for tet tri intersection #include -#include -#include +#include +#include // Boolean operations #include diff --git a/deps_src/libigl/igl/copyleft/cgal/closest_facet.cpp b/deps_src/libigl/igl/copyleft/cgal/closest_facet.cpp index 131cc744a4..4dd10e157c 100644 --- a/deps_src/libigl/igl/copyleft/cgal/closest_facet.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/closest_facet.cpp @@ -41,9 +41,9 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet( const std::vector > & VF, const std::vector > & VFi, const CGAL::AABB_tree< - CGAL::AABB_traits< + CGAL::AABB_traits_3< Kernel, - CGAL::AABB_triangle_primitive< + CGAL::AABB_triangle_primitive_3< Kernel, typename std::vector< typename Kernel::Triangle_3 >::iterator > > > & tree, const std::vector & triangles, @@ -56,8 +56,8 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet( typedef typename Kernel::Segment_3 Segment_3; typedef typename Kernel::Triangle_3 Triangle; typedef typename std::vector::iterator Iterator; - typedef typename CGAL::AABB_triangle_primitive Primitive; - typedef typename CGAL::AABB_traits AABB_triangle_traits; + typedef typename CGAL::AABB_triangle_primitive_3 Primitive; + typedef typename CGAL::AABB_traits_3 AABB_triangle_traits; typedef typename CGAL::AABB_tree Tree; if (F.rows() <= 0 || I.rows() <= 0) { @@ -451,8 +451,8 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet( typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef Kernel::Triangle_3 Triangle; typedef std::vector::iterator Iterator; - typedef CGAL::AABB_triangle_primitive Primitive; - typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_triangle_primitive_3 Primitive; + typedef CGAL::AABB_traits_3 AABB_triangle_traits; typedef CGAL::AABB_tree Tree; if (F.rows() <= 0 || I.rows() <= 0) { @@ -498,9 +498,9 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet( #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation // generated by autoexplicit.sh -template void igl::copyleft::cgal::closest_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix>(Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, std::vector>, std::allocator>>> const&, std::vector>, std::allocator>>> const&, CGAL::AABB_tree>::iterator, CGAL::Boolean_tag>, CGAL::Default>> const&, std::vector> const&, std::vector> const&, Eigen::PlainObjectBase>&, Eigen::PlainObjectBase>&); +template void igl::copyleft::cgal::closest_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix>(Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, std::vector>, std::allocator>>> const&, std::vector>, std::allocator>>> const&, CGAL::AABB_tree>::iterator, CGAL::Boolean_tag>, CGAL::Default>> const&, std::vector> const&, std::vector> const&, Eigen::PlainObjectBase>&, Eigen::PlainObjectBase>&); // generated by autoexplicit.sh -template void igl::copyleft::cgal::closest_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix>(Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, std::vector>, std::allocator>>> const&, std::vector>, std::allocator>>> const&, CGAL::AABB_tree>::iterator, CGAL::Boolean_tag>, CGAL::Default>> const&, std::vector> const&, std::vector> const&, Eigen::PlainObjectBase>&, Eigen::PlainObjectBase>&); +template void igl::copyleft::cgal::closest_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix>(Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, std::vector>, std::allocator>>> const&, std::vector>, std::allocator>>> const&, CGAL::AABB_tree>::iterator, CGAL::Boolean_tag>, CGAL::Default>> const&, std::vector> const&, std::vector> const&, Eigen::PlainObjectBase>&, Eigen::PlainObjectBase>&); // generated by autoexplicit.sh template void igl::copyleft::cgal::closest_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix >( Eigen::MatrixBase > const&, @@ -509,7 +509,7 @@ template void igl::copyleft::cgal::closest_facet > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, - Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector > const&, std::vector > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); + Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector > const&, std::vector > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #include template void igl::copyleft::cgal::closest_facet, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck, Eigen::Matrix, Eigen::Matrix >( Eigen::MatrixBase > const&, @@ -518,7 +518,7 @@ Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, -Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector > const&, std::vector > const&, +Eigen::MatrixBase > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector > const&, std::vector > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); diff --git a/deps_src/libigl/igl/copyleft/cgal/closest_facet.h b/deps_src/libigl/igl/copyleft/cgal/closest_facet.h index 26729afd87..5be43ff633 100644 --- a/deps_src/libigl/igl/copyleft/cgal/closest_facet.h +++ b/deps_src/libigl/igl/copyleft/cgal/closest_facet.h @@ -14,8 +14,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -67,9 +67,9 @@ namespace igl const std::vector > & VF, const std::vector > & VFi, const CGAL::AABB_tree< - CGAL::AABB_traits< + CGAL::AABB_traits_3< Kernel, - CGAL::AABB_triangle_primitive< + CGAL::AABB_triangle_primitive_3< Kernel, typename std::vector< typename Kernel::Triangle_3 >::iterator > > > & tree, const std::vector & triangles, @@ -139,9 +139,9 @@ namespace igl const std::vector > & VF, const std::vector > & VFi, const CGAL::AABB_tree< - CGAL::AABB_traits< + CGAL::AABB_traits_3< Kernel, - CGAL::AABB_triangle_primitive< + CGAL::AABB_triangle_primitive_3< Kernel, typename std::vector< typename Kernel::Triangle_3 >::iterator > > > & tree, const std::vector & triangles, diff --git a/deps_src/libigl/igl/copyleft/cgal/component_inside_component.cpp b/deps_src/libigl/igl/copyleft/cgal/component_inside_component.cpp index 9580955ab8..1cc1e28a6f 100644 --- a/deps_src/libigl/igl/copyleft/cgal/component_inside_component.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/component_inside_component.cpp @@ -12,8 +12,8 @@ #include "points_inside_component.h" #include -#include -#include +#include +#include #include #include diff --git a/deps_src/libigl/igl/copyleft/cgal/extract_cells.cpp b/deps_src/libigl/igl/copyleft/cgal/extract_cells.cpp index c7856d7689..cac72b1690 100644 --- a/deps_src/libigl/igl/copyleft/cgal/extract_cells.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/extract_cells.cpp @@ -23,8 +23,8 @@ #include "../../vertex_triangle_adjacency.h" #include -#include -#include +#include +#include #include #include @@ -156,9 +156,9 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells( std::vector Is(num_components); std::vector< CGAL::AABB_tree< - CGAL::AABB_traits< + CGAL::AABB_traits_3< Kernel, - CGAL::AABB_triangle_primitive< + CGAL::AABB_triangle_primitive_3< Kernel, std::vector< Kernel::Triangle_3 >::iterator > > > > trees(num_components); std::vector< std::vector > diff --git a/deps_src/libigl/igl/copyleft/cgal/hausdorff.cpp b/deps_src/libigl/igl/copyleft/cgal/hausdorff.cpp index 21127932f7..fb505f17c0 100644 --- a/deps_src/libigl/igl/copyleft/cgal/hausdorff.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/hausdorff.cpp @@ -9,8 +9,8 @@ template < IGL_INLINE void igl::copyleft::cgal::hausdorff( const Eigen::MatrixBase& V, const CGAL::AABB_tree< - CGAL::AABB_traits >::iterator > > @@ -27,8 +27,8 @@ IGL_INLINE void igl::copyleft::cgal::hausdorff( { CGAL::Point_3 query(x,y,z); typename CGAL::AABB_tree< - CGAL::AABB_traits >::iterator > > @@ -41,5 +41,5 @@ IGL_INLINE void igl::copyleft::cgal::hausdorff( #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation // generated by autoexplicit.sh -template void igl::copyleft::cgal::hausdorff, CGAL::Simple_cartesian, double>(Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector >, std::allocator > > > const&, double&, double&); +template void igl::copyleft::cgal::hausdorff, CGAL::Simple_cartesian, double>(Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive_3, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector >, std::allocator > > > const&, double&, double&); #endif diff --git a/deps_src/libigl/igl/copyleft/cgal/hausdorff.h b/deps_src/libigl/igl/copyleft/cgal/hausdorff.h index fd8ae64e07..08fc8afa6c 100644 --- a/deps_src/libigl/igl/copyleft/cgal/hausdorff.h +++ b/deps_src/libigl/igl/copyleft/cgal/hausdorff.h @@ -38,8 +38,8 @@ namespace igl IGL_INLINE void hausdorff( const Eigen::MatrixBase& V, const CGAL::AABB_tree< - CGAL::AABB_traits >::iterator > > diff --git a/deps_src/libigl/igl/copyleft/cgal/outer_hull.cpp b/deps_src/libigl/igl/copyleft/cgal/outer_hull.cpp index 9fd7899e90..baaee4be32 100644 --- a/deps_src/libigl/igl/copyleft/cgal/outer_hull.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/outer_hull.cpp @@ -12,8 +12,8 @@ #include "../../remove_unreferenced.h" #include -#include -#include +#include +#include #include #include diff --git a/deps_src/libigl/igl/copyleft/cgal/outer_hull_legacy.cpp b/deps_src/libigl/igl/copyleft/cgal/outer_hull_legacy.cpp index 0d164afedf..712a322f94 100644 --- a/deps_src/libigl/igl/copyleft/cgal/outer_hull_legacy.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/outer_hull_legacy.cpp @@ -12,8 +12,8 @@ #include "../../remove_unreferenced.h" #include -#include -#include +#include +#include #include #include diff --git a/deps_src/libigl/igl/copyleft/cgal/point_mesh_squared_distance.cpp b/deps_src/libigl/igl/copyleft/cgal/point_mesh_squared_distance.cpp index c146969c49..93ca6e4545 100644 --- a/deps_src/libigl/igl/copyleft/cgal/point_mesh_squared_distance.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/point_mesh_squared_distance.cpp @@ -29,8 +29,8 @@ IGL_INLINE void igl::copyleft::cgal::point_mesh_squared_distance( using namespace std; typedef CGAL::Triangle_3 Triangle_3; typedef typename std::vector::iterator Iterator; - typedef CGAL::AABB_triangle_primitive Primitive; - typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_triangle_primitive_3 Primitive; + typedef CGAL::AABB_traits_3 AABB_triangle_traits; typedef CGAL::AABB_tree Tree; Tree tree; vector T; @@ -43,8 +43,8 @@ IGL_INLINE void igl::copyleft::cgal::point_mesh_squared_distance_precompute( const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, CGAL::AABB_tree< - CGAL::AABB_traits >::iterator > > @@ -90,8 +90,8 @@ template < IGL_INLINE void igl::copyleft::cgal::point_mesh_squared_distance( const Eigen::MatrixBase & P, const CGAL::AABB_tree< - CGAL::AABB_traits >::iterator > > @@ -103,8 +103,8 @@ IGL_INLINE void igl::copyleft::cgal::point_mesh_squared_distance( { typedef CGAL::Triangle_3 Triangle_3; typedef typename std::vector::iterator Iterator; - typedef CGAL::AABB_triangle_primitive Primitive; - typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_triangle_primitive_3 Primitive; + typedef CGAL::AABB_traits_3 AABB_triangle_traits; typedef CGAL::AABB_tree Tree; typedef typename Tree::Point_and_primitive_id Point_and_primitive_id; typedef CGAL::Point_3 Point_3; @@ -134,7 +134,7 @@ IGL_INLINE void igl::copyleft::cgal::point_mesh_squared_distance( template void igl::copyleft::cgal::point_mesh_squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix>(Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::MatrixBase> const&, Eigen::PlainObjectBase>&, Eigen::PlainObjectBase>&, Eigen::PlainObjectBase>&); template void igl::copyleft::cgal::point_mesh_squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template void igl::copyleft::cgal::point_mesh_squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::copyleft::cgal::point_mesh_squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); -template void igl::copyleft::cgal::point_mesh_squared_distance_precompute, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> >&, std::vector >, std::allocator > > >&); -template void igl::copyleft::cgal::point_mesh_squared_distance_precompute, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> >&, std::vector >, std::allocator > > >&); +template void igl::copyleft::cgal::point_mesh_squared_distance, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive_3, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> > const&, std::vector >, std::allocator > > > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template void igl::copyleft::cgal::point_mesh_squared_distance_precompute, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive_3, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> >&, std::vector >, std::allocator > > >&); +template void igl::copyleft::cgal::point_mesh_squared_distance_precompute, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree, CGAL::AABB_triangle_primitive_3, std::vector >, std::allocator > > >::iterator, CGAL::Boolean_tag >, CGAL::Default> >&, std::vector >, std::allocator > > >&); #endif diff --git a/deps_src/libigl/igl/copyleft/cgal/point_mesh_squared_distance.h b/deps_src/libigl/igl/copyleft/cgal/point_mesh_squared_distance.h index 2eb338e3b9..6bc72463fc 100644 --- a/deps_src/libigl/igl/copyleft/cgal/point_mesh_squared_distance.h +++ b/deps_src/libigl/igl/copyleft/cgal/point_mesh_squared_distance.h @@ -63,8 +63,8 @@ namespace igl const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, CGAL::AABB_tree< - CGAL::AABB_traits >::iterator > > @@ -89,8 +89,8 @@ namespace igl IGL_INLINE void point_mesh_squared_distance( const Eigen::MatrixBase & P, const CGAL::AABB_tree< - CGAL::AABB_traits >::iterator > > diff --git a/deps_src/libigl/igl/copyleft/cgal/points_inside_component.cpp b/deps_src/libigl/igl/copyleft/cgal/points_inside_component.cpp index 657aca4585..e92243cad8 100644 --- a/deps_src/libigl/igl/copyleft/cgal/points_inside_component.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/points_inside_component.cpp @@ -13,8 +13,8 @@ #include "assign_scalar.h" #include -#include -#include +#include +#include #include #include @@ -35,8 +35,8 @@ namespace igl { typedef Kernel::Triangle_3 Triangle; typedef Kernel::Plane_3 Plane_3; typedef std::vector::iterator Iterator; - typedef CGAL::AABB_triangle_primitive Primitive; - typedef CGAL::AABB_traits AABB_triangle_traits; + typedef CGAL::AABB_triangle_primitive_3 Primitive; + typedef CGAL::AABB_traits_3 AABB_triangle_traits; typedef CGAL::AABB_tree Tree; template diff --git a/deps_src/libigl/igl/copyleft/cgal/signed_distance_isosurface.cpp b/deps_src/libigl/igl/copyleft/cgal/signed_distance_isosurface.cpp index 32587efd12..e62648772b 100644 --- a/deps_src/libigl/igl/copyleft/cgal/signed_distance_isosurface.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/signed_distance_isosurface.cpp @@ -23,8 +23,8 @@ #include // Axis-aligned bounding box tree for tet tri intersection #include -#include -#include +#include +#include #include IGL_INLINE bool igl::copyleft::cgal::signed_distance_isosurface( diff --git a/deps_src/libigl/igl/copyleft/cgal/submesh_aabb_tree.cpp b/deps_src/libigl/igl/copyleft/cgal/submesh_aabb_tree.cpp index 1bdfca5bcb..82b85dea2a 100644 --- a/deps_src/libigl/igl/copyleft/cgal/submesh_aabb_tree.cpp +++ b/deps_src/libigl/igl/copyleft/cgal/submesh_aabb_tree.cpp @@ -18,9 +18,9 @@ IGL_INLINE void igl::copyleft::cgal::submesh_aabb_tree( const Eigen::MatrixBase& F, const Eigen::MatrixBase& I, CGAL::AABB_tree< - CGAL::AABB_traits< + CGAL::AABB_traits_3< Kernel, - CGAL::AABB_triangle_primitive< + CGAL::AABB_triangle_primitive_3< Kernel, typename std::vector< typename Kernel::Triangle_3 >::iterator > > > & tree, std::vector & triangles, @@ -51,7 +51,7 @@ IGL_INLINE void igl::copyleft::cgal::submesh_aabb_tree( #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation // generated by autoexplicit.sh -template void igl::copyleft::cgal::submesh_aabb_tree, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); -template void igl::copyleft::cgal::submesh_aabb_tree, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); -template void igl::copyleft::cgal::submesh_aabb_tree, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); +template void igl::copyleft::cgal::submesh_aabb_tree, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); +template void igl::copyleft::cgal::submesh_aabb_tree, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); +template void igl::copyleft::cgal::submesh_aabb_tree, Eigen::Matrix, Eigen::Matrix, CGAL::Epeck>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, CGAL::AABB_tree >::iterator, CGAL::Boolean_tag > > >&, std::vector >&, std::vector >&); #endif diff --git a/deps_src/libigl/igl/copyleft/cgal/submesh_aabb_tree.h b/deps_src/libigl/igl/copyleft/cgal/submesh_aabb_tree.h index 5936845f3e..23309d7338 100644 --- a/deps_src/libigl/igl/copyleft/cgal/submesh_aabb_tree.h +++ b/deps_src/libigl/igl/copyleft/cgal/submesh_aabb_tree.h @@ -14,8 +14,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -44,9 +44,9 @@ namespace igl const Eigen::MatrixBase& F, const Eigen::MatrixBase& I, CGAL::AABB_tree< - CGAL::AABB_traits< + CGAL::AABB_traits_3< Kernel, - CGAL::AABB_triangle_primitive< + CGAL::AABB_triangle_primitive_3< Kernel, typename std::vector< typename Kernel::Triangle_3 >::iterator > > > & tree, std::vector & triangles, diff --git a/docs/HLSD/preset-cache.md b/docs/HLSD/preset-cache.md index aa39d522a0..ed7403f5ef 100644 --- a/docs/HLSD/preset-cache.md +++ b/docs/HLSD/preset-cache.md @@ -39,7 +39,7 @@ presets are never serialized — they have their own storage and their own lifec | Location | Contents on a shipped build | Role | |---|---|---| -| `resources/profiles/` | `.opc` alone — the profile and its preset JSONs both pruned | What the app ships with; what installing copies from, and the only thing it is read for | +| `resources/profiles/` | `.opc` alone — the profile and its preset JSONs both pruned | What the app ships with and what installing copies from; read directly for vendors not installed | | `/system/` | `.opc` alone, or `.json` + `/` after an update | What the user has installed | | `/system/` (dev build) | `.json` + `/` + `.opc` written at runtime | A developer tree caches as it parses | | `/cache/wizard_profile_data.json` | The wizard's derived vendor catalog plus the stamps it was built from | Written and read by the setup wizard only; never shipped (see "The wizard's profile-data cache") | @@ -182,10 +182,11 @@ one startup. **A vendor is loaded from where it is installed and nowhere else.** For startup that is `/system/`; resources reaches the app by being *installed* into that -directory first, never by being loaded from. (The setup wizard is the one caller with -a different notion of "where": it also shows vendors the user has not installed, and -loads those from `resources/profiles` — see "The wizard's profile-data cache".) There -is one lookup tier and one parse source: +directory first, never by being loaded from. (The setup wizard and the Create Printer +dialog also offer vendors the user has not installed, and load those from +`resources/profiles`; see "The wizard's profile-data cache". The dialog's vendor-only and +filament-only scans read a cache only where it is the whole installation, and never write +one.) There is one lookup tier and one parse source: ``` load vendor V from /system: diff --git a/docs/HLSD/separated-infills.md b/docs/HLSD/separated-infills.md new file mode 100644 index 0000000000..b7f12f4199 --- /dev/null +++ b/docs/HLSD/separated-infills.md @@ -0,0 +1,90 @@ +# Separated infills — High Level Design + +## Purpose and scope + +An object's infill patterns are laid out from one reference point, the center +of the object. When an object groups several parts that do not touch, every +part cuts the same object-wide pattern at a different place, so equal parts get +different infill. `separated_infills` lays the infill of every connected body +out from the center of that body instead, as if the body were sliced on its own. + +The option covers sparse infill, internal solid infill and bridges. Top and +bottom surfaces are left to `center_of_surface_pattern`, which centers the +Archimedean Chords and Octagram Spiral surface patterns. The option is off by +default; with it off, or for an object made of a single body, no fill changes. +Adaptive Cubic and Support Cubic do not depend on the option: they always fill +each body on its own (see Octree infill). + +## Bodies + +`PrintObject::prepare_infill()` groups the islands of every layer (`lslices`) +into 3D connected bodies before bridges are detected, so bridge anchors and +printed infill share one origin. Islands on adjacent layers belong to one body +when their slices overlap. Parts that touch or overlap form one body. Separate +parts, disconnected islands of one mesh, and interleaved parts that never touch, +such as chain links, each form their own. Every island stores the index of its +body in `Layer::lslices_separated_component_ids`, and +`PrintObject::separated_body_bboxes()` holds the bounding box of each body over +all its layers. + +The pass runs when a region uses separated infills, per-model surface centering +or an octree infill pattern. It is skipped when the object has one model part +that cannot be split, since a single body already shares the object center. + +## Centering a fill + +`infill_body()` matches each fill region to the island it overlaps most, among +the islands whose bounding boxes overlap it, and the filler takes the bounding +box of that island's body instead of the object's. The box covers every layer +of the body, which is the box the body gets when sliced alone, so patterns that +depend on its extent as well as its center come out the same too. Bridge +anchoring (`Layer::generate_sparse_infill_polylines_for_anchoring()`) makes the +same choice, so the anchors match the printed infill. + +The patterns follow the body's box in one of two ways: + +- Rectilinear and its variants, Line, Grid, Triangles, Tri-hexagon, Cubic, + Quarter Cubic, Lateral Lattice, Lateral Honeycomb and the plane-path patterns + (Hilbert Curve, Archimedean Chords, Octagram Spiral) are laid out from the + box: they phase their lines through its center, and Hilbert Curve and the Zig + Zag links start from its corner. `Fill::extended_object_bounding_box()` + extends the box about its center, so it also serves a box that is not + centered on the origin. +- Honeycomb, 3D Honeycomb, Cross Hatch, Gyroid, TPMS-D and TPMS-FK are laid out + from the coordinate origin, which is the object center. They return true from + `Fill::aligned_to_origin()`, and `Fill::fill_surface()` moves each region so + that the box center lands on the origin, fills it, and moves the paths back. + With the default box the center is the origin, so nothing moves. + +`is_separable_infill_pattern()` lists these patterns. The settings show the +option only when the sparse infill pattern is one of them. + +## Octree infill + +Adaptive Cubic and Support Cubic take their lines from an octree, laid out from +the center of the mesh it is built from and refined near its surfaces. An +octree of the whole object would lay every part out from the object's center +and refine it near the other parts, so these patterns +(`is_octree_infill_pattern()`) always fill each body on its own, and the +settings hide the option for them. + +For an object of several bodies, `PrintObject::prepare_adaptive_infill_data()` +builds one octree per body (`FillAdaptive::Octrees`) from the triangles of that +body only, which is the octree the body gets when sliced alone. Each connected +component of the mesh goes to the body that most of a few sampled triangles lie +on. A sample is taken a layer height inside the solid, behind the triangle, and +looked up in the islands of the nearest layer. Each internal bridge surface goes +to the body of its island. The fill takes the octree of the region's body, from +the same `infill_body()`. The octree of the whole object is built only for an +object of a single body, or when some body received no triangles, which then +uses it. + +## Patterns left out + +Lightning grows its trees over the whole object, so moving a reference point +cannot center it on one body. Concentric and Spiral Inset follow the outline of +each region and need no centering. + +Solid infill at full density spaces its lines over the extent of each region, +so it is already independent of the other bodies. Only bridges, which keep +their line spacing, and the plane-path solid patterns depend on the center. diff --git a/resources/profiles/Anycubic/Anycubic Kobra 3 V2_buildplate_model.stl b/resources/profiles/Anycubic/Anycubic Kobra 3 V2_buildplate_model.stl index 12b2e0b5cc..96d3b218ad 100644 Binary files a/resources/profiles/Anycubic/Anycubic Kobra 3 V2_buildplate_model.stl and b/resources/profiles/Anycubic/Anycubic Kobra 3 V2_buildplate_model.stl differ diff --git a/resources/profiles/Anycubic/Anycubic Kobra 3 V2_cover.png b/resources/profiles/Anycubic/Anycubic Kobra 3 V2_cover.png index a1700488ca..c3f6f1a6b0 100644 Binary files a/resources/profiles/Anycubic/Anycubic Kobra 3 V2_cover.png and b/resources/profiles/Anycubic/Anycubic Kobra 3 V2_cover.png differ diff --git a/resources/profiles/BBL/Bambu Lab A2L_cover.png b/resources/profiles/BBL/Bambu Lab A2L_cover.png index 513fa6fdaa..77dc5a80ee 100644 Binary files a/resources/profiles/BBL/Bambu Lab A2L_cover.png and b/resources/profiles/BBL/Bambu Lab A2L_cover.png differ diff --git a/resources/profiles/BBL/Bambu Lab H2C_cover.png b/resources/profiles/BBL/Bambu Lab H2C_cover.png index 6dfddf5ef6..2e4a6e97da 100644 Binary files a/resources/profiles/BBL/Bambu Lab H2C_cover.png and b/resources/profiles/BBL/Bambu Lab H2C_cover.png differ diff --git a/resources/profiles/BBL/Bambu Lab H2D Pro_cover.png b/resources/profiles/BBL/Bambu Lab H2D Pro_cover.png index 3eb7b4cc07..d45e231794 100644 Binary files a/resources/profiles/BBL/Bambu Lab H2D Pro_cover.png and b/resources/profiles/BBL/Bambu Lab H2D Pro_cover.png differ diff --git a/resources/profiles/BBL/Bambu Lab H2S_cover.png b/resources/profiles/BBL/Bambu Lab H2S_cover.png index d2c5718d95..70a048d50a 100644 Binary files a/resources/profiles/BBL/Bambu Lab H2S_cover.png and b/resources/profiles/BBL/Bambu Lab H2S_cover.png differ diff --git a/resources/profiles/BBL/Bambu Lab P2S_cover.png b/resources/profiles/BBL/Bambu Lab P2S_cover.png index febba125ee..b839c763b3 100644 Binary files a/resources/profiles/BBL/Bambu Lab P2S_cover.png and b/resources/profiles/BBL/Bambu Lab P2S_cover.png differ diff --git a/resources/profiles/BBL/Bambu Lab X2D_cover.png b/resources/profiles/BBL/Bambu Lab X2D_cover.png index 7478f9007f..fa4b9cf8fe 100644 Binary files a/resources/profiles/BBL/Bambu Lab X2D_cover.png and b/resources/profiles/BBL/Bambu Lab X2D_cover.png differ diff --git a/resources/profiles/BBL/bbl-3dp-A1M.stl b/resources/profiles/BBL/bbl-3dp-A1M.stl index ccdc7982e0..1a12851411 100644 Binary files a/resources/profiles/BBL/bbl-3dp-A1M.stl and b/resources/profiles/BBL/bbl-3dp-A1M.stl differ diff --git a/resources/profiles/BBL/bbl-3dp-H2C.stl b/resources/profiles/BBL/bbl-3dp-H2C.stl index 0936bd1d33..9c1f4c0cf7 100644 Binary files a/resources/profiles/BBL/bbl-3dp-H2C.stl and b/resources/profiles/BBL/bbl-3dp-H2C.stl differ diff --git a/resources/profiles/BBL/bbl-3dp-H2D.stl b/resources/profiles/BBL/bbl-3dp-H2D.stl index 5c81ba64bb..d6d7d3d630 100644 Binary files a/resources/profiles/BBL/bbl-3dp-H2D.stl and b/resources/profiles/BBL/bbl-3dp-H2D.stl differ diff --git a/resources/profiles/BBL/bbl-3dp-O1S.stl b/resources/profiles/BBL/bbl-3dp-O1S.stl index d69a50bcd6..a920ee1559 100644 Binary files a/resources/profiles/BBL/bbl-3dp-O1S.stl and b/resources/profiles/BBL/bbl-3dp-O1S.stl differ diff --git a/resources/profiles/BBL/bbl-3dp-X1.stl b/resources/profiles/BBL/bbl-3dp-X1.stl index 6823cdb229..abe6139562 100644 Binary files a/resources/profiles/BBL/bbl-3dp-X1.stl and b/resources/profiles/BBL/bbl-3dp-X1.stl differ diff --git a/resources/profiles/BBL/bbl-3dp-hotend.stl b/resources/profiles/BBL/bbl-3dp-hotend.stl index 4138160ec0..56467490bd 100644 Binary files a/resources/profiles/BBL/bbl-3dp-hotend.stl and b/resources/profiles/BBL/bbl-3dp-hotend.stl differ diff --git a/resources/profiles/Creality.json b/resources/profiles/Creality.json index f9657c7034..e2fbd27dc1 100644 --- a/resources/profiles/Creality.json +++ b/resources/profiles/Creality.json @@ -1,6 +1,6 @@ { "name": "Creality", - "version": "02.03.02.86", + "version": "02.03.02.87", "force_update": "0", "description": "Creality configurations", "machine_model_list": [ diff --git a/resources/profiles/Creality/Creality CR-10 Smart Pro_cover.png b/resources/profiles/Creality/Creality CR-10 Smart Pro_cover.png index c5e08d43f8..b0a792293a 100644 Binary files a/resources/profiles/Creality/Creality CR-10 Smart Pro_cover.png and b/resources/profiles/Creality/Creality CR-10 Smart Pro_cover.png differ diff --git a/resources/profiles/Creality/Creality CR-10 Smart_cover.png b/resources/profiles/Creality/Creality CR-10 Smart_cover.png index 49f7428c7b..4b8b6c7a07 100644 Binary files a/resources/profiles/Creality/Creality CR-10 Smart_cover.png and b/resources/profiles/Creality/Creality CR-10 Smart_cover.png differ diff --git a/resources/profiles/Creality/Creality CR-10S Pro V2_cover.png b/resources/profiles/Creality/Creality CR-10S Pro V2_cover.png index d618492c16..6642610f50 100644 Binary files a/resources/profiles/Creality/Creality CR-10S Pro V2_cover.png and b/resources/profiles/Creality/Creality CR-10S Pro V2_cover.png differ diff --git a/resources/profiles/Creality/Creality CR-10_cover.png b/resources/profiles/Creality/Creality CR-10_cover.png index dafbcf750a..10cfdbbc8e 100644 Binary files a/resources/profiles/Creality/Creality CR-10_cover.png and b/resources/profiles/Creality/Creality CR-10_cover.png differ diff --git a/resources/profiles/Creality/Creality CR-20 Pro_cover.png b/resources/profiles/Creality/Creality CR-20 Pro_cover.png index 7f27867edf..9eb45800a3 100644 Binary files a/resources/profiles/Creality/Creality CR-20 Pro_cover.png and b/resources/profiles/Creality/Creality CR-20 Pro_cover.png differ diff --git a/resources/profiles/Creality/Creality CR-M4 SE_cover.png b/resources/profiles/Creality/Creality CR-M4 SE_cover.png index 84495c6074..62b9354783 100644 Binary files a/resources/profiles/Creality/Creality CR-M4 SE_cover.png and b/resources/profiles/Creality/Creality CR-M4 SE_cover.png differ diff --git a/resources/profiles/Creality/Creality Ender-2 Pro_cover.png b/resources/profiles/Creality/Creality Ender-2 Pro_cover.png index 882d4b7475..41e5a5fed1 100644 Binary files a/resources/profiles/Creality/Creality Ender-2 Pro_cover.png and b/resources/profiles/Creality/Creality Ender-2 Pro_cover.png differ diff --git a/resources/profiles/Creality/Creality Ender-3 Max Neo_cover.png b/resources/profiles/Creality/Creality Ender-3 Max Neo_cover.png index ba733c734f..5123446a6e 100644 Binary files a/resources/profiles/Creality/Creality Ender-3 Max Neo_cover.png and b/resources/profiles/Creality/Creality Ender-3 Max Neo_cover.png differ diff --git a/resources/profiles/Creality/Creality Ender-3 Max_cover.png b/resources/profiles/Creality/Creality Ender-3 Max_cover.png index 1c43c97125..6516e96473 100644 Binary files a/resources/profiles/Creality/Creality Ender-3 Max_cover.png and b/resources/profiles/Creality/Creality Ender-3 Max_cover.png differ diff --git a/resources/profiles/Creality/Creality Ender-3 Neo_cover.png b/resources/profiles/Creality/Creality Ender-3 Neo_cover.png index ff0967c003..2454b99141 100644 Binary files a/resources/profiles/Creality/Creality Ender-3 Neo_cover.png and b/resources/profiles/Creality/Creality Ender-3 Neo_cover.png differ diff --git a/resources/profiles/Creality/Creality Ender-3 S1 Sonic_cover.png b/resources/profiles/Creality/Creality Ender-3 S1 Sonic_cover.png index c8f332c45c..1a36099af0 100644 Binary files a/resources/profiles/Creality/Creality Ender-3 S1 Sonic_cover.png and b/resources/profiles/Creality/Creality Ender-3 S1 Sonic_cover.png differ diff --git a/resources/profiles/Creality/Creality Ender-5 S1 Sonic_cover.png b/resources/profiles/Creality/Creality Ender-5 S1 Sonic_cover.png index 9dd3eda57f..b353095b90 100644 Binary files a/resources/profiles/Creality/Creality Ender-5 S1 Sonic_cover.png and b/resources/profiles/Creality/Creality Ender-5 S1 Sonic_cover.png differ diff --git a/resources/profiles/Creality/Creality Sermoon D3 Pro_cover.png b/resources/profiles/Creality/Creality Sermoon D3 Pro_cover.png index 7fd3b2f18c..875516aae3 100644 Binary files a/resources/profiles/Creality/Creality Sermoon D3 Pro_cover.png and b/resources/profiles/Creality/Creality Sermoon D3 Pro_cover.png differ diff --git a/resources/profiles/Creality/Creality Sermoon D3_cover.png b/resources/profiles/Creality/Creality Sermoon D3_cover.png index e8cb509a0e..f5621bdd86 100644 Binary files a/resources/profiles/Creality/Creality Sermoon D3_cover.png and b/resources/profiles/Creality/Creality Sermoon D3_cover.png differ diff --git a/resources/profiles/Creality/Creality Sermoon M300_cover.png b/resources/profiles/Creality/Creality Sermoon M300_cover.png index 4322bbf6ee..bafb94b5e1 100644 Binary files a/resources/profiles/Creality/Creality Sermoon M300_cover.png and b/resources/profiles/Creality/Creality Sermoon M300_cover.png differ diff --git a/resources/profiles/Creality/Creality Sermoon V1 Pro_cover.png b/resources/profiles/Creality/Creality Sermoon V1 Pro_cover.png index cbe6eaed51..6e3e9e3398 100644 Binary files a/resources/profiles/Creality/Creality Sermoon V1 Pro_cover.png and b/resources/profiles/Creality/Creality Sermoon V1 Pro_cover.png differ diff --git a/resources/profiles/Creality/Creality Sermoon V1_cover.png b/resources/profiles/Creality/Creality Sermoon V1_cover.png index a03a156c9f..fc48d7ae34 100644 Binary files a/resources/profiles/Creality/Creality Sermoon V1_cover.png and b/resources/profiles/Creality/Creality Sermoon V1_cover.png differ diff --git a/resources/profiles/Creality/creality_ender2pro_buildplate_model.stl b/resources/profiles/Creality/creality_ender2pro_buildplate_model.stl new file mode 100644 index 0000000000..fdf4b6c430 Binary files /dev/null and b/resources/profiles/Creality/creality_ender2pro_buildplate_model.stl differ diff --git a/resources/profiles/Creality/creality_ender2pro_buildplate_texture.svg b/resources/profiles/Creality/creality_ender2pro_buildplate_texture.svg new file mode 100644 index 0000000000..d8fc85dbde --- /dev/null +++ b/resources/profiles/Creality/creality_ender2pro_buildplate_texture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/profiles/Creality/creality_sermoond3_buildplate_model.stl b/resources/profiles/Creality/creality_sermoond3_buildplate_model.stl new file mode 100644 index 0000000000..1dfd9dc3c2 Binary files /dev/null and b/resources/profiles/Creality/creality_sermoond3_buildplate_model.stl differ diff --git a/resources/profiles/Creality/creality_sermoond3_buildplate_texture.svg b/resources/profiles/Creality/creality_sermoond3_buildplate_texture.svg new file mode 100644 index 0000000000..d8fc85dbde --- /dev/null +++ b/resources/profiles/Creality/creality_sermoond3_buildplate_texture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/profiles/Creality/machine/Creality Ender-2 Pro.json b/resources/profiles/Creality/machine/Creality Ender-2 Pro.json index 3407d33800..b50d06b186 100644 --- a/resources/profiles/Creality/machine/Creality Ender-2 Pro.json +++ b/resources/profiles/Creality/machine/Creality Ender-2 Pro.json @@ -2,9 +2,9 @@ "type": "machine_model", "name": "Creality Ender-2 Pro", "nozzle_diameter": "0.4", - "bed_model": "creality_k1_buildplate_model.stl", + "bed_model": "creality_ender2pro_buildplate_model.stl", "default_bed_type": "Cool Plate", - "bed_texture": "", + "bed_texture": "creality_ender2pro_buildplate_texture.svg", "family": "Creality", "hotend_model": "", "machine_tech": "FFF", diff --git a/resources/profiles/Creality/machine/Creality Sermoon D3 Pro.json b/resources/profiles/Creality/machine/Creality Sermoon D3 Pro.json index 5218ce111b..3ff51dc2e8 100644 --- a/resources/profiles/Creality/machine/Creality Sermoon D3 Pro.json +++ b/resources/profiles/Creality/machine/Creality Sermoon D3 Pro.json @@ -2,9 +2,9 @@ "type": "machine_model", "name": "Creality Sermoon D3 Pro", "nozzle_diameter": "0.4", - "bed_model": "creality_cr10v2_buildplate_model.stl", + "bed_model": "creality_sermoond3_buildplate_model.stl", "default_bed_type": "High Temp Plate", - "bed_texture": "creality_cr10v2_buildplate_texture.svg", + "bed_texture": "creality_sermoond3_buildplate_texture.svg", "family": "Creality", "hotend_model": "", "machine_tech": "FFF", diff --git a/resources/profiles/Creality/machine/Creality Sermoon D3.json b/resources/profiles/Creality/machine/Creality Sermoon D3.json index 3eeb52b32f..28f6bfafe2 100644 --- a/resources/profiles/Creality/machine/Creality Sermoon D3.json +++ b/resources/profiles/Creality/machine/Creality Sermoon D3.json @@ -2,9 +2,9 @@ "type": "machine_model", "name": "Creality Sermoon D3", "nozzle_diameter": "0.4", - "bed_model": "creality_cr10v2_buildplate_model.stl", + "bed_model": "creality_sermoond3_buildplate_model.stl", "default_bed_type": "High Temp Plate", - "bed_texture": "creality_cr10v2_buildplate_texture.svg", + "bed_texture": "creality_sermoond3_buildplate_texture.svg", "family": "Creality", "hotend_model": "", "machine_tech": "FFF", diff --git a/resources/profiles/Creality/machine/Creality Sermoon V1 Pro.json b/resources/profiles/Creality/machine/Creality Sermoon V1 Pro.json index df70f60379..12e9f318e8 100644 --- a/resources/profiles/Creality/machine/Creality Sermoon V1 Pro.json +++ b/resources/profiles/Creality/machine/Creality Sermoon V1 Pro.json @@ -2,9 +2,9 @@ "type": "machine_model", "name": "Creality Sermoon V1 Pro", "nozzle_diameter": "0.4", - "bed_model": "creality_k1_buildplate_model.stl", + "bed_model": "creality_sermoonv1_buildplate_model.stl", "default_bed_type": "Cool Plate", - "bed_texture": "", + "bed_texture": "creality_sermoonv1_buildplate_texture.svg", "family": "Creality", "hotend_model": "", "machine_tech": "FFF", diff --git a/resources/profiles/Elegoo.json b/resources/profiles/Elegoo.json index e85c442406..e0580014a9 100644 --- a/resources/profiles/Elegoo.json +++ b/resources/profiles/Elegoo.json @@ -1,6 +1,6 @@ { "name": "Elegoo", - "version": "02.04.00.12", + "version": "02.04.00.11", "force_update": "0", "description": "Elegoo configurations", "machine_model_list": [ diff --git a/resources/profiles/Elegoo/filament/BASE/Elegoo PLA @base.json b/resources/profiles/Elegoo/filament/BASE/Elegoo PLA @base.json index 21112c1791..8965bae8e1 100644 --- a/resources/profiles/Elegoo/filament/BASE/Elegoo PLA @base.json +++ b/resources/profiles/Elegoo/filament/BASE/Elegoo PLA @base.json @@ -15,6 +15,6 @@ "Elegoo" ], "filament_start_gcode": [ - "; Elegoo PLA filament start gcode\n" + "; filament start gcode\n" ] } diff --git a/resources/profiles/Kingroon.json b/resources/profiles/Kingroon.json index 4c9a128ead..54ee32fbdc 100644 --- a/resources/profiles/Kingroon.json +++ b/resources/profiles/Kingroon.json @@ -1,7 +1,7 @@ { "name": "Kingroon", "url": "https://kingroon.com/", - "version": "02.04.00.03", + "version": "02.04.00.04", "force_update": "1", "description": "Kingroon configuration files", "machine_model_list": [ diff --git a/resources/profiles/Kingroon/Kingroon KP3S 3.0_cover.png b/resources/profiles/Kingroon/Kingroon KP3S 3.0_cover.png index 8976756e9c..31eb543c09 100644 Binary files a/resources/profiles/Kingroon/Kingroon KP3S 3.0_cover.png and b/resources/profiles/Kingroon/Kingroon KP3S 3.0_cover.png differ diff --git a/resources/profiles/Kingroon/Kingroon KP3S PRO S1_cover.png b/resources/profiles/Kingroon/Kingroon KP3S PRO S1_cover.png index bfee1ae222..5e74776e94 100644 Binary files a/resources/profiles/Kingroon/Kingroon KP3S PRO S1_cover.png and b/resources/profiles/Kingroon/Kingroon KP3S PRO S1_cover.png differ diff --git a/resources/profiles/Kingroon/Kingroon KP3S PRO V2_cover.png b/resources/profiles/Kingroon/Kingroon KP3S PRO V2_cover.png index 5399d4821d..4917f9a702 100644 Binary files a/resources/profiles/Kingroon/Kingroon KP3S PRO V2_cover.png and b/resources/profiles/Kingroon/Kingroon KP3S PRO V2_cover.png differ diff --git a/resources/profiles/Kingroon/Kingroon KP3S V1_cover.png b/resources/profiles/Kingroon/Kingroon KP3S V1_cover.png index 4f98c81d03..c0649cb93d 100644 Binary files a/resources/profiles/Kingroon/Kingroon KP3S V1_cover.png and b/resources/profiles/Kingroon/Kingroon KP3S V1_cover.png differ diff --git a/resources/profiles/Kingroon/Kingroon_buildplate.png b/resources/profiles/Kingroon/Kingroon_buildplate.png deleted file mode 100644 index 23acdec814..0000000000 Binary files a/resources/profiles/Kingroon/Kingroon_buildplate.png and /dev/null differ diff --git a/resources/profiles/Kingroon/Kingroon_buildplate.svg b/resources/profiles/Kingroon/Kingroon_buildplate.svg new file mode 100644 index 0000000000..548cbc7f74 --- /dev/null +++ b/resources/profiles/Kingroon/Kingroon_buildplate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/profiles/Kingroon/klp1_bed.stl b/resources/profiles/Kingroon/klp1_bed.stl new file mode 100644 index 0000000000..c553d90697 Binary files /dev/null and b/resources/profiles/Kingroon/klp1_bed.stl differ diff --git a/resources/profiles/Kingroon/machine/Kingroon KLP1.json b/resources/profiles/Kingroon/machine/Kingroon KLP1.json index b8b51cfe6f..be41766295 100644 --- a/resources/profiles/Kingroon/machine/Kingroon KLP1.json +++ b/resources/profiles/Kingroon/machine/Kingroon KLP1.json @@ -5,6 +5,8 @@ "nozzle_diameter": "0.4", "machine_tech": "FFF", "family": "Kingroon", + "bed_model": "klp1_bed.stl", + "bed_texture": "Kingroon_buildplate.svg", "hotend_model": "", "default_materials": "Generic ABS @System;Generic PLA @System;Generic PLA-CF @System;Generic PETG @System;Generic TPU @System;Generic ASA @System;Generic PC @System;Generic PVA @System;Generic PA @System;Generic PA-CF @System" } diff --git a/resources/profiles/Kingroon/machine/Kingroon KP3S 3.0.json b/resources/profiles/Kingroon/machine/Kingroon KP3S 3.0.json index 763fd761a4..8706fff466 100644 --- a/resources/profiles/Kingroon/machine/Kingroon KP3S 3.0.json +++ b/resources/profiles/Kingroon/machine/Kingroon KP3S 3.0.json @@ -5,8 +5,8 @@ "nozzle_diameter": "0.4", "machine_tech": "FFF", "family": "Kingroon", - "bed_model": "kp3s_bed.stl", - "bed_texture": "Kingroon_buildplate.png", + "bed_model": "mini_bed.stl", + "bed_texture": "Kingroon_buildplate.svg", "hotend_model": "", "default_materials": "Generic ABS @System;Generic PLA @System;Generic PLA-CF @System;Generic PETG @System;Generic TPU @System;Generic ASA @System;Generic PC @System;Generic PVA @System;Generic PA @System;Generic PA-CF @System" } diff --git a/resources/profiles/Kingroon/machine/Kingroon KP3S PRO S1.json b/resources/profiles/Kingroon/machine/Kingroon KP3S PRO S1.json index d5366ed70f..63dbec0589 100644 --- a/resources/profiles/Kingroon/machine/Kingroon KP3S PRO S1.json +++ b/resources/profiles/Kingroon/machine/Kingroon KP3S PRO S1.json @@ -6,7 +6,7 @@ "machine_tech": "FFF", "family": "Kingroon", "bed_model": "kp3s_bed.stl", - "bed_texture": "Kingroon_buildplate.png", + "bed_texture": "Kingroon_buildplate.svg", "hotend_model": "", "default_materials": "Generic ABS @System;Generic PLA @System;Generic PLA-CF @System;Generic PETG @System;Generic TPU @System;Generic ASA @System;Generic PC @System;Generic PVA @System;Generic PA @System;Generic PA-CF @System" } diff --git a/resources/profiles/Kingroon/machine/Kingroon KP3S PRO V2.json b/resources/profiles/Kingroon/machine/Kingroon KP3S PRO V2.json index a3f59b9d02..1d7b0b0f17 100644 --- a/resources/profiles/Kingroon/machine/Kingroon KP3S PRO V2.json +++ b/resources/profiles/Kingroon/machine/Kingroon KP3S PRO V2.json @@ -6,7 +6,7 @@ "machine_tech": "FFF", "family": "Kingroon", "bed_model": "kp3s_bed.stl", - "bed_texture": "Kingroon_buildplate.png", + "bed_texture": "Kingroon_buildplate.svg", "hotend_model": "", "default_materials": "Generic ABS @System;Generic PLA @System;Generic PLA-CF @System;Generic PETG @System;Generic TPU @System;Generic ASA @System;Generic PC @System;Generic PVA @System;Generic PA @System;Generic PA-CF @System" } diff --git a/resources/profiles/Kingroon/machine/Kingroon KP3S V1.json b/resources/profiles/Kingroon/machine/Kingroon KP3S V1.json index aa11392031..e795a820c9 100644 --- a/resources/profiles/Kingroon/machine/Kingroon KP3S V1.json +++ b/resources/profiles/Kingroon/machine/Kingroon KP3S V1.json @@ -5,6 +5,8 @@ "nozzle_diameter": "0.4", "machine_tech": "FFF", "family": "Kingroon", + "bed_model": "mini_bed.stl", + "bed_texture": "Kingroon_buildplate.svg", "hotend_model": "", "default_materials": "Generic ABS @System;Generic PLA @System;Generic PLA-CF @System;Generic PETG @System;Generic TPU @System;Generic ASA @System;Generic PC @System;Generic PVA @System;Generic PA @System;Generic PA-CF @System" } diff --git a/resources/profiles/Kingroon/mini_bed.stl b/resources/profiles/Kingroon/mini_bed.stl index c29567879c..90ee295cac 100644 Binary files a/resources/profiles/Kingroon/mini_bed.stl and b/resources/profiles/Kingroon/mini_bed.stl differ diff --git a/resources/profiles/M3D/M3D Enabler D7500_cover.png b/resources/profiles/M3D/M3D Enabler D7500_cover.png index a5685815e3..a41a57b84c 100644 Binary files a/resources/profiles/M3D/M3D Enabler D7500_cover.png and b/resources/profiles/M3D/M3D Enabler D7500_cover.png differ diff --git a/resources/profiles/M3D/M3D Enabler D8500_cover.png b/resources/profiles/M3D/M3D Enabler D8500_cover.png index 61591134e6..fdf52a3fe2 100644 Binary files a/resources/profiles/M3D/M3D Enabler D8500_cover.png and b/resources/profiles/M3D/M3D Enabler D8500_cover.png differ diff --git a/resources/profiles/M3D/m3d_enabler_D7500_bed_texture.svg b/resources/profiles/M3D/m3d_enabler_D7500_bed_texture.svg new file mode 100644 index 0000000000..09ad5969a0 --- /dev/null +++ b/resources/profiles/M3D/m3d_enabler_D7500_bed_texture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/profiles/M3D/m3d_enabler_D8500_bed_model.stl b/resources/profiles/M3D/m3d_enabler_D8500_bed_model.stl new file mode 100644 index 0000000000..61bc03695b Binary files /dev/null and b/resources/profiles/M3D/m3d_enabler_D8500_bed_model.stl differ diff --git a/resources/profiles/M3D/m3d_enabler_D8500_bed_texture.svg b/resources/profiles/M3D/m3d_enabler_D8500_bed_texture.svg new file mode 100644 index 0000000000..99a19091ca --- /dev/null +++ b/resources/profiles/M3D/m3d_enabler_D8500_bed_texture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/profiles/M3D/machine/M3D Enabler D7500.json b/resources/profiles/M3D/machine/M3D Enabler D7500.json index 2657b13506..fe49dc1e6c 100644 --- a/resources/profiles/M3D/machine/M3D Enabler D7500.json +++ b/resources/profiles/M3D/machine/M3D Enabler D7500.json @@ -5,6 +5,6 @@ "family": "M3D", "machine_tech": "FFF", "nozzle_diameter": "0.4", - "bed_texture": "model/M3D_bed_texture.png", + "bed_texture": "m3d_enabler_D7500_bed_texture.svg", "default_materials": "Generic PLA @System" } diff --git a/resources/profiles/M3D/machine/M3D Enabler D8500.json b/resources/profiles/M3D/machine/M3D Enabler D8500.json index 979d62b62d..fa2db56dd2 100644 --- a/resources/profiles/M3D/machine/M3D Enabler D8500.json +++ b/resources/profiles/M3D/machine/M3D Enabler D8500.json @@ -5,7 +5,7 @@ "family": "M3D", "machine_tech": "FFF", "nozzle_diameter": "0.4", - "bed_model": "model/M3D_bed_model.stl", - "bed_texture": "model/M3D_bed_texture.png", + "bed_model": "m3d_enabler_D8500_bed_model.stl", + "bed_texture": "m3d_enabler_D8500_bed_texture.svg", "default_materials": "Generic PLA @System" } diff --git a/resources/profiles/M3D/model/M3D_bed_model.stl b/resources/profiles/M3D/model/M3D_bed_model.stl deleted file mode 100644 index 8ed24335dd..0000000000 Binary files a/resources/profiles/M3D/model/M3D_bed_model.stl and /dev/null differ diff --git a/resources/profiles/M3D/model/M3D_bed_texture.png b/resources/profiles/M3D/model/M3D_bed_texture.png deleted file mode 100644 index bd0e6b8b80..0000000000 Binary files a/resources/profiles/M3D/model/M3D_bed_texture.png and /dev/null differ diff --git a/resources/profiles/Meltingplot/Meltingplot CHX 350_cover.png b/resources/profiles/Meltingplot/Meltingplot CHX 350_cover.png index 2f625aedc4..af4de984ba 100644 Binary files a/resources/profiles/Meltingplot/Meltingplot CHX 350_cover.png and b/resources/profiles/Meltingplot/Meltingplot CHX 350_cover.png differ diff --git a/resources/profiles/Meltingplot/Meltingplot MBL 133_cover.png b/resources/profiles/Meltingplot/Meltingplot MBL 133_cover.png index eb9865c0cb..e8c9d6fdbc 100644 Binary files a/resources/profiles/Meltingplot/Meltingplot MBL 133_cover.png and b/resources/profiles/Meltingplot/Meltingplot MBL 133_cover.png differ diff --git a/resources/profiles/Meltingplot/Meltingplot MBL 136_cover.png b/resources/profiles/Meltingplot/Meltingplot MBL 136_cover.png index 746dfb1fbb..e8c9d6fdbc 100644 Binary files a/resources/profiles/Meltingplot/Meltingplot MBL 136_cover.png and b/resources/profiles/Meltingplot/Meltingplot MBL 136_cover.png differ diff --git a/resources/profiles/Meltingplot/Meltingplot MBL 308_cover.png b/resources/profiles/Meltingplot/Meltingplot MBL 308_cover.png index cb4df7250e..4f838ed42d 100644 Binary files a/resources/profiles/Meltingplot/Meltingplot MBL 308_cover.png and b/resources/profiles/Meltingplot/Meltingplot MBL 308_cover.png differ diff --git a/resources/profiles/Meltingplot/Meltingplot MBL 480_cover.png b/resources/profiles/Meltingplot/Meltingplot MBL 480_cover.png index fb7e11d5b2..f5be83f2a6 100644 Binary files a/resources/profiles/Meltingplot/Meltingplot MBL 480_cover.png and b/resources/profiles/Meltingplot/Meltingplot MBL 480_cover.png differ diff --git a/resources/profiles/Meltingplot/chx350-printbed.stl b/resources/profiles/Meltingplot/chx350-printbed.stl index 34255a2d73..51b2a57483 100644 Binary files a/resources/profiles/Meltingplot/chx350-printbed.stl and b/resources/profiles/Meltingplot/chx350-printbed.stl differ diff --git a/resources/profiles/Meltingplot/chx350-texture.svg b/resources/profiles/Meltingplot/chx350-texture.svg index 130afe556e..9e882ebb7f 100644 --- a/resources/profiles/Meltingplot/chx350-texture.svg +++ b/resources/profiles/Meltingplot/chx350-texture.svg @@ -1,5 +1 @@ - - -Meltingplot CHX350 build plate — 1C Navy HUD (outlined) - - \ No newline at end of file + \ No newline at end of file diff --git a/resources/profiles/Meltingplot/mbl-133-texture.svg b/resources/profiles/Meltingplot/mbl-133-texture.svg index d7572a5a2e..a13b7402a0 100644 --- a/resources/profiles/Meltingplot/mbl-133-texture.svg +++ b/resources/profiles/Meltingplot/mbl-133-texture.svg @@ -1,158 +1 @@ - - - - - - image/svg+xml - - MBL133 - - - - - - MBL133 - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/resources/profiles/Meltingplot/mbl-136-texture.svg b/resources/profiles/Meltingplot/mbl-136-texture.svg index 415bd0fdc0..f77c1cb5d8 100644 --- a/resources/profiles/Meltingplot/mbl-136-texture.svg +++ b/resources/profiles/Meltingplot/mbl-136-texture.svg @@ -1,158 +1 @@ - - - - - - image/svg+xml - - MBL133 - - - - - - MBL133 - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/resources/profiles/Meltingplot/mbl-308-texture.svg b/resources/profiles/Meltingplot/mbl-308-texture.svg index 96ee77c84d..850f05f0ef 100644 --- a/resources/profiles/Meltingplot/mbl-308-texture.svg +++ b/resources/profiles/Meltingplot/mbl-308-texture.svg @@ -1,158 +1 @@ - - - - - - image/svg+xml - - MBL133 - - - - - - MBL133 - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/resources/profiles/Meltingplot/mbl-480-texture.svg b/resources/profiles/Meltingplot/mbl-480-texture.svg index e76d969d72..9c7b050073 100644 --- a/resources/profiles/Meltingplot/mbl-480-texture.svg +++ b/resources/profiles/Meltingplot/mbl-480-texture.svg @@ -1,158 +1 @@ - - - - - - image/svg+xml - - MBL133 - - - - - - MBL133 - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/resources/profiles/Meltingplot/mbl133-printbed.stl b/resources/profiles/Meltingplot/mbl133-printbed.stl index 888491edea..d26dffb0f4 100644 Binary files a/resources/profiles/Meltingplot/mbl133-printbed.stl and b/resources/profiles/Meltingplot/mbl133-printbed.stl differ diff --git a/resources/profiles/Meltingplot/mbl136-printbed.stl b/resources/profiles/Meltingplot/mbl136-printbed.stl index ab25288591..82babce641 100644 Binary files a/resources/profiles/Meltingplot/mbl136-printbed.stl and b/resources/profiles/Meltingplot/mbl136-printbed.stl differ diff --git a/resources/profiles/Meltingplot/mbl308-printbed.stl b/resources/profiles/Meltingplot/mbl308-printbed.stl index ab25288591..82babce641 100644 Binary files a/resources/profiles/Meltingplot/mbl308-printbed.stl and b/resources/profiles/Meltingplot/mbl308-printbed.stl differ diff --git a/resources/profiles/Meltingplot/mbl480-printbed.stl b/resources/profiles/Meltingplot/mbl480-printbed.stl index ab25288591..82babce641 100644 Binary files a/resources/profiles/Meltingplot/mbl480-printbed.stl and b/resources/profiles/Meltingplot/mbl480-printbed.stl differ diff --git a/resources/profiles/OrcaArena.json b/resources/profiles/OrcaArena.json index 582bd47577..9bb97fb232 100644 --- a/resources/profiles/OrcaArena.json +++ b/resources/profiles/OrcaArena.json @@ -1,7 +1,7 @@ { "name": "Orca Arena Printer", "url": "", - "version": "02.04.00.08", + "version": "02.04.00.07", "force_update": "0", "description": "Orca Arena configuration files", "machine_model_list": [ diff --git a/resources/profiles/OrcaFilamentLibrary.json b/resources/profiles/OrcaFilamentLibrary.json index 99a78476cb..084a12993f 100644 --- a/resources/profiles/OrcaFilamentLibrary.json +++ b/resources/profiles/OrcaFilamentLibrary.json @@ -1,6 +1,6 @@ { "name": "OrcaFilamentLibrary", - "version": "02.04.00.19", + "version": "02.04.00.15", "force_update": "0", "description": "Orca Filament Library", "filament_list": [ diff --git a/resources/profiles/OrcaFilamentLibrary/filament/Elegoo/Elegoo PLA @base.json b/resources/profiles/OrcaFilamentLibrary/filament/Elegoo/Elegoo PLA @base.json index 3ba4c8c14f..45456ab6d8 100644 --- a/resources/profiles/OrcaFilamentLibrary/filament/Elegoo/Elegoo PLA @base.json +++ b/resources/profiles/OrcaFilamentLibrary/filament/Elegoo/Elegoo PLA @base.json @@ -39,7 +39,7 @@ "60" ], "filament_start_gcode": [ - "; Elegoo PLA filament start gcode\n" + "; filament start gcode\n" ], "filament_end_gcode": [ "; filament end gcode \n" diff --git a/resources/profiles/Pragostroj/KINARB 1HB_cover.png b/resources/profiles/Pragostroj/KINARB 1HB_cover.png index 4ef3cf5e43..e4087e9f00 100644 Binary files a/resources/profiles/Pragostroj/KINARB 1HB_cover.png and b/resources/profiles/Pragostroj/KINARB 1HB_cover.png differ diff --git a/resources/profiles/Pragostroj/KINARB 2HB_cover.png b/resources/profiles/Pragostroj/KINARB 2HB_cover.png index 4ef3cf5e43..e4087e9f00 100644 Binary files a/resources/profiles/Pragostroj/KINARB 2HB_cover.png and b/resources/profiles/Pragostroj/KINARB 2HB_cover.png differ diff --git a/resources/profiles/Pragostroj/Pragostroj_cover.png b/resources/profiles/Pragostroj/Pragostroj_cover.png deleted file mode 100644 index 4ef3cf5e43..0000000000 Binary files a/resources/profiles/Pragostroj/Pragostroj_cover.png and /dev/null differ diff --git a/resources/profiles/Prusa/Prusa CORE One INDX 4T_cover.png b/resources/profiles/Prusa/Prusa CORE One INDX 4T_cover.png index fc4a7b6539..d404d2d300 100644 Binary files a/resources/profiles/Prusa/Prusa CORE One INDX 4T_cover.png and b/resources/profiles/Prusa/Prusa CORE One INDX 4T_cover.png differ diff --git a/resources/profiles/Prusa/Prusa CORE One INDX 8T_cover.png b/resources/profiles/Prusa/Prusa CORE One INDX 8T_cover.png index 28b8a311fe..fd6cb8c27e 100644 Binary files a/resources/profiles/Prusa/Prusa CORE One INDX 8T_cover.png and b/resources/profiles/Prusa/Prusa CORE One INDX 8T_cover.png differ diff --git a/resources/profiles/Prusa/Prusa CORE One MMU3_cover.png b/resources/profiles/Prusa/Prusa CORE One MMU3_cover.png index be841d654b..380c435088 100644 Binary files a/resources/profiles/Prusa/Prusa CORE One MMU3_cover.png and b/resources/profiles/Prusa/Prusa CORE One MMU3_cover.png differ diff --git a/resources/profiles/Prusa/Prusa MK4 MMU3 HF_cover.png b/resources/profiles/Prusa/Prusa MK4 MMU3 HF_cover.png index c39bfa5dab..76da9d9dc8 100644 Binary files a/resources/profiles/Prusa/Prusa MK4 MMU3 HF_cover.png and b/resources/profiles/Prusa/Prusa MK4 MMU3 HF_cover.png differ diff --git a/resources/profiles/Prusa/Prusa MK4 MMU3_cover.png b/resources/profiles/Prusa/Prusa MK4 MMU3_cover.png index c39bfa5dab..83306e8161 100644 Binary files a/resources/profiles/Prusa/Prusa MK4 MMU3_cover.png and b/resources/profiles/Prusa/Prusa MK4 MMU3_cover.png differ diff --git a/resources/profiles/Prusa/coreone_indx.stl b/resources/profiles/Prusa/coreone_indx.stl index b6e0154953..6cf873594a 100644 Binary files a/resources/profiles/Prusa/coreone_indx.stl and b/resources/profiles/Prusa/coreone_indx.stl differ diff --git a/resources/profiles/Prusa/coreone_indx.svg b/resources/profiles/Prusa/coreone_indx.svg index 8b6efba2e2..70d59451a5 100644 --- a/resources/profiles/Prusa/coreone_indx.svg +++ b/resources/profiles/Prusa/coreone_indx.svg @@ -1,507 +1 @@ - - + \ No newline at end of file diff --git a/resources/profiles/RH3D/E3NG v1.2S_cover.png b/resources/profiles/RH3D/E3NG v1.2S_cover.png index f70e2ed35f..6880cdf5b2 100644 Binary files a/resources/profiles/RH3D/E3NG v1.2S_cover.png and b/resources/profiles/RH3D/E3NG v1.2S_cover.png differ diff --git a/resources/profiles/RH3D/E3NG-bed-texture.svg b/resources/profiles/RH3D/E3NG-bed-texture.svg index 93e944d534..5bc3296d25 100644 --- a/resources/profiles/RH3D/E3NG-bed-texture.svg +++ b/resources/profiles/RH3D/E3NG-bed-texture.svg @@ -1,443 +1 @@ - - + \ No newline at end of file diff --git a/resources/profiles/RH3D/VIRTU E3_cover.png b/resources/profiles/RH3D/VIRTU E3_cover.png index 085b853cc0..31bede83d9 100644 Binary files a/resources/profiles/RH3D/VIRTU E3_cover.png and b/resources/profiles/RH3D/VIRTU E3_cover.png differ diff --git a/resources/profiles/RH3D/VIRTU-bed-texture.svg b/resources/profiles/RH3D/VIRTU-bed-texture.svg index 802310f8d5..78a7e2263b 100644 --- a/resources/profiles/RH3D/VIRTU-bed-texture.svg +++ b/resources/profiles/RH3D/VIRTU-bed-texture.svg @@ -1,460 +1 @@ - - + \ No newline at end of file diff --git a/resources/profiles/RH3D/VIRTU-bed.stl b/resources/profiles/RH3D/VIRTU-bed.stl index c26e99e419..306a547b00 100644 Binary files a/resources/profiles/RH3D/VIRTU-bed.stl and b/resources/profiles/RH3D/VIRTU-bed.stl differ diff --git a/resources/profiles/UltiMaker.json b/resources/profiles/UltiMaker.json index 14bce7c6da..df8280058d 100644 --- a/resources/profiles/UltiMaker.json +++ b/resources/profiles/UltiMaker.json @@ -1,7 +1,7 @@ { "name": "UltiMaker", "url": "", - "version": "02.04.00.05", + "version": "02.04.00.06", "force_update": "0", "description": "UltiMaker configurations", "machine_model_list": [ diff --git a/resources/profiles/UltiMaker/UltiMaker 2 extended+_cover.png b/resources/profiles/UltiMaker/UltiMaker 2 extended+_cover.png index b414d18fc6..b0f3dc7832 100644 Binary files a/resources/profiles/UltiMaker/UltiMaker 2 extended+_cover.png and b/resources/profiles/UltiMaker/UltiMaker 2 extended+_cover.png differ diff --git a/resources/profiles/UltiMaker/UltiMaker 2+_cover.png b/resources/profiles/UltiMaker/UltiMaker 2+_cover.png index 3007c8b28e..e10f00740c 100644 Binary files a/resources/profiles/UltiMaker/UltiMaker 2+_cover.png and b/resources/profiles/UltiMaker/UltiMaker 2+_cover.png differ diff --git a/resources/profiles/UltiMaker/UltiMaker 2_cover.png b/resources/profiles/UltiMaker/UltiMaker 2_cover.png index a5e4867482..f129e2952c 100644 Binary files a/resources/profiles/UltiMaker/UltiMaker 2_cover.png and b/resources/profiles/UltiMaker/UltiMaker 2_cover.png differ diff --git a/resources/profiles/UltiMaker/UltiMaker S5_cover.png b/resources/profiles/UltiMaker/UltiMaker S5_cover.png index f123d6c81c..4ee21462ca 100644 Binary files a/resources/profiles/UltiMaker/UltiMaker S5_cover.png and b/resources/profiles/UltiMaker/UltiMaker S5_cover.png differ diff --git a/resources/profiles/UltiMaker/machine/UltiMaker 2 extended+.json b/resources/profiles/UltiMaker/machine/UltiMaker 2 extended+.json index 43f2c765ea..85e49f27fc 100644 --- a/resources/profiles/UltiMaker/machine/UltiMaker 2 extended+.json +++ b/resources/profiles/UltiMaker/machine/UltiMaker 2 extended+.json @@ -6,7 +6,7 @@ "machine_tech": "FFF", "family": "UltiMaker", "bed_model": "ultimaker_2_buildplate_model.stl", - "bed_texture": "ultimaker_2_buildplate_texture.png", + "bed_texture": "ultimaker_2_buildplate_texture.svg", "hotend_model": "ultimaker_hotend.stl", "default_materials": "Generic ABS @UltiMaker 2 extended+ 0.4 nozzle;Generic PETG @UltiMaker 2 extended+ 0.4 nozzle;Generic PLA @UltiMaker 2 extended+ 0.4 nozzle;Generic ABS @UltiMaker 2 extended+ 0.6 nozzle;Generic PETG @UltiMaker 2 extended+ 0.6 nozzle;Generic PLA @UltiMaker 2 extended+ 0.6 nozzle;Generic ABS @UltiMaker 2 extended+ 0.8 nozzle;Generic PETG @UltiMaker 2 extended+ 0.8 nozzle;Generic PLA @UltiMaker 2 extended+ 0.8 nozzle" } diff --git a/resources/profiles/UltiMaker/machine/UltiMaker 2+.json b/resources/profiles/UltiMaker/machine/UltiMaker 2+.json index f116cdfc4e..d108ed3b23 100644 --- a/resources/profiles/UltiMaker/machine/UltiMaker 2+.json +++ b/resources/profiles/UltiMaker/machine/UltiMaker 2+.json @@ -6,7 +6,7 @@ "machine_tech": "FFF", "family": "UltiMaker", "bed_model": "ultimaker_2_buildplate_model.stl", - "bed_texture": "ultimaker_2_buildplate_texture.png", + "bed_texture": "ultimaker_2_buildplate_texture.svg", "hotend_model": "ultimaker_hotend.stl", "default_materials": "Generic ABS @UltiMaker 2+ 0.4 nozzle;Generic PETG @UltiMaker 2+ 0.4 nozzle;Generic PLA @UltiMaker 2+ 0.4 nozzle;Generic ABS @UltiMaker 2+ 0.6 nozzle;Generic PETG @UltiMaker 2+ 0.6 nozzle;Generic PLA @UltiMaker 2+ 0.6 nozzle;Generic ABS @UltiMaker 2+ 0.8 nozzle;Generic PETG @UltiMaker 2+ 0.8 nozzle;Generic PLA @UltiMaker 2+ 0.8 nozzle" } diff --git a/resources/profiles/UltiMaker/machine/UltiMaker 2.json b/resources/profiles/UltiMaker/machine/UltiMaker 2.json index aa01814874..e18ea3841c 100644 --- a/resources/profiles/UltiMaker/machine/UltiMaker 2.json +++ b/resources/profiles/UltiMaker/machine/UltiMaker 2.json @@ -6,7 +6,7 @@ "machine_tech": "FFF", "family": "UltiMaker", "bed_model": "ultimaker_2_buildplate_model.stl", - "bed_texture": "ultimaker_2_buildplate_texture.png", + "bed_texture": "ultimaker_2_buildplate_texture.svg", "hotend_model": "ultimaker_hotend.stl", "default_materials": "Generic ABS @UltiMaker 2 0.4 nozzle;Generic PETG @UltiMaker 2 0.4 nozzle;Generic PLA @UltiMaker 2 0.4 nozzle;Generic ABS @UltiMaker 2 0.6 nozzle;Generic PETG @UltiMaker 2 0.6 nozzle;Generic PLA @UltiMaker 2 0.6 nozzle;Generic ABS @UltiMaker 2 0.8 nozzle;Generic PETG @UltiMaker 2 0.8 nozzle;Generic PLA @UltiMaker 2 0.8 nozzle" } diff --git a/resources/profiles/UltiMaker/machine/UltiMaker S5.json b/resources/profiles/UltiMaker/machine/UltiMaker S5.json index 2a9b858938..e601588426 100644 --- a/resources/profiles/UltiMaker/machine/UltiMaker S5.json +++ b/resources/profiles/UltiMaker/machine/UltiMaker S5.json @@ -6,7 +6,7 @@ "machine_tech": "FFF", "family": "UltiMaker", "bed_model": "ultimaker_s5_buildplate_model.stl", - "bed_texture": "ultimaker_2_buildplate_texture.png", + "bed_texture": "ultimaker_s5_buildplate_texture.svg", "hotend_model": "ultimaker_hotend.stl", "default_materials": "Generic ABS @System;Generic PETG @System;Generic PLA @System" } diff --git a/resources/profiles/UltiMaker/ultimaker_2_buildplate_texture.png b/resources/profiles/UltiMaker/ultimaker_2_buildplate_texture.png deleted file mode 100644 index 83af61f3f9..0000000000 Binary files a/resources/profiles/UltiMaker/ultimaker_2_buildplate_texture.png and /dev/null differ diff --git a/resources/profiles/UltiMaker/ultimaker_2_buildplate_texture.svg b/resources/profiles/UltiMaker/ultimaker_2_buildplate_texture.svg new file mode 100644 index 0000000000..20b1f46d56 --- /dev/null +++ b/resources/profiles/UltiMaker/ultimaker_2_buildplate_texture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/profiles/UltiMaker/ultimaker_s5_buildplate_model.stl b/resources/profiles/UltiMaker/ultimaker_s5_buildplate_model.stl index 4105f1fe3a..0a35978771 100644 Binary files a/resources/profiles/UltiMaker/ultimaker_s5_buildplate_model.stl and b/resources/profiles/UltiMaker/ultimaker_s5_buildplate_model.stl differ diff --git a/resources/profiles/UltiMaker/ultimaker_s5_buildplate_texture.svg b/resources/profiles/UltiMaker/ultimaker_s5_buildplate_texture.svg new file mode 100644 index 0000000000..d4e82c8956 --- /dev/null +++ b/resources/profiles/UltiMaker/ultimaker_s5_buildplate_texture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/profiles/WonderMaker/WonderMaker ZR Ultra S_cover.png b/resources/profiles/WonderMaker/WonderMaker ZR Ultra S_cover.png index 11a2260f93..56fd74d658 100644 Binary files a/resources/profiles/WonderMaker/WonderMaker ZR Ultra S_cover.png and b/resources/profiles/WonderMaker/WonderMaker ZR Ultra S_cover.png differ diff --git a/resources/profiles/WonderMaker/WonderMaker ZR Ultra_cover.png b/resources/profiles/WonderMaker/WonderMaker ZR Ultra_cover.png index 5a77f326f0..dd90203123 100644 Binary files a/resources/profiles/WonderMaker/WonderMaker ZR Ultra_cover.png and b/resources/profiles/WonderMaker/WonderMaker ZR Ultra_cover.png differ diff --git a/resources/profiles/WonderMaker/WonderMaker ZR_cover.png b/resources/profiles/WonderMaker/WonderMaker ZR_cover.png index 9740044c1c..a9936565a5 100644 Binary files a/resources/profiles/WonderMaker/WonderMaker ZR_cover.png and b/resources/profiles/WonderMaker/WonderMaker ZR_cover.png differ diff --git a/scripts/CAD/run-kernel-tests.sh b/scripts/CAD/run-kernel-tests.sh index cc52a2a00b..ac506a7056 100755 --- a/scripts/CAD/run-kernel-tests.sh +++ b/scripts/CAD/run-kernel-tests.sh @@ -24,7 +24,7 @@ set -euo pipefail REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" # orcacad-deps, NOT snapmaker-deps: this fork is mainline-based and needs Eigen 5.0.1, -# CGAL 5.6.3, wx 3.3.2 and Python 3.12 Development.Embed, none of which snapmaker-deps has. +# CGAL 6.2.1, wx 3.3.2 and Python 3.12 Development.Embed, none of which snapmaker-deps has. # With the wrong image CMake dies at configure, which is exactly why this fork went # M1-M8 without ever compiling (see commit 1633005bba). IMAGE="${IMAGE:-orcacad-deps}" diff --git a/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml index 21587a361f..e099ce909c 100644 --- a/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml +++ b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml @@ -259,10 +259,10 @@ modules: sha256: 9ad62c7dc910303cd384ff8f1f4767a655124980bb6d8650fe62c815a231bb7b dest: external-packages/MPFR - # CGAL 5.6.3 + # CGAL 6.2.1 - type: file - url: https://github.com/CGAL/cgal/releases/download/v5.6.3/CGAL-5.6.3.zip - sha256: 5d577acb4a9918ccb960491482da7a3838f8d363aff47e14d703f19fd84733d4 + url: https://github.com/CGAL/cgal/releases/download/v6.2.1/CGAL-6.2.1.zip + sha256: eebd737d9b7f0199647ba5c1f9f6c7a3d0651aacef9c2fd4dedc52da6c25edbe dest: external-packages/CGAL # NLopt v2.5.0 diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index 854a05bbd9..ab44fc4d3c 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -4123,6 +4123,8 @@ int CLI::run(int argc, char **argv) flush_and_exit(CLI_MIXED_FILAMENT_INVALID); } } + if (filament_count > 0) + resize_mixed_filament_metadata(m_print_config, size_t(filament_count), size_t(filament_count)); m_print_config.option>("printer_technology", true)->value = printer_technology; diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp index cec5a3a74e..cb143da9a6 100644 --- a/src/libslic3r/CAD/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -84,7 +84,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index a108588f84..c909d7e96a 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -278,8 +278,6 @@ set(lisbslic3r_sources GCode/PreciseSeam.cpp GCode/PreciseSeam.hpp GCode/PreciseSeamInternal.hpp - #GCodeSender.cpp - #GCodeSender.hpp GCode/SmallAreaInfillFlowCompensator.cpp GCode/SmallAreaInfillFlowCompensator.hpp GCode/SpiralVase.cpp @@ -464,7 +462,6 @@ set(lisbslic3r_sources SLA/SupportTreeBuildsteps.hpp SLA/SupportTree.cpp SLA/SupportTree.hpp - #SLA/SupportTreeIGL.cpp SLA/SupportTreeMesher.cpp SLA/SupportTreeMesher.hpp SlicesToTriangleMesh.cpp @@ -604,10 +601,10 @@ set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE ON CACHE BOOL "" FORCE) cmake_policy(PUSH) cmake_policy(SET CMP0011 NEW) -# CGAL's config resets policies (cmake_minimum_required ...3.23), so a plain SET +# CGAL's config resets policies (cmake_minimum_required ...3.31), so a plain SET # can't reach it; the default opts its Boost lookup into BoostConfig (CMP0167). set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) -find_package(CGAL REQUIRED) +find_package(CGAL 6.2 REQUIRED) find_package(OpenCV REQUIRED core) find_package(assimp REQUIRED) unset(CMAKE_POLICY_DEFAULT_CMP0167) diff --git a/src/libslic3r/CutSurface.cpp b/src/libslic3r/CutSurface.cpp index cf5bd119f4..abda122a71 100644 --- a/src/libslic3r/CutSurface.cpp +++ b/src/libslic3r/CutSurface.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -1443,8 +1443,8 @@ priv::CutAOIs priv::cut_from_model(CutMesh &cgal_model, // detect anomalities in visitor. bool is_valid = true; // NOTE: map are created when convert shapes to cgal model - const EdgeShapeMap& edge_shape_map = cgal_shape.property_map(edge_shape_map_name).first; - const FaceShapeMap& face_shape_map = cgal_shape.property_map(face_shape_map_name).first; + const EdgeShapeMap edge_shape_map = cgal_shape.property_map(edge_shape_map_name).value(); + const FaceShapeMap face_shape_map = cgal_shape.property_map(face_shape_map_name).value(); Visitor visitor{cgal_model, cgal_shape, edge_shape_map, face_shape_map, vert_shape_map, &is_valid}; // a property map containing the constrained-or-not status of each edge @@ -1593,8 +1593,8 @@ void priv::collect_surface_data(std::queue &process, void priv::create_reduce_map(ReductionMap &reduction_map, const CutMesh &mesh) { - const VertexShapeMap &vert_shape_map = mesh.property_map(vert_shape_map_name).first; - const EdgeBoolMap &ecm = mesh.property_map(is_constrained_edge_name).first; + const VertexShapeMap vert_shape_map = mesh.property_map(vert_shape_map_name).value(); + const EdgeBoolMap ecm = mesh.property_map(is_constrained_edge_name).value(); // check if vertex was made by edge_2 which is diagonal of quad auto is_reducible_vertex = [&vert_shape_map](VI reduction_from) -> bool { @@ -1778,11 +1778,11 @@ priv::VDistances priv::calc_distances(const SurfacePatches &patches, priv::VDistances result(count_shapes_points); for (const SurfacePatch &patch : patches) { // map is created during intersection by corefine visitor - const VertexShapeMap &vert_shape_map = - models[patch.model_id].property_map(vert_shape_map_name).first; + const VertexShapeMap vert_shape_map = + models[patch.model_id].property_map(vert_shape_map_name).value(); uint32_t patch_index = &patch - &patches.front(); // map is created during patch creation / dividing - const CvtVI2VI& cvt = patch.mesh.property_map(patch_source_name).first; + const CvtVI2VI cvt = patch.mesh.property_map(patch_source_name).value(); // for each point on outline for (const Loop &loop : patch.loops) for (const VI &vi_patch : loop) { @@ -2589,7 +2589,6 @@ void priv::create_face_types(FaceTypeMap &map, } #include -#include bool priv::clip_cut(SurfacePatch &cut, CutMesh clipper) { CutMesh& tm = cut.mesh; @@ -2804,7 +2803,7 @@ using BBS = std::vector; BBS create_bbs(const VCutAOIs &cuts, const CutMeshes &cut_models); using Primitive = CGAL::AABB_face_graph_triangle_primitive; -using Traits = CGAL::AABB_traits; +using Traits = CGAL::AABB_traits_3; using Ray = EpicKernel::Ray_3; using Tree = CGAL::AABB_tree; using Trees = std::vector; @@ -2957,7 +2956,7 @@ bool priv::is_patch_inside_of_model(const SurfacePatch &patch, uint32_t priv::get_shape_point_index(const CutAOI &cut, const CutMesh &model) { // map is created during intersection by corefine visitor - const VertexShapeMap &vert_shape_map = model.property_map(vert_shape_map_name).first; + const VertexShapeMap vert_shape_map = model.property_map(vert_shape_map_name).value(); // for each half edge of outline for (HI hi : cut.second) { VI vi = model.source(hi); @@ -2982,7 +2981,7 @@ priv::SurfacePatch priv::separate_patch(const std::vector& fis, patch_new.model_id = patch.model_id; patch_new.shape_id = patch.shape_id; // fix cvt - CvtVI2VI cvt = patch_new.mesh.property_map(patch_source_name).first; + CvtVI2VI cvt = patch_new.mesh.property_map(patch_source_name).value(); for (VI &vi : cvt) { if (!vi.is_valid()) continue; vi = cvt_from[vi]; @@ -3002,7 +3001,7 @@ void priv::divide_patch(size_t i, SurfacePatchesEx &patches) std::string patch_number_name = "f:patch_number"; CutMesh::Property_map is_processed = cm.add_property_map(patch_number_name, false).first; - const CvtVI2VI& cvt_from = patch.mesh.property_map(patch_source_name).first; + const CvtVI2VI cvt_from = patch.mesh.property_map(patch_source_name).value(); std::vector fis; fis.reserve(cm.faces().size()); @@ -3189,7 +3188,7 @@ bool priv::is_over_whole_expoly(const CutAOI &cutAOI, const CutMesh &mesh) { // NonInterupted contour is without other point and contain all from shape - const VertexShapeMap &vert_shape_map = mesh.property_map(vert_shape_map_name).first; + const VertexShapeMap vert_shape_map = mesh.property_map(vert_shape_map_name).value(); for (HI hi : cutAOI.second) { const IntersectingElement *ie_s = vert_shape_map[mesh.source(hi)]; const IntersectingElement *ie_t = vert_shape_map[mesh.target(hi)]; diff --git a/src/libslic3r/Emboss.cpp b/src/libslic3r/Emboss.cpp index 2506c26f61..3a44ef4407 100644 --- a/src/libslic3r/Emboss.cpp +++ b/src/libslic3r/Emboss.cpp @@ -15,7 +15,6 @@ #include "Emboss.hpp" #include #include -#include #include #include #include diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index e95fe2741d..3dadb20253 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -29,6 +29,7 @@ #include "ExtrusionEntity.hpp" #include "Fill.hpp" #include "libslic3r/Fill/FillBase.hpp" +#include "FillAdaptive.hpp" #include "FillRectilinear.hpp" #include "FillLightning.hpp" #include "FillConcentricInternal.hpp" @@ -926,7 +927,6 @@ std::vector group_fills(const Layer &layer, LockRegionParam &lock_p params.lateral_lattice_angle_2 = region_config.lateral_lattice_angle_2; params.infill_overhang_angle = region_config.infill_overhang_angle; params.center_of_surface_pattern = region_config.center_of_surface_pattern; - params.separated_infills = region_config.separated_infills; if (params.pattern == ipLockedZag) { params.infill_lock_depth = scale_(region_config.infill_lock_depth); params.skin_infill_depth = scale_(region_config.skin_infill_depth); @@ -999,6 +999,9 @@ std::vector group_fills(const Layer &layer, LockRegionParam &lock_p // (which would unnecessarily split fill batching). // Stored on SurfaceFillParams; copied to FillParams during conversion. params.gyroid_optimized = (params.pattern == ipGyroid) && region_config.gyroid_optimized; + // Orca: Likewise separated_infills only where it can move the pattern. + params.separated_infills = region_config.separated_infills && is_separable_infill_pattern(params.pattern) && + params.extrusion_role != erTopSolidInfill && params.extrusion_role != erBottomSurface; if (params.extrusion_role == erInternalInfill) { params.angle = calculate_infill_rotation_angle(layer.object(), layer.id(), region_config.infill_direction.value, @@ -1073,7 +1076,7 @@ std::vector group_fills(const Layer &layer, LockRegionParam &lock_p //get locked region param if (params.pattern == ipLockedZag){ const PrintObject *object = layerm.layer()->object(); - auto nozzle_diameter = float(object->print()->config().nozzle_diameter.get_at(layerm.region().extruder(extrusion_role) - 1)); + auto nozzle_diameter = float(nozzle_diameter_for_filament(object->print()->config(), layerm.region().extruder(extrusion_role), object->print()->is_BBL_printer())); Flow skin_flow = params.bridge ? params.flow : Flow::new_from_config_width(extrusion_role, region_config.skin_infill_line_width, nozzle_diameter, float((surface.thickness == -1) ? layer.height : surface.thickness)); //add skin flow append_flow_param(lock_param.skin_flow_params, skin_flow, surface.expolygon); @@ -1271,29 +1274,28 @@ std::vector group_fills(const Layer &layer, LockRegionParam &lock_p // Orca: Anchors and printed infill must share the same body origin. Keep the choice // here so per-model surface centering and separated sparse infill cannot drift apart. -static BoundingBox infill_bounding_box(const Layer &layer, const SurfaceFill &fill, const ExPolygon &expoly, BoundingBox bbox) +// Returns the connected body the fill region is laid out on, or -1 to keep the object's origin. +static int infill_body(const Layer &layer, const SurfaceFill &fill, const ExPolygon &expoly) { const auto ¶ms = fill.params; - const auto &config = layer.regions()[fill.region_id]->region().config(); - const bool external = params.extrusion_role == erTopSolidInfill || params.extrusion_role == erBottomSurface; - const bool per_model = external && params.center_of_surface_pattern == CenterOfSurfacePattern::Each_Model && + const bool per_model = (params.extrusion_role == erTopSolidInfill || params.extrusion_role == erBottomSurface) && + params.center_of_surface_pattern == CenterOfSurfacePattern::Each_Model && (params.pattern == ipArchimedeanChords || params.pattern == ipOctagramSpiral); - const bool separate = !external && params.separated_infills && - (is_separable_infill_pattern(params.pattern) || !config.solid_infill_rotate_template.value.empty() || - !config.sparse_infill_rotate_template.value.empty()); - if (per_model || separate) { - double best_overlap = 0.; - for (size_t i = 0; i < layer.lslices.size() && i < layer.lslices_separated_component_bboxes.size(); ++i) { + int body = -1; + if (per_model || params.separated_infills || is_octree_infill_pattern(params.pattern)) { + const BoundingBox box = get_extents(expoly); + double best_overlap = 0.; + for (size_t i = 0; i < layer.lslices.size() && i < layer.lslices_separated_component_ids.size(); ++i) { + if (! layer.lslices_bboxes[i].overlap(box)) + continue; const double overlap = area(intersection_ex(layer.lslices[i], expoly)); if (overlap > best_overlap) { best_overlap = overlap; - const Point center = layer.lslices_separated_component_bboxes[i].center(); - bbox = layer.object()->bounding_box(); - bbox.translate(center.x(), center.y()); + body = int(layer.lslices_separated_component_ids[i]); } } } - return bbox; + return body; } #ifdef SLIC3R_DEBUG_SLICE_PROCESSING @@ -1318,7 +1320,7 @@ void export_group_fills_to_svg(const char *path, const std::vector #endif // friend to Layer -void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree, FillLightning::Generator* lightning_generator) +void Layer::make_fills(const FillAdaptive::Octrees* adaptive_fill_octrees, const FillAdaptive::Octrees* support_fill_octrees, FillLightning::Generator* lightning_generator) { for (LayerRegion *layerm : m_regions) layerm->fills.clear(); @@ -1351,7 +1353,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: f->z = this->print_z; f->angle = surface_fill.params.angle; f->fixed_angle = surface_fill.params.fixed_angle; - f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree; + const FillAdaptive::Octrees *octrees = surface_fill.params.pattern == ipSupportCubic ? support_fill_octrees : adaptive_fill_octrees; f->print_config = &this->object()->print()->config(); f->print_object_config = &this->object()->config(); if (surface_fill.params.pattern == ipConcentricInternal) { @@ -1443,8 +1445,10 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: params.can_reverse = false; for (ExPolygon& expoly : surface_fill.expolygons) { - // Orca: Reuse the body origin used for bridge anchoring, resetting it for each surface. - f->set_bounding_box(infill_bounding_box(*this, surface_fill, expoly, bbox)); + // Orca: Reuse the body box and octree used for bridge anchoring, resetting them for each surface. + const int body = infill_body(*this, surface_fill, expoly); + f->set_bounding_box(body >= 0 ? this->object()->separated_body_bboxes()[body] : bbox); + f->adapt_fill_octree = octrees ? octrees->get(body) : nullptr; f->no_overlap_expolygons = intersection_ex(surface_fill.no_overlap_expolygons, ExPolygons() = {expoly}, ApplySafetyOffset::Yes); if (params.symmetric_infill_y_axis) { @@ -1512,7 +1516,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: * - For lightning/adaptive patterns, the respective generators are wired so their * polylines match the final infill layout. */ -Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree, FillLightning::Generator* lightning_generator) const +Polylines Layer::generate_sparse_infill_polylines_for_anchoring(const FillAdaptive::Octrees* adaptive_fill_octrees, const FillAdaptive::Octrees* support_fill_octrees, FillLightning::Generator* lightning_generator) const { LockRegionParam skin_inner_param; std::vector surface_fills = group_fills(*this, skin_inner_param); @@ -1570,7 +1574,7 @@ Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Oc f->z = this->print_z; f->angle = surface_fill.params.angle; f->fixed_angle = surface_fill.params.fixed_angle; - f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree; + const FillAdaptive::Octrees *octrees = surface_fill.params.pattern == ipSupportCubic ? support_fill_octrees : adaptive_fill_octrees; f->print_config = &this->object()->print()->config(); f->print_object_config = &this->object()->config(); @@ -1617,8 +1621,10 @@ Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Oc params.extrusion_role = surface_fill.params.extrusion_role; for (ExPolygon &expoly : surface_fill.expolygons) { - // Orca: Match the per-body origin of make_fills() before generating physical anchors. - f->set_bounding_box(infill_bounding_box(*this, surface_fill, expoly, bbox)); + // Orca: Match the per-body box and octree of make_fills() before generating physical anchors. + const int body = infill_body(*this, surface_fill, expoly); + f->set_bounding_box(body >= 0 ? this->object()->separated_body_bboxes()[body] : bbox); + f->adapt_fill_octree = octrees ? octrees->get(body) : nullptr; // Spacing is modified by the filler to indicate adjustments. Reset it for each expolygon. f->spacing = surface_fill.params.spacing; surface_fill.surface.expolygon = std::move(expoly); @@ -1788,7 +1794,7 @@ void Layer::make_ironing() // Create the ironing extrusions for regions object()->print()->config().nozzle_diameter.get_at(ironing_params.extruder - 1); + double nozzle_dmr = nozzle_diameter_for_filament(this->object()->print()->config(), ironing_params.extruder, this->object()->print()->is_BBL_printer()); if (ironing_params.just_infill) { //TODO just_infill is currently not used. // Just infill. diff --git a/src/libslic3r/Fill/Fill3DHoneycomb.hpp b/src/libslic3r/Fill/Fill3DHoneycomb.hpp index a31608310d..66e16510da 100644 --- a/src/libslic3r/Fill/Fill3DHoneycomb.hpp +++ b/src/libslic3r/Fill/Fill3DHoneycomb.hpp @@ -25,6 +25,7 @@ public: // pattern is placed on top of previous layers bool use_bridge_flow() const override { return false; } bool is_self_crossing() override { return false; } + bool aligned_to_origin() const override { return true; } protected: void _fill_surface_single( diff --git a/src/libslic3r/Fill/FillAdaptive.hpp b/src/libslic3r/Fill/FillAdaptive.hpp index 9b424133a2..57cbe713f1 100644 --- a/src/libslic3r/Fill/FillAdaptive.hpp +++ b/src/libslic3r/Fill/FillAdaptive.hpp @@ -14,6 +14,7 @@ #include "libslic3r/BoundingBox.hpp" #include "libslic3r/ExPolygon.hpp" #include "FillBase.hpp" +#include #include #include #include @@ -37,6 +38,27 @@ struct Octree; struct OctreeDeleter { void operator()(Octree *p); }; using OctreePtr = std::unique_ptr; +// Orca: One octree per body (see Layer::lslices_separated_component_ids), and one of the whole object +// for objects of a single body or with a body that has none of its own. +struct Octrees +{ + OctreePtr object; + std::vector bodies; + + // A body without an octree, or body -1, uses the object's, or any body's when the object has none. + Octree *get(int body) const + { + if (body >= 0 && size_t(body) < bodies.size() && bodies[body]) + return bodies[body].get(); + if (object) + return object.get(); + for (const OctreePtr &octree : bodies) + if (octree) + return octree.get(); + return nullptr; + } +}; + // Calculate line spacing for // 1) adaptive cubic infill // 2) adaptive internal support cubic infill diff --git a/src/libslic3r/Fill/FillBase.cpp b/src/libslic3r/Fill/FillBase.cpp index 95b7dc28db..a852f2c42b 100644 --- a/src/libslic3r/Fill/FillBase.cpp +++ b/src/libslic3r/Fill/FillBase.cpp @@ -128,6 +128,9 @@ Polylines Fill::fill_surface(const Surface *surface, const FillParams ¶ms) { // Perform offset. Slic3r::ExPolygons expp = offset_ex(surface->expolygon, float(scale_(this->overlap - 0.5 * this->spacing))); + // Orca: Separated infills move the box center onto each body; origin-aligned patterns follow it. + const Point shift = this->aligned_to_origin() && ! empty(this->bounding_box) ? this->bounding_box.center() : Point::Zero(); + translate(expp, -shift); // Create the infills for each of the regions. Polylines polylines_out; for (size_t i = 0; i < expp.size(); ++ i) @@ -137,6 +140,8 @@ Polylines Fill::fill_surface(const Surface *surface, const FillParams ¶ms) _infill_direction(surface), std::move(expp[i]), polylines_out); + for (Polyline &pl : polylines_out) + pl.translate(shift); return polylines_out; } @@ -1591,13 +1596,18 @@ BoundaryInfillGraph create_boundary_infill_graph(const Polylines &infill_ordered // The extended bounding box of the whole object that covers any rotation of every layer. BoundingBox Fill::extended_object_bounding_box() const { - BoundingBox out = bounding_box; + // Orca: Extend about the box center, which separated infills move off the origin. + const Point c = this->bounding_box.center(); + BoundingBox out = this->bounding_box; + out.translate(-c.x(), -c.y()); out.merge(Point(out.min.y(), out.min.x())); out.merge(Point(out.max.y(), out.max.x())); // The bounding box is scaled by sqrt(2.) to ensure that the bounding box // covers any possible rotations. - return out.scaled(sqrt(2.)); + out = out.scaled(sqrt(2.)); + out.translate(c.x(), c.y()); + return out; } void Fill::connect_infill(Polylines &&infill_ordered, const std::vector &boundary_src, const BoundingBox &bbox, Polylines &polylines_out, const double spacing, const FillParams ¶ms) diff --git a/src/libslic3r/Fill/FillBase.hpp b/src/libslic3r/Fill/FillBase.hpp index 7599b2a0d2..45dcfc87e8 100644 --- a/src/libslic3r/Fill/FillBase.hpp +++ b/src/libslic3r/Fill/FillBase.hpp @@ -188,6 +188,9 @@ public: // Return true if infill has a consistent pattern between layers. virtual bool has_consistent_pattern() const { return false; } + // Orca: Is the pattern laid out from the origin instead of the bounding box center? + virtual bool aligned_to_origin() const { return false; } + // Perform the fill. virtual Polylines fill_surface(const Surface *surface, const FillParams ¶ms); virtual ThickPolylines fill_surface_arachne(const Surface* surface, const FillParams& params); diff --git a/src/libslic3r/Fill/FillCrossHatch.hpp b/src/libslic3r/Fill/FillCrossHatch.hpp index 4b18443aae..14eb7fcbf4 100644 --- a/src/libslic3r/Fill/FillCrossHatch.hpp +++ b/src/libslic3r/Fill/FillCrossHatch.hpp @@ -19,6 +19,7 @@ public: Fill *clone() const override { return new FillCrossHatch(*this); }; ~FillCrossHatch() override {} bool is_self_crossing() override { return false; } + bool aligned_to_origin() const override { return true; } protected: void _fill_surface_single( diff --git a/src/libslic3r/Fill/FillGyroid.hpp b/src/libslic3r/Fill/FillGyroid.hpp index ad032d5904..a60216824b 100644 --- a/src/libslic3r/Fill/FillGyroid.hpp +++ b/src/libslic3r/Fill/FillGyroid.hpp @@ -20,6 +20,7 @@ public: // require bridge flow since most of this pattern hangs in air bool use_bridge_flow() const override { return false; } bool is_self_crossing() override { return false; } + bool aligned_to_origin() const override { return true; } // Correction applied to regular infill angle to maximize printing // speed in default configuration (degrees) diff --git a/src/libslic3r/Fill/FillHoneycomb.hpp b/src/libslic3r/Fill/FillHoneycomb.hpp index fd1fe039de..d682e69b2c 100644 --- a/src/libslic3r/Fill/FillHoneycomb.hpp +++ b/src/libslic3r/Fill/FillHoneycomb.hpp @@ -20,6 +20,7 @@ class FillHoneycomb : public Fill public: ~FillHoneycomb() override {} bool is_self_crossing() override { return false; } + bool aligned_to_origin() const override { return true; } protected: Fill* clone() const override { return new FillHoneycomb(*this); }; diff --git a/src/libslic3r/Fill/FillRectilinear.cpp b/src/libslic3r/Fill/FillRectilinear.cpp index 85de82e27c..f7954ef7fc 100644 --- a/src/libslic3r/Fill/FillRectilinear.cpp +++ b/src/libslic3r/Fill/FillRectilinear.cpp @@ -2750,23 +2750,6 @@ static void polylines_from_paths(const std::vector &path, c } } -// The extended bounding box of the whole object that covers any rotation of every layer. -BoundingBox FillRectilinear::extended_object_bounding_box() const { - // Build the extension around the box center. The transpose merge and the sqrt(2.) scaling - // (which covers any possible rotation) are both defined about the origin, so a box that is not - // origin-centered — e.g. a separated-infill box re-centered on a single assembly part — would be - // distorted. Shift to the origin first and back afterwards; for the default origin-centered box - // the two translations cancel and this is identical to the original behavior. - const Point c = this->bounding_box.center(); - BoundingBox out = this->bounding_box; - out.translate(-c.x(), -c.y()); - out.merge(Point(out.min.y(), out.min.x())); - out.merge(Point(out.max.y(), out.max.x())); - out = out.scaled(sqrt(2.)); - out.translate(c.x(), c.y()); - return out; -} - bool FillRectilinear::fill_surface_by_lines(const Surface *surface, const FillParams ¶ms, float angleBase, float pattern_shift, Polylines &polylines_out) { // At the end, only the new polylines will be rotated back. @@ -2801,7 +2784,13 @@ bool FillRectilinear::fill_surface_by_lines(const Surface *surface, const FillPa // For infill that needs to be consistent between layers (like Zig Zag), // we use bounding box of whole object to match vertical lines between layers. BoundingBox bounding_box_src = poly_with_offset.bounding_box_src(); - BoundingBox bounding_box = this->has_consistent_pattern() ? this->extended_object_bounding_box() : bounding_box_src; + BoundingBox bounding_box = bounding_box_src; + if (this->has_consistent_pattern()) { + // Orca: The polygons are rotated about the origin, so follow the box center to where it was rotated. + const Point c = this->bounding_box.center(); + bounding_box = this->extended_object_bounding_box(); + bounding_box.translate(c.rotated(- rotate_vector.first) - c); + } // define flow spacing according to requested density if (params.full_infill() && !params.dont_adjust) { diff --git a/src/libslic3r/Fill/FillRectilinear.hpp b/src/libslic3r/Fill/FillRectilinear.hpp index 59bb56a5c8..56f4505bd2 100644 --- a/src/libslic3r/Fill/FillRectilinear.hpp +++ b/src/libslic3r/Fill/FillRectilinear.hpp @@ -42,9 +42,6 @@ protected: }; bool fill_surface_by_multilines(const Surface *surface, FillParams params, const std::initializer_list &sweep_params, Polylines &polylines_out); bool fill_surface_trapezoidal(const Surface *surface, FillParams params, Polylines &polylines_out, int Pattern_type); - - // The extended bounding box of the whole object that covers any rotation of every layer. - BoundingBox extended_object_bounding_box() const; }; class FillAlignedRectilinear : public FillRectilinear diff --git a/src/libslic3r/Fill/FillTpmsD.hpp b/src/libslic3r/Fill/FillTpmsD.hpp index 8dfa12196a..ce041c98fe 100644 --- a/src/libslic3r/Fill/FillTpmsD.hpp +++ b/src/libslic3r/Fill/FillTpmsD.hpp @@ -31,6 +31,7 @@ public: Polylines& polylines_out) override; bool is_self_crossing() override { return false; } + bool aligned_to_origin() const override { return true; } // Density adjustment to have a good %of weight. static constexpr double DensityAdjust = 2.1; diff --git a/src/libslic3r/Fill/FillTpmsFK.hpp b/src/libslic3r/Fill/FillTpmsFK.hpp index d1fec0e93f..e9b6b89913 100644 --- a/src/libslic3r/Fill/FillTpmsFK.hpp +++ b/src/libslic3r/Fill/FillTpmsFK.hpp @@ -31,6 +31,7 @@ public: Polylines& polylines_out) override; bool is_self_crossing() override { return false; } + bool aligned_to_origin() const override { return true; } }; diff --git a/src/libslic3r/Flow.cpp b/src/libslic3r/Flow.cpp index 96cbb86949..7f07c63157 100644 --- a/src/libslic3r/Flow.cpp +++ b/src/libslic3r/Flow.cpp @@ -241,14 +241,14 @@ Flow support_material_flow(const PrintObject *object, float layer_height) // The width parameter accepted by new_from_config_width is of type ConfigOptionFloatOrPercent, the Flow class takes care of the percent to value substitution. (object->config().support_line_width.value > 0) ? object->config().support_line_width : object->config().line_width, // if object->config().support_filament == 0 (which means to not trigger tool change, but use the current extruder instead), get_at will return the 0th component. - float(object->print()->config().nozzle_diameter.get_at(object->config().support_filament-1)), + float(nozzle_diameter_for_filament(object->print()->config(), object->config().support_filament, object->print()->is_BBL_printer())), (layer_height > 0.f) ? layer_height : float(object->config().layer_height.value)); } //BBS Flow support_transition_flow(const PrintObject* object) { //BBS: support transition of tree support is bridge flow - float dmr = float(object->print()->config().nozzle_diameter.get_at(object->config().support_filament - 1)); + float dmr = float(nozzle_diameter_for_filament(object->print()->config(), object->config().support_filament, object->print()->is_BBL_printer())); return Flow::bridging_flow(dmr, dmr); } @@ -260,7 +260,7 @@ Flow support_material_1st_layer_flow(const PrintObject *object, float layer_heig frSupportMaterial, // The width parameter accepted by new_from_config_width is of type ConfigOptionFloatOrPercent, the Flow class takes care of the percent to value substitution. (width.value > 0) ? width : object->config().line_width, - float(print_config.nozzle_diameter.get_at(object->config().support_filament-1)), + float(nozzle_diameter_for_filament(print_config, object->config().support_filament, object->print()->is_BBL_printer())), (layer_height > 0.f) ? layer_height : float(print_config.initial_layer_print_height.value)); } @@ -271,7 +271,7 @@ Flow support_material_interface_flow(const PrintObject *object, float layer_heig // The width parameter accepted by new_from_config_width is of type ConfigOptionFloatOrPercent, the Flow class takes care of the percent to value substitution. (object->config().support_line_width > 0) ? object->config().support_line_width : object->config().line_width, // if object->config().support_interface_filament == 0 (which means to not trigger tool change, but use the current extruder instead), get_at will return the 0th component. - float(object->print()->config().nozzle_diameter.get_at(object->config().support_interface_filament-1)), + float(nozzle_diameter_for_filament(object->print()->config(), object->config().support_interface_filament, object->print()->is_BBL_printer())), (layer_height > 0.f) ? layer_height : float(object->config().layer_height.value)); } diff --git a/src/libslic3r/Format/STEP.cpp b/src/libslic3r/Format/STEP.cpp index 57d8e44157..962c4cffb9 100644 --- a/src/libslic3r/Format/STEP.cpp +++ b/src/libslic3r/Format/STEP.cpp @@ -55,7 +55,6 @@ #include "TDataStd_Name.hxx" #include "BRepBuilderAPI_Transform.hxx" #include "TopExp_Explorer.hxx" -#include "TopExp_Explorer.hxx" #include "BRep_Tool.hxx" #include "BRepTools.hxx" #include diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c92ebc8e1c..453317ef2c 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -46,7 +46,6 @@ #include "Print.hpp" #include "Utils.hpp" #include "ClipperUtils.hpp" -#include "libslic3r.h" #include "LocalesUtils.hpp" #include "libslic3r/format.hpp" #include "Time.hpp" @@ -160,14 +159,9 @@ static const float g_purge_volume_one_time = 135.f; static const int g_max_flush_count = 4; static const size_t g_max_label_object = 64; -static bool is_bambu_x2d_printer(const FullPrintConfig &config) -{ - return config.printer_model.value == "Bambu Lab X2D"; -} - // Multi-nozzle printer predicate: an extruder carries a nozzle cluster (extruder_max_nozzle_count // entry > 1). Today only H2C profiles trip it, so every existing single- and dual-extruder printer -// is excluded and keeps its historic placeholder values. +// is excluded and keeps its historic first-filament marker. static bool is_multi_nozzle_printer(const FullPrintConfig &config) { return std::any_of(config.extruder_max_nozzle_count.values.begin(), @@ -175,33 +169,20 @@ static bool is_multi_nozzle_printer(const FullPrintConfig &config) [](int v) { return v > 1; }); } -static int hotend_id_for_gcode_placeholder(const FullPrintConfig &config, int hotend_id) +// current_hotend / next_hotend value. On a BBL printer: the real nozzle id only while the print uses a +// dynamic nozzle map (a filament moves between nozzles across layers), else -1. Bambu firmware reads an +// explicit hotend index as a request for the Filament Track Switch and rejects the job on a printer +// without one. group_result may be null on slicing paths that don't populate it, which resolves to -1. +// Any other printer has no firmware hotend selection and gets the filament's extruder index, whatever +// its nozzle map, so existing custom G-code keeps its values. +static int hotend_id_for_gcode_placeholder(const std::shared_ptr &group_result, + bool is_bbl_printer, int filament_id, int extruder_id, int layer_id = -1) { - return is_bambu_x2d_printer(config) ? -1 : hotend_id; -} - -// current_hotend / next_hotend value. For multi-nozzle printers a dynamic nozzle map yields the real -// nozzle id, a static map yields -1: -// - multi-nozzle (H2C): dynamic nozzle map -> real nozzle id; static -> -1. -// The dynamic branch is dormant today: the selector create() overload that sets the flag has no -// callers yet (deferred with the nozzle-assignment pipeline), so H2C currently resolves to -1. -// - X2D: keeps its historic -1 (single-nozzle -> falls through to the fallback helper). -// - every other (existing single-nozzle) printer: keeps its historic extruder-id value, so -// existing g-code stays byte-identical. -// group_result may be null on slicing paths that don't populate it -> the dynamic branch is simply -// skipped, so we never dereference null. -static int hotend_id_for_gcode_placeholder(const FullPrintConfig &config, - const std::shared_ptr &group_result, - int filament_id, - int extruder_id, - int layer_id = -1) -{ - if (is_multi_nozzle_printer(config)) { - if (group_result && group_result->is_support_dynamic_nozzle_map() && filament_id >= 0) - return group_result->get_nozzle_id(filament_id, layer_id); - return -1; - } - return hotend_id_for_gcode_placeholder(config, extruder_id); + if (!is_bbl_printer) + return extruder_id; + if (group_result && group_result->is_support_dynamic_nozzle_map() && filament_id >= 0) + return group_result->get_nozzle_id(filament_id, layer_id); + return -1; } // Logical nozzle id for the *_nozzle_id placeholders. Null-safe: falls back to the @@ -216,24 +197,20 @@ static int nozzle_id_for_gcode_placeholder(const std::shared_ptr -1; dynamic branch dormant; -// existing printers -> extruder id; X2D -> -1); they differ from the layer-based helper only on the dormant -// dynamic path for a filament first used after layer 0. -static int first_hotend_id_for_gcode_placeholder(const FullPrintConfig &config, - const std::shared_ptr &group_result, - int filament_id, - int extruder_id) +// (the nozzle a filament FIRST uses) rather than the layer-based get_nozzle_id. Same hotend-value rule +// as hotend_id_for_gcode_placeholder above; they differ from the layer-based helper only on the dynamic +// path for a filament first used after layer 0. +static int first_hotend_id_for_gcode_placeholder(const std::shared_ptr &group_result, + bool is_bbl_printer, int filament_id, int extruder_id) { - if (is_multi_nozzle_printer(config)) { - if (group_result && group_result->is_support_dynamic_nozzle_map() && filament_id >= 0) { - auto nozzle = group_result->get_first_nozzle_for_filament(filament_id); - if (nozzle) - return nozzle->group_id; - } - return -1; + if (!is_bbl_printer) + return extruder_id; + if (group_result && group_result->is_support_dynamic_nozzle_map() && filament_id >= 0) { + auto nozzle = group_result->get_first_nozzle_for_filament(filament_id); + if (nozzle) + return nozzle->group_id; } - return hotend_id_for_gcode_placeholder(config, extruder_id); + return -1; } static int first_nozzle_id_for_gcode_placeholder(const std::shared_ptr &group_result, @@ -1220,12 +1197,11 @@ static std::vector get_path_of_change_filament(const Print& print) config.set_key_value("previous_extruder", new ConfigOptionInt(old_filament_id)); config.set_key_value("next_extruder", new ConfigOptionInt(new_filament_id)); - // current_hotend/next_hotend (see hotend_id_for_gcode_placeholder): multi-nozzle H2C -> -1 - // (static; dynamic branch dormant), X2D -> -1, existing printers -> extruder id. + const bool is_bbl_printer = gcodegen.m_print->is_BBL_printer(); config.set_key_value("current_hotend", new ConfigOptionInt( - hotend_id_for_gcode_placeholder(gcodegen.m_config, group_result, old_filament_id, old_extruder_id, m_layer_idx))); + hotend_id_for_gcode_placeholder(group_result, is_bbl_printer, old_filament_id, old_extruder_id, m_layer_idx))); config.set_key_value("next_hotend", new ConfigOptionInt( - hotend_id_for_gcode_placeholder(gcodegen.m_config, group_result, new_filament_id, (int) gcodegen.get_extruder_id(new_filament_id), m_layer_idx))); + hotend_id_for_gcode_placeholder(group_result, is_bbl_printer, new_filament_id, (int) gcodegen.get_extruder_id(new_filament_id), m_layer_idx))); config.set_key_value("current_nozzle_id", new ConfigOptionInt(old_nozzle_id)); config.set_key_value("next_nozzle_id", new ConfigOptionInt(next_nozzle_id)); config.set_key_value("current_filament_id", new ConfigOptionInt(old_filament_id)); @@ -1504,7 +1480,7 @@ static std::vector get_path_of_change_filament(const Print& print) gcodegen.placeholder_parser().set("current_nozzle_id", nozzle_id_for_gcode_placeholder(group_result, new_filament_id, new_extruder_id, m_layer_idx)); gcodegen.placeholder_parser().set("current_hotend", - hotend_id_for_gcode_placeholder(gcodegen.m_config, group_result, new_filament_id, new_extruder_id, m_layer_idx)); + hotend_id_for_gcode_placeholder(group_result, gcodegen.m_print->is_BBL_printer(), new_filament_id, new_extruder_id, m_layer_idx)); { size_t fi = gcodegen.get_filament_config_index(new_filament_id); gcodegen.placeholder_parser().set("retraction_distance_when_cut", gcodegen.m_config.retraction_distances_when_cut.get_at(fi)); @@ -3470,20 +3446,19 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato first_non_support_hotends.reserve(first_non_support_filaments.size()); for (int filament_id : first_non_support_filaments) first_non_support_hotends.push_back(filament_id < 0 ? -1 : - first_hotend_id_for_gcode_placeholder(m_config, group_result, filament_id, (int) get_extruder_id(filament_id))); + first_hotend_id_for_gcode_placeholder(group_result, is_bbl_printers, filament_id, (int) get_extruder_id(filament_id))); this->placeholder_parser().set("first_non_support_tools", new ConfigOptionInts(first_non_support_filaments)); this->placeholder_parser().set("first_non_support_filaments", new ConfigOptionInts(first_non_support_filaments)); this->placeholder_parser().set("first_non_support_hotend", new ConfigOptionInts(first_non_support_hotends)); this->placeholder_parser().set("initial_no_support_tool", initial_non_support_extruder_id); this->placeholder_parser().set("initial_no_support_extruder", initial_non_support_extruder_id); - // initial_no_support_hotend/current_hotend (see first_hotend_id_for_gcode_placeholder): multi-nozzle - // H2C -> -1 (static; dynamic branch dormant), X2D -> -1, existing printers -> extruder id. this->placeholder_parser().set("initial_no_support_hotend", - first_hotend_id_for_gcode_placeholder(m_config, group_result, (int) initial_non_support_extruder_id, (int) get_extruder_id(initial_non_support_extruder_id))); + first_hotend_id_for_gcode_placeholder(group_result, is_bbl_printers, (int) initial_non_support_extruder_id, + (int) get_extruder_id(initial_non_support_extruder_id))); this->placeholder_parser().set("current_extruder", initial_extruder_id); this->placeholder_parser().set("current_hotend", - first_hotend_id_for_gcode_placeholder(m_config, group_result, (int) initial_extruder_id, extruder_id)); + first_hotend_id_for_gcode_placeholder(group_result, is_bbl_printers, (int) initial_extruder_id, extruder_id)); this->placeholder_parser().set("current_filament_id", (int) initial_extruder_id); this->placeholder_parser().set("current_extruder_id", extruder_id); this->placeholder_parser().set("current_nozzle_id", @@ -3996,7 +3971,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.writeln(filament_start_gcode); // Mark the first filament used in print. Multi-nozzle printers (H2C) get ";VT%d H%d" where // H = dynamic ? nozzle_id : -1; existing single-nozzle printers keep the bare ";VT%d" so their - // g-code stays byte-identical. (The dynamic branch is dormant, so H2C currently emits H-1.) + // g-code stays byte-identical. if (is_multi_nozzle_printer(m_config)) { int initial_nozzle_id = -1; if (group_result && group_result->is_support_dynamic_nozzle_map()) { @@ -10168,6 +10143,9 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo this->placeholder_parser().set("current_extruder_id", new_extruder_id); this->placeholder_parser().set("current_nozzle_id", nozzle_id_for_gcode_placeholder(m_print->get_layered_nozzle_group_result(), (int) new_filament_id, new_extruder_id, m_layer_index)); + this->placeholder_parser().set("current_hotend", + hotend_id_for_gcode_placeholder(m_print->get_layered_nozzle_group_result(), m_print->is_BBL_printer(), (int) new_filament_id, + new_extruder_id, m_layer_index)); { size_t fi = get_filament_config_index(new_filament_id); this->placeholder_parser().set("retraction_distance_when_ec", m_config.retraction_distances_when_ec.get_at(fi)); @@ -10346,12 +10324,10 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo dyn_config.set_key_value("outer_wall_volumetric_speed", new ConfigOptionFloat(outer_wall_volumetric_speed)); dyn_config.set_key_value("previous_extruder", new ConfigOptionInt(old_filament_id)); dyn_config.set_key_value("next_extruder", new ConfigOptionInt((int)new_filament_id)); - // current_hotend/next_hotend (see hotend_id_for_gcode_placeholder): multi-nozzle H2C -> -1 - // (static; dynamic branch dormant), X2D -> -1, existing printers -> extruder id. dyn_config.set_key_value("current_hotend", new ConfigOptionInt( - hotend_id_for_gcode_placeholder(m_config, group_result, old_filament_id, old_extruder_id, m_layer_index))); + hotend_id_for_gcode_placeholder(group_result, m_print->is_BBL_printer(), old_filament_id, old_extruder_id, m_layer_index))); dyn_config.set_key_value("next_hotend", new ConfigOptionInt( - hotend_id_for_gcode_placeholder(m_config, group_result, (int) new_filament_id, new_extruder_id, m_layer_index))); + hotend_id_for_gcode_placeholder(group_result, m_print->is_BBL_printer(), (int) new_filament_id, new_extruder_id, m_layer_index))); dyn_config.set_key_value("current_nozzle_id", new ConfigOptionInt(old_nozzle_id)); dyn_config.set_key_value("next_nozzle_id", new ConfigOptionInt(next_nozzle_id)); dyn_config.set_key_value("current_filament_id", new ConfigOptionInt(old_filament_id)); @@ -10529,7 +10505,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo this->placeholder_parser().set("current_extruder", new_filament_id); this->placeholder_parser().set("current_hotend", - hotend_id_for_gcode_placeholder(m_config, group_result, (int) new_filament_id, new_extruder_id, m_layer_index)); + hotend_id_for_gcode_placeholder(group_result, m_print->is_BBL_printer(), (int) new_filament_id, new_extruder_id, m_layer_index)); // Orca: keep the global current-tool identity coherent for later contexts (see append_tcr). this->placeholder_parser().set("current_filament_id", (int) new_filament_id); this->placeholder_parser().set("current_extruder_id", new_extruder_id); diff --git a/src/libslic3r/GCode/ConflictChecker.hpp b/src/libslic3r/GCode/ConflictChecker.hpp index fb1e02ec3f..85fabec585 100644 --- a/src/libslic3r/GCode/ConflictChecker.hpp +++ b/src/libslic3r/GCode/ConflictChecker.hpp @@ -148,8 +148,6 @@ struct ConflictComputeResult using ConflictComputeOpt = std::optional; -using ConflictObjName = std::optional>; - struct ConflictChecker { static ConflictResultOpt find_inter_of_lines_in_diff_objs(PrintObjectPtrs objs, std::optional wtdptr); diff --git a/src/libslic3r/GCode/FanMover.cpp b/src/libslic3r/GCode/FanMover.cpp index 3fc85828ec..d303cbbac6 100644 --- a/src/libslic3r/GCode/FanMover.cpp +++ b/src/libslic3r/GCode/FanMover.cpp @@ -27,8 +27,6 @@ #include "../PrintConfig.hpp" #include "../Utils.hpp" #include "Print.hpp" -#include "libslic3r/PrintConfig.hpp" -#include "libslic3r/libslic3r.h" #include #include diff --git a/src/libslic3r/GCode/PreciseSeam.hpp b/src/libslic3r/GCode/PreciseSeam.hpp index bbb4d98532..f9e1b1ddf3 100644 --- a/src/libslic3r/GCode/PreciseSeam.hpp +++ b/src/libslic3r/GCode/PreciseSeam.hpp @@ -22,9 +22,6 @@ namespace Slic3r { namespace PreciseSeam { -// Import EnforcedBlockedSeamPoint from SeamPlacerImpl namespace for convenience -using SeamPlacerImpl::EnforcedBlockedSeamPoint; - // Geometry and its exterior bounds are prepared together, then treated as read-only. struct ModifierRegion { ExPolygon polygon; @@ -137,7 +134,7 @@ SegmentExtraction extract_perimeter_segments(const PreparedPerimeter &prepared, // Result of weak modifier segment processing struct WeakModifierSegment { - EnforcedBlockedSeamPoint type; // Enforced/Blocked/Neutral + SeamPlacerImpl::EnforcedBlockedSeamPoint type; // Enforced/Blocked/Neutral Point left_point; // Coordinates of left (first) point of segment PerimeterPosition left_position; // Position on the source perimeter before insertion/refinement. Point right_point; // Coordinates of right (last) point of segment diff --git a/src/libslic3r/GCode/Thumbnails.hpp b/src/libslic3r/GCode/Thumbnails.hpp index a5fd598519..bbe8039d80 100644 --- a/src/libslic3r/GCode/Thumbnails.hpp +++ b/src/libslic3r/GCode/Thumbnails.hpp @@ -40,8 +40,7 @@ std::string get_error_string(const ThumbnailErrors& errors); typedef std::vector> GCodeThumbnailDefinitionsList; -using namespace std::literals; -std::pair make_and_check_thumbnail_list(const std::string& thumbnails_string, const std::string_view def_ext = "PNG"sv); +std::pair make_and_check_thumbnail_list(const std::string& thumbnails_string, const std::string_view def_ext = "PNG"); std::pair make_and_check_thumbnail_list(const ConfigBase &config); diff --git a/src/libslic3r/GCodeSender.cpp b/src/libslic3r/GCodeSender.cpp deleted file mode 100644 index 275dd61a79..0000000000 --- a/src/libslic3r/GCodeSender.cpp +++ /dev/null @@ -1,580 +0,0 @@ -#include "GCodeSender.hpp" -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__APPLE__) || defined(__OpenBSD__) -#include -#endif -#ifdef __APPLE__ -#include -#include -#endif -#ifdef __linux__ -#include -#include -#include "/usr/include/asm-generic/ioctls.h" - -/* The following definitions are kindly borrowed from: - /usr/include/asm-generic/termbits.h - Unfortunately we cannot just include that one because - it would redefine the "struct termios" already defined - the already included by Boost.ASIO. */ -#define K_NCCS 19 -struct termios2 { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[K_NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; -}; -#define BOTHER CBAUDEX - -#endif - -//#define DEBUG_SERIAL -#ifdef DEBUG_SERIAL -#include -#include -std::fstream fs; -#endif - -#define KEEP_SENT 20 - -namespace Slic3r { - -GCodeSender::GCodeSender() - : io(), serial(io), can_send(false), sent(0), open(false), error(false), - connected(false), queue_paused(false) -{ -#ifdef DEBUG_SERIAL - std::srand(std::time(nullptr)); -#endif -} - -GCodeSender::~GCodeSender() -{ - this->disconnect(); -} - -bool -GCodeSender::connect(std::string devname, unsigned int baud_rate) -{ - this->disconnect(); - - this->set_error_status(false); - try { - this->serial.open(devname); - - this->serial.set_option(boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::odd)); - this->serial.set_option(boost::asio::serial_port_base::character_size(boost::asio::serial_port_base::character_size(8))); - this->serial.set_option(boost::asio::serial_port_base::flow_control(boost::asio::serial_port_base::flow_control::none)); - this->serial.set_option(boost::asio::serial_port_base::stop_bits(boost::asio::serial_port_base::stop_bits::one)); - this->set_baud_rate(baud_rate); - - this->serial.close(); - this->serial.open(devname); - this->serial.set_option(boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none)); - - // set baud rate again because set_option overwrote it - this->set_baud_rate(baud_rate); - this->open = true; - this->reset(); - } catch (boost::system::system_error &) { - this->set_error_status(true); - return false; - } - - // a reset firmware expect line numbers to start again from 1 - this->sent = 0; - this->last_sent.clear(); - - /* Initialize debugger */ -#ifdef DEBUG_SERIAL - fs.open("serial.txt", std::fstream::out | std::fstream::trunc); -#endif - - // this gives some work to the io_service before it is started - // (post() runs the supplied function in its thread) - this->io.post(boost::bind(&GCodeSender::do_read, this)); - - // start reading in the background thread - boost::thread t(boost::bind(&boost::asio::io_service::run, &this->io)); - this->background_thread.swap(t); - - // always send a M105 to check for connection because firmware might be silent on connect - //FIXME Vojtech: This is being sent too early, leading to line number synchronization issues, - // from which the GCodeSender never recovers. - // this->send("M105", true); - - return true; -} - -void -GCodeSender::set_baud_rate(unsigned int baud_rate) -{ - try { - // This does not support speeds > 115200 - this->serial.set_option(boost::asio::serial_port_base::baud_rate(baud_rate)); - } catch (boost::system::system_error &) { - boost::asio::serial_port::native_handle_type handle = this->serial.native_handle(); - -#if __APPLE__ - termios ios; - ::tcgetattr(handle, &ios); - ::cfsetspeed(&ios, baud_rate); - speed_t newSpeed = baud_rate; - ioctl(handle, IOSSIOSPEED, &newSpeed); - ::tcsetattr(handle, TCSANOW, &ios); -#elif __linux__ - termios2 ios; - if (ioctl(handle, TCGETS2, &ios)) - printf("Error in TCGETS2: %s\n", strerror(errno)); - ios.c_ispeed = ios.c_ospeed = baud_rate; - ios.c_cflag &= ~CBAUD; - ios.c_cflag |= BOTHER | CLOCAL | CREAD; - ios.c_cc[VMIN] = 1; // Minimum of characters to read, prevents eof errors when 0 bytes are read - ios.c_cc[VTIME] = 1; - if (ioctl(handle, TCSETS2, &ios)) - printf("Error in TCSETS2: %s\n", strerror(errno)); - -#elif __OpenBSD__ - struct termios ios; - ::tcgetattr(handle, &ios); - ::cfsetspeed(&ios, baud_rate); - if (::tcsetattr(handle, TCSAFLUSH, &ios) != 0) - printf("Failed to set baud rate: %s\n", strerror(errno)); -#else - //throw Slic3r::InvalidArgument("OS does not currently support custom bauds"); -#endif - } -} - -void -GCodeSender::disconnect() -{ - if (!this->open) return; - this->open = false; - this->connected = false; - this->io.post(boost::bind(&GCodeSender::do_close, this)); - this->background_thread.join(); - this->io.reset(); - /* - if (this->error_status()) { - throw(boost::system::system_error(boost::system::error_code(), - "Error while closing the device")); - } - */ - -#ifdef DEBUG_SERIAL - fs << "DISCONNECTED" << std::endl << std::flush; - fs.close(); -#endif -} - -bool -GCodeSender::is_connected() const -{ - return this->connected; -} - -bool -GCodeSender::wait_connected(unsigned int timeout) const -{ - using namespace boost::posix_time; - ptime t0 = second_clock::local_time() + seconds(timeout); - while (!this->connected) { - if (second_clock::local_time() > t0) return false; - boost::this_thread::sleep(boost::posix_time::milliseconds(100)); - } - return true; -} - -size_t -GCodeSender::queue_size() const -{ - boost::lock_guard l(this->queue_mutex); - return this->queue.size(); -} - -void -GCodeSender::pause_queue() -{ - boost::lock_guard l(this->queue_mutex); - this->queue_paused = true; -} - -void -GCodeSender::resume_queue() -{ - { - boost::lock_guard l(this->queue_mutex); - this->queue_paused = false; - } - this->send(); -} - -void -GCodeSender::purge_queue(bool priority) -{ - boost::lock_guard l(this->queue_mutex); - if (priority) { - // clear priority queue - std::list empty; - std::swap(this->priqueue, empty); - } else { - // clear queue - std::queue empty; - std::swap(this->queue, empty); - this->queue_paused = false; - } -} - -// purge log and return its contents -std::vector -GCodeSender::purge_log() -{ - boost::lock_guard l(this->log_mutex); - std::vector retval; - retval.reserve(this->log.size()); - while (!this->log.empty()) { - retval.push_back(this->log.front()); - this->log.pop(); - } - return retval; -} - -std::string -GCodeSender::getT() const -{ - boost::lock_guard l(this->log_mutex); - return this->T; -} - -std::string -GCodeSender::getB() const -{ - boost::lock_guard l(this->log_mutex); - return this->B; -} - -void -GCodeSender::do_close() -{ - this->set_error_status(false); - boost::system::error_code ec; - this->serial.cancel(ec); - if (ec) this->set_error_status(true); - this->serial.close(ec); - if (ec) this->set_error_status(true); -} - -void -GCodeSender::set_error_status(bool e) -{ - boost::lock_guard l(this->error_mutex); - this->error = e; -} - -bool -GCodeSender::error_status() const -{ - boost::lock_guard l(this->error_mutex); - return this->error; -} - -void -GCodeSender::do_read() -{ - // read one line - boost::asio::async_read_until( - this->serial, - this->read_buffer, - '\n', - boost::bind( - &GCodeSender::on_read, - this, - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred - ) - ); -} - -void -GCodeSender::on_read(const boost::system::error_code& error, - size_t bytes_transferred) -{ - this->set_error_status(false); - if (error) { - #ifdef __APPLE__ - if (error.value() == 45) { - // OS X bug: http://osdir.com/ml/lib.boost.asio.user/2008-08/msg00004.html - this->do_read(); - return; - } - #endif - - // printf("ERROR: [%d] %s\n", error.value(), error.message().c_str()); - // error can be true even because the serial port was closed. - // In this case it is not a real error, so ignore. - if (this->open) { - this->do_close(); - this->set_error_status(true); - } - return; - } - - std::istream is(&this->read_buffer); - std::string line; - std::getline(is, line); - if (!line.empty()) { -#ifdef DEBUG_SERIAL - fs << "<< " << line << std::endl << std::flush; -#endif - - // note that line might contain \r at its end - // parse incoming line - if (!this->connected - && (boost::starts_with(line, "start") - || boost::starts_with(line, "Grbl ") - || boost::starts_with(line, "ok") - || boost::contains(line, "T:"))) { - this->connected = true; - { - boost::lock_guard l(this->queue_mutex); - this->can_send = true; - } - this->send(); - } else if (boost::starts_with(line, "ok")) { - { - boost::lock_guard l(this->queue_mutex); - this->can_send = true; - } - this->send(); - } else if (boost::istarts_with(line, "resend") // Marlin uses "Resend: " - || boost::istarts_with(line, "rs")) { - // extract the first number from line - boost::algorithm::trim_left_if(line, !boost::algorithm::is_digit()); - size_t toresend = boost::lexical_cast(line.substr(0, line.find_first_not_of("0123456789"))); - -#ifdef DEBUG_SERIAL - fs << "!! line num out of sync: toresend = " << toresend << ", sent = " << sent << ", last_sent.size = " << last_sent.size() << std::endl; -#endif - - if (toresend > this->sent - this->last_sent.size() && toresend <= this->sent) { - { - boost::lock_guard l(this->queue_mutex); - - const auto lines_to_resend = this->sent - toresend + 1; -#ifdef DEBUG_SERIAL - fs << "!! resending " << lines_to_resend << " lines" << std::endl; -#endif - // move the unsent lines to priqueue - this->priqueue.insert( - this->priqueue.begin(), // insert at the beginning - this->last_sent.begin() + this->last_sent.size() - lines_to_resend, - this->last_sent.end() - ); - - // we can empty last_sent because it's not useful anymore - this->last_sent.clear(); - - // start resending with the requested line number - this->sent = toresend - 1; - this->can_send = true; - } - this->send(); - } else { - printf("Cannot resend %zu (oldest we have is %zu)\n", toresend, this->sent - this->last_sent.size()); - } - } else if (boost::starts_with(line, "wait")) { - // ignore - } else { - // push any other line into the log - boost::lock_guard l(this->log_mutex); - this->log.push(line); - } - - // parse temperature info - { - size_t pos = line.find("T:"); - if (pos != std::string::npos && line.size() > pos + 2) { - // we got temperature info - boost::lock_guard l(this->log_mutex); - this->T = line.substr(pos+2, line.find_first_not_of("0123456789.", pos+2) - (pos+2)); - - pos = line.find("B:"); - if (pos != std::string::npos && line.size() > pos + 2) { - // we got bed temperature info - this->B = line.substr(pos+2, line.find_first_not_of("0123456789.", pos+2) - (pos+2)); - } - } - } - } - this->do_read(); -} - -void -GCodeSender::send(const std::vector &lines, bool priority) -{ - // append lines to queue - { - boost::lock_guard l(this->queue_mutex); - for (std::vector::const_iterator line = lines.begin(); line != lines.end(); ++line) { - if (priority) { - this->priqueue.push_back(*line); - } else { - this->queue.push(*line); - } - } - } - this->send(); -} - -void -GCodeSender::send(const std::string &line, bool priority) -{ - // append line to queue - { - boost::lock_guard l(this->queue_mutex); - if (priority) { - this->priqueue.push_back(line); - } else { - this->queue.push(line); - } - } - this->send(); -} - -void -GCodeSender::send() -{ - this->io.post(boost::bind(&GCodeSender::do_send, this)); -} - -void -GCodeSender::do_send() -{ - boost::lock_guard l(this->queue_mutex); - - // printer is not connected or we're still waiting for the previous ack - if (!this->can_send) return; - - std::string line; - while (!this->priqueue.empty() || (!this->queue.empty() && !this->queue_paused)) { - if (!this->priqueue.empty()) { - line = this->priqueue.front(); - this->priqueue.pop_front(); - } else { - line = this->queue.front(); - this->queue.pop(); - } - - // strip comments - size_t comment_pos = line.find_first_of(';'); - if (comment_pos != std::string::npos) - line.erase(comment_pos, std::string::npos); - boost::algorithm::trim(line); - - // if line is not empty, send it - if (!line.empty()) break; - // if line is empty, process next item in queue - } - if (line.empty()) return; - - // compute full line - ++ this->sent; -#ifndef DEBUG_SERIAL - const auto line_num = this->sent; -#else - // In DEBUG_SERIAL mode, test line re-synchronization by sending bad line number 1/4 of the time - const auto line_num = std::rand() < RAND_MAX/4 ? 0 : this->sent; -#endif - std::string full_line = "N" + boost::lexical_cast(line_num) + " " + line; - - // calculate checksum - int cs = 0; - for (std::string::const_iterator it = full_line.begin(); it != full_line.end(); ++it) - cs = cs ^ *it; - - // write line to device - full_line += "*"; - full_line += boost::lexical_cast(cs); - full_line += "\n"; - -#ifdef DEBUG_SERIAL - fs << ">> " << full_line << std::flush; -#endif - - this->last_sent.push_back(line); - this->can_send = false; - - while (this->last_sent.size() > KEEP_SENT) { - this->last_sent.pop_front(); - } - - // we can't supply boost::asio::buffer(full_line) to async_write() because full_line is on the - // stack and the buffer would lose its underlying storage causing memory corruption - std::ostream os(&this->write_buffer); - os << full_line; - boost::asio::async_write(this->serial, this->write_buffer, boost::bind(&GCodeSender::on_write, this, boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); -} - -void -GCodeSender::on_write(const boost::system::error_code& error, - size_t bytes_transferred) -{ - this->set_error_status(false); - if (error) { - if (this->open) { - this->do_close(); - this->set_error_status(true); - } - return; - } - - this->do_send(); -} - -void -GCodeSender::set_DTR(bool on) -{ -#if defined(_WIN32) && !defined(__SYMBIAN32__) - boost::asio::serial_port_service::native_handle_type handle = this->serial.native_handle(); - if (on) - EscapeCommFunction(handle, SETDTR); - else - EscapeCommFunction(handle, CLRDTR); -#else - int fd = this->serial.native_handle(); - int status; - ioctl(fd, TIOCMGET, &status); - if (on) - status |= TIOCM_DTR; - else - status &= ~TIOCM_DTR; - ioctl(fd, TIOCMSET, &status); -#endif -} - -void -GCodeSender::reset() -{ - set_DTR(false); - std::this_thread::sleep_for(std::chrono::milliseconds(200)); - set_DTR(true); - std::this_thread::sleep_for(std::chrono::milliseconds(200)); - set_DTR(false); - std::this_thread::sleep_for(std::chrono::milliseconds(500)); -} - -} // namespace Slic3r diff --git a/src/libslic3r/GCodeSender.hpp b/src/libslic3r/GCodeSender.hpp deleted file mode 100644 index e9f97e2a29..0000000000 --- a/src/libslic3r/GCodeSender.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef slic3r_GCodeSender_hpp_ -#define slic3r_GCodeSender_hpp_ - -#include "libslic3r.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Slic3r { - -namespace asio = boost::asio; - -class GCodeSender : private boost::noncopyable { - public: - GCodeSender(); - ~GCodeSender(); - bool connect(std::string devname, unsigned int baud_rate); - void send(const std::vector &lines, bool priority = false); - void send(const std::string &s, bool priority = false); - void disconnect(); - bool error_status() const; - bool is_connected() const; - bool wait_connected(unsigned int timeout = 3) const; - size_t queue_size() const; - void pause_queue(); - void resume_queue(); - void purge_queue(bool priority = false); - std::vector purge_log(); - std::string getT() const; - std::string getB() const; - void set_DTR(bool on); - void reset(); - - private: - asio::io_service io; - asio::serial_port serial; - boost::thread background_thread; - boost::asio::streambuf read_buffer, write_buffer; - bool open; // whether the serial socket is connected - bool connected; // whether the printer is online - bool error; - mutable boost::mutex error_mutex; - - // this mutex guards queue, priqueue, can_send, queue_paused, sent, last_sent - mutable boost::mutex queue_mutex; - std::queue queue; - std::list priqueue; - bool can_send; - bool queue_paused; - size_t sent; - std::deque last_sent; - - // this mutex guards log, T, B - mutable boost::mutex log_mutex; - std::queue log; - std::string T, B; - - void set_baud_rate(unsigned int baud_rate); - void set_error_status(bool e); - void do_send(); - void on_write(const boost::system::error_code& error, size_t bytes_transferred); - void do_close(); - void do_read(); - void on_read(const boost::system::error_code& error, size_t bytes_transferred); - void send(); -}; - -} // namespace Slic3r - -#endif /* slic3r_GCodeSender_hpp_ */ diff --git a/src/libslic3r/Geometry/Circle.hpp b/src/libslic3r/Geometry/Circle.hpp index 8f8655df65..aee93efa83 100644 --- a/src/libslic3r/Geometry/Circle.hpp +++ b/src/libslic3r/Geometry/Circle.hpp @@ -94,8 +94,6 @@ struct Circle { using Circlef = Circle; using Circled = Circle; -using CircleSqf = CircleSq; -using CircleSqd = CircleSq; /// Find the center of the circle corresponding to the vector of Points as an arc. Point circle_center_taubin_newton(const Points::const_iterator& input_start, const Points::const_iterator& input_end, size_t cycles = 20); diff --git a/src/libslic3r/Geometry/MedialAxis.cpp b/src/libslic3r/Geometry/MedialAxis.cpp index 9d05ec9867..6fa22eb336 100644 --- a/src/libslic3r/Geometry/MedialAxis.cpp +++ b/src/libslic3r/Geometry/MedialAxis.cpp @@ -1,7 +1,6 @@ #include #include "MedialAxis.hpp" -#include #include #include #include diff --git a/src/libslic3r/Layer.hpp b/src/libslic3r/Layer.hpp index 3bc25a0363..74df3e370c 100644 --- a/src/libslic3r/Layer.hpp +++ b/src/libslic3r/Layer.hpp @@ -33,7 +33,7 @@ class PrintObject; class Print; namespace FillAdaptive { - struct Octree; + struct Octrees; }; namespace FillLightning { @@ -170,10 +170,10 @@ public: ExPolygons lslices; ExPolygons lslices_extrudable; // BBS: the extrudable part of lslices used for tree support std::vector lslices_bboxes; - // Orca: for separated infills / per-model centering. Aligned with lslices: for each island, the - // full bounding box of the 3D connected body (across all layers) it belongs to. Populated by - // PrintObject::infill() only when the feature is used; empty otherwise. - std::vector lslices_separated_component_bboxes; + // Orca: for separated infills / per-model centering / octree infills. Aligned with lslices: for each + // island, the 3D connected body (across all layers) it belongs to, indexing + // PrintObject::separated_body_bboxes(). Populated by PrintObject::prepare_infill() only when needed. + std::vector lslices_separated_component_ids; // BBS ExPolygons loverhangs; @@ -208,9 +208,9 @@ public: void make_perimeters(); // Phony version of make_fills() without parameters for Perl integration only. void make_fills() { this->make_fills(nullptr, nullptr); } - void make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree, FillLightning::Generator* lightning_generator = nullptr); - Polylines generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Octree *adaptive_fill_octree, - FillAdaptive::Octree *support_fill_octree, + void make_fills(const FillAdaptive::Octrees* adaptive_fill_octrees, const FillAdaptive::Octrees* support_fill_octrees, FillLightning::Generator* lightning_generator = nullptr); + Polylines generate_sparse_infill_polylines_for_anchoring(const FillAdaptive::Octrees *adaptive_fill_octrees, + const FillAdaptive::Octrees *support_fill_octrees, FillLightning::Generator* lightning_generator) const; void make_ironing(); // Returns the filament id (1-based) the region is ironed with, or -1 when the diff --git a/src/libslic3r/LayerRegion.cpp b/src/libslic3r/LayerRegion.cpp index 340f9a590d..c20cebc641 100644 --- a/src/libslic3r/LayerRegion.cpp +++ b/src/libslic3r/LayerRegion.cpp @@ -62,7 +62,7 @@ Flow LayerRegion::bridging_flow(FlowRole role, bool thick_bridge) const const PrintObject &print_object = *this->layer()->object(); Flow bridge_flow; // Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will fall back to zero'th element, so everything is all right. - auto nozzle_diameter = float(print_object.print()->config().nozzle_diameter.get_at(region.extruder(role) - 1)); + auto nozzle_diameter = float(nozzle_diameter_for_filament(print_object.print()->config(), region.extruder(role), print_object.print()->is_BBL_printer())); const ConfigOptionFloatOrPercent& bridge_width_opt = region_config.bridge_line_width; const double bridge_width = bridge_width_opt.get_abs_value(nozzle_diameter); const bool has_bridge_width = bridge_width > 0.; diff --git a/src/libslic3r/MarchingSquares.hpp b/src/libslic3r/MarchingSquares.hpp index e123dd14e0..73b8f9bd23 100644 --- a/src/libslic3r/MarchingSquares.hpp +++ b/src/libslic3r/MarchingSquares.hpp @@ -154,13 +154,12 @@ template struct _Loop }; // Add Specialization for using ExecutionTBB for parallel loops. -using namespace Slic3r; -template<> struct _Loop +template<> struct _Loop { template static void for_each_idx(It from, It to, Fn&& fn) { - execution::for_each( - ex_tbb, size_t(0), size_t(to - from), [&from, &fn](size_t i) { fn(from[i], i); }, execution::max_concurrency(ex_tbb)); + Slic3r::execution::for_each( + Slic3r::ex_tbb, size_t(0), size_t(to - from), [&from, &fn](size_t i) { fn(from[i], i); }, Slic3r::execution::max_concurrency(Slic3r::ex_tbb)); } }; diff --git a/src/libslic3r/MeshBoolean.cpp b/src/libslic3r/MeshBoolean.cpp index 8f30b356d1..44d54be99d 100644 --- a/src/libslic3r/MeshBoolean.cpp +++ b/src/libslic3r/MeshBoolean.cpp @@ -58,7 +58,7 @@ #include #include // For parameterize_lscm() -#include +#include #include #include #include @@ -145,7 +145,7 @@ void self_union(TriangleMesh& mesh) namespace cgal { namespace CGALProc = CGAL::Polygon_mesh_processing; -namespace CGALParams = CGAL::Polygon_mesh_processing::parameters; +namespace CGALParams = CGAL::parameters; using EpecKernel = CGAL::Exact_predicates_exact_constructions_kernel; using EpicKernel = CGAL::Exact_predicates_inexact_constructions_kernel; @@ -515,7 +515,7 @@ void segment(CGALMesh& src, std::vector& dst, double smoothing_alpha = typedef boost::graph_traits<_EpicMesh>::halfedge_descriptor halfedge_descriptor; typedef boost::graph_traits<_EpicMesh>::vertex_descriptor vertex_descriptor; std::vector border_cycles; - CGAL::Polygon_mesh_processing::extract_boundary_cycles(out, std::back_inserter(border_cycles)); + CGAL::extract_boundary_cycles(out, std::back_inserter(border_cycles)); for (halfedge_descriptor h : border_cycles) { std::vector patch_facets; @@ -705,7 +705,7 @@ bool repair(TriangleMesh& mesh, RepairedMeshErrors* repaired_errors, std::string using halfedge_descriptor = boost::graph_traits<_EpicMesh>::halfedge_descriptor; std::vector borders; - PMP::extract_boundary_cycles(cgal_mesh, std::back_inserter(borders)); + CGAL::extract_boundary_cycles(cgal_mesh, std::back_inserter(borders)); for (halfedge_descriptor h : borders) { PMP::triangulate_and_refine_hole(cgal_mesh, h); diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 39993895b0..6cca66e44b 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -22,7 +22,6 @@ #include "Format/AssimpImport.hpp" #include "ClipperUtils.hpp" #include "Exception.hpp" -#include "Model.hpp" #include "ModelArrange.hpp" #include "Arrange.hpp" #include "Geometry.hpp" @@ -1697,6 +1696,9 @@ indexed_triangle_set ModelObject::raw_indexed_triangle_set() const size_t j = out.indices.size(); append(out.vertices, v->mesh().its.vertices); append(out.indices, v->mesh().its.indices); + // Orca: Point the volume's triangles at its own vertices, which follow those of the volumes before it. + for (size_t k = j; k < out.indices.size(); ++ k) + out.indices[k] += stl_triangle_vertex_indices::Constant(int(i)); const Transform3d& m = v->get_matrix(); for (; i < out.vertices.size(); ++ i) out.vertices[i] = (m * out.vertices[i].cast()).cast().eval(); diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index 9c6967371c..4bb1794b46 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -18,7 +18,6 @@ #include "TriangleMesh.hpp" #include "CustomGCode.hpp" #include "calib.hpp" -#include "enum_bitmask.hpp" #include "TextConfiguration.hpp" #include "EmbossShape.hpp" #include "TriangleSelector.hpp" diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index b1fad347f1..ae8aec1bd3 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -2806,19 +2806,13 @@ std::pair PresetBundle::load_system_mod boost::filesystem::path dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred(); PresetsConfigSubstitutions substitutions; std::string errors_cummulative; - for (auto &dir_entry : boost::filesystem::directory_iterator(dir)) { - std::string vendor_file = dir_entry.path().string(); - if (Slic3r::is_json_file(vendor_file)) { - std::string vendor_name = dir_entry.path().filename().string(); - // Remove the .json suffix. - vendor_name.erase(vendor_name.size() - 5); - try { - // Load the config bundle, flatten it. - append(substitutions, load_vendor_configs_from_json(dir.string(), vendor_name, PresetBundle::LoadVendorOnly, compatibility_rule).first); - } catch (const std::runtime_error &err) { - errors_cummulative += err.what(); - errors_cummulative += "\n"; - } + for (const std::string &vendor_name : vendor_names_in(dir)) { + try { + // Load the config bundle, flatten it. + append(substitutions, load_vendor_configs_from_json(dir.string(), vendor_name, PresetBundle::LoadVendorOnly, compatibility_rule).first); + } catch (const std::runtime_error &err) { + errors_cummulative += err.what(); + errors_cummulative += "\n"; } } @@ -2841,35 +2835,33 @@ std::pair PresetBundle::load_system_fil PresetsConfigSubstitutions substitutions; std::string errors_cummulative; bool first = true; - for (auto &dir_entry : boost::filesystem::directory_iterator(dir)) { - std::string vendor_file = dir_entry.path().string(); - if (Slic3r::is_json_file(vendor_file)) { - std::string vendor_name = dir_entry.path().filename().string(); - // Remove the .json suffix. - vendor_name.erase(vendor_name.size() - 5); - try { - if (first) { - // Reset this PresetBundle and load the first vendor config. - append(substitutions, this->load_vendor_configs_from_json(dir.string(), vendor_name, PresetBundle::LoadSystem | PresetBundle::LoadFilamentOnly, compatibility_rule).first); - first = false; - } else { - // Load the other vendor configs, merge them with this PresetBundle. - // Report duplicate profiles. - PresetBundle other; - append(substitutions, other.load_vendor_configs_from_json(dir.string(), vendor_name, PresetBundle::LoadSystem | PresetBundle::LoadFilamentOnly, compatibility_rule).first); - std::vector duplicates = std::move(this->merge_presets({ &other }).front()); - if (!duplicates.empty()) { - errors_cummulative += "Found duplicated settings in vendor " + vendor_name + "'s json file lists: "; - for (size_t i = 0; i < duplicates.size(); ++i) { - if (i > 0) errors_cummulative += ", "; - errors_cummulative += duplicates[i]; - } + // The filament library loads first, so the filaments that inherit its bases resolve. + std::vector vendor_names; + for (const std::string &vendor_name : vendor_names_in(dir)) + vendor_names.insert(vendor_name == ORCA_FILAMENT_LIBRARY ? vendor_names.begin() : vendor_names.end(), vendor_name); + for (const std::string &vendor_name : vendor_names) { + try { + if (first) { + // Reset this PresetBundle and load the first vendor config. + append(substitutions, this->load_vendor_configs_from_json(dir.string(), vendor_name, PresetBundle::LoadSystem | PresetBundle::LoadFilamentOnly, compatibility_rule).first); + first = false; + } else { + // Load the other vendor configs, merge them with this PresetBundle. + // Report duplicate profiles. + PresetBundle other; + append(substitutions, other.load_vendor_configs_from_json(dir.string(), vendor_name, PresetBundle::LoadSystem | PresetBundle::LoadFilamentOnly, compatibility_rule, this).first); + std::vector duplicates = std::move(this->merge_presets({ &other }).front()); + if (!duplicates.empty()) { + errors_cummulative += "Found duplicated settings in vendor " + vendor_name + "'s json file lists: "; + for (size_t i = 0; i < duplicates.size(); ++i) { + if (i > 0) errors_cummulative += ", "; + errors_cummulative += duplicates[i]; } } - } catch (const std::runtime_error &err) { - errors_cummulative += err.what(); - errors_cummulative += "\n"; } + } catch (const std::runtime_error &err) { + errors_cummulative += err.what(); + errors_cummulative += "\n"; } } @@ -3601,24 +3593,6 @@ void PresetBundle::export_selections(AppConfig &config) BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": printer %1%, print %2%, filaments[0] %3% ")%printers.get_selected_preset_name() % prints.get_selected_preset_name() %filament_presets[0]; } -// Preserve metadata only for existing colour slots; new slots get false/empty defaults. -static void resize_mixed_filament_metadata(DynamicPrintConfig &config, size_t old_slot_count, size_t new_slot_count) -{ - auto resize = [old_slot_count, new_slot_count](auto *opt) { - if (opt) { - opt->values.resize(std::min(old_slot_count, opt->values.size())); - opt->values.resize(new_slot_count); - } - }; - resize(config.option("filament_is_mixed")); - resize(config.option("filament_mixed_components")); - resize(config.option("filament_mixed_sublayer_ratios")); - resize(config.option("filament_mixed_gradient")); - resize(config.option("filament_mixed_gradient_range")); - resize(config.option("filament_mixed_gradient_curve")); - resize(config.option("filament_mixed_gradient_per_part")); -} - void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) { unsigned old_filament_count = this->filament_presets.size(); @@ -7149,22 +7123,38 @@ PresetBundle::VendorRead PresetBundle::read_vendor(const std::string& dir, const // Reset this bundle, delete user profile files if SaveImported. this->reset(flags.has(LoadConfigBundleAttribute::SaveImported)); - // Orca: only a whole-vendor load has a cache — the vendor-only and filament-only - // scans want a slice of one. Validation reads the JSONs whatever is cached. - read.cacheable = allow_cache && flags.has(LoadConfigBundleAttribute::LoadSystem) && ! flags.has(LoadConfigBundleAttribute::LoadFilamentOnly); - if (read.cacheable && ! validation_mode) { - // A vendor is loaded from where it is installed and nowhere else; resources - // reaches the app by being installed into `dir` first. The cache there is - // judged against the profile beside it — or, where the cache is the whole - // of the installation, against nothing, since nothing on disk can then be + // Orca: only a whole-vendor load writes a cache, and a vendor-only or filament-only + // scan reads one only where it is the whole installation, as in a shipped build. + // Validation reads the JSONs whatever is cached. + const bool vendor_only = flags.has(LoadConfigBundleAttribute::LoadVendorOnly); + const bool filament_only = flags.has(LoadConfigBundleAttribute::LoadFilamentOnly); + read.cacheable = allow_cache && flags.has(LoadConfigBundleAttribute::LoadSystem) && ! filament_only; + const boost::filesystem::path dir_path(dir); + const boost::filesystem::path profile = dir_path / (vendor_name + ".json"); + const bool has_profile = boost::filesystem::exists(profile); + if (allow_cache && ! validation_mode && (read.cacheable || ((vendor_only || filament_only) && ! has_profile))) { + // The cache is judged against the profile beside it, or, where the cache is the + // whole of the installation, against nothing, since nothing on disk can then be // newer than it. That state is Semver::inf(), which no real profile carries. - const boost::filesystem::path dir_path(dir); - const boost::filesystem::path profile = dir_path / (vendor_name + ".json"); - const Semver version = boost::filesystem::exists(profile) ? get_version_from_json(profile.string()) : Semver::inf(); + const Semver version = has_profile ? get_version_from_json(profile.string()) : Semver::inf(); read.cache_path = (dir_path / (vendor_name + ".opc")).string(); - read.from_cache = VendorCacheFile::load(read.cache_path, vendor_name, version, read.data); - if (read.from_cache) + if (vendor_only) { + VendorProfile vendor_profile; + if (VendorCacheFile::load_vendor_profile(read.cache_path, vendor_name, version, vendor_profile)) { + this->vendors.emplace(vendor_name, std::move(vendor_profile)); + read.vendor_only = true; + return read; + } + } else if (VendorCacheFile::load(read.cache_path, vendor_name, version, read.data)) { + read.from_cache = true; + if (filament_only) { + read.data.process_entries.clear(); + read.data.machine_entries.clear(); + // The stamp counts errors across the whole vendor. + read.data.parse_errors = 0; + } return read; + } } this->parse_vendor_json(read); return read; diff --git a/src/libslic3r/PresetCacheFormat.cpp b/src/libslic3r/PresetCacheFormat.cpp index 01e634a581..234981c1c5 100644 --- a/src/libslic3r/PresetCacheFormat.cpp +++ b/src/libslic3r/PresetCacheFormat.cpp @@ -471,9 +471,11 @@ bool VendorCacheFile::save(const std::string& path, const std::string& vendor_na } } -// static -bool VendorCacheFile::load(const std::string& path, const std::string& expected_vendor_name, - const Semver& expected_vendor_version, VendorCacheData& data) +// Reads a cache through its vendor profiles under the checks load() documents, then +// calls read_rest on the archive. +template +static bool read_cache_up_to_presets(const std::string& path, const std::string& expected_vendor_name, + const Semver& expected_vendor_version, VendorMap& vendors, ReadRest&& read_rest) { std::string blob; if (! read_cache_blob(path, blob)) @@ -488,12 +490,9 @@ bool VendorCacheFile::load(const std::string& path, const std::string& expected_ return false; CacheDictionary dict; dict.load(ar); - ar(data.vendors); - load_entries(ar, data.process_entries, dict); - load_entries(ar, data.filament_entries, dict); - load_entries(ar, data.machine_entries, dict); - ar(data.parse_errors); - if (data.vendors.find(expected_vendor_name) == data.vendors.end()) + ar(vendors); + read_rest(ar, dict); + if (vendors.find(expected_vendor_name) == vendors.end()) throw std::runtime_error("vendor cache does not carry its own vendor profile"); return true; } catch (const std::exception& e) { @@ -502,6 +501,31 @@ bool VendorCacheFile::load(const std::string& path, const std::string& expected_ } } +// static +bool VendorCacheFile::load(const std::string& path, const std::string& expected_vendor_name, + const Semver& expected_vendor_version, VendorCacheData& data) +{ + return read_cache_up_to_presets(path, expected_vendor_name, expected_vendor_version, data.vendors, + [&data](cereal::BinaryInputArchive& ar, const CacheDictionary& dict) { + load_entries(ar, data.process_entries, dict); + load_entries(ar, data.filament_entries, dict); + load_entries(ar, data.machine_entries, dict); + ar(data.parse_errors); + }); +} + +// static +bool VendorCacheFile::load_vendor_profile(const std::string& path, const std::string& expected_vendor_name, + const Semver& expected_vendor_version, VendorProfile& vendor) +{ + VendorMap vendors; + if (! read_cache_up_to_presets(path, expected_vendor_name, expected_vendor_version, vendors, + [](cereal::BinaryInputArchive&, const CacheDictionary&) {})) + return false; + vendor = std::move(vendors.find(expected_vendor_name)->second); + return true; +} + // static std::string VendorCacheFile::peek_version(const std::string& path, const std::string& expected_vendor_name) { diff --git a/src/libslic3r/PresetCacheFormat.hpp b/src/libslic3r/PresetCacheFormat.hpp index 261e7ef796..f259f3cb4f 100644 --- a/src/libslic3r/PresetCacheFormat.hpp +++ b/src/libslic3r/PresetCacheFormat.hpp @@ -169,6 +169,11 @@ public: static bool load(const std::string& path, const std::string& expected_vendor_name, const Semver& expected_vendor_version, VendorCacheData& data); + // Read only the vendor's own profile, under the same checks as load(), + // without deserializing its presets. + static bool load_vendor_profile(const std::string& path, const std::string& expected_vendor_name, + const Semver& expected_vendor_version, VendorProfile& vendor); + // Read the profile version a cache was stamped with, without deserializing // its presets. Empty if the file is unreadable, not a cache this build // understands, or not this vendor's. This is how an installed vendor's diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 9f7adaf86d..6d810a922d 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -2407,7 +2407,7 @@ StringObjectException Print::validate(std::vector *warnin for (const PrintRegion ®ion : object->all_regions()) { const auto &bridge_width_opt = region.config().bridge_line_width; for (FlowRole bridge_role : { frPerimeter, frInfill, frSolidInfill, frTopSolidInfill }) { - const double nozzle_diameter = m_config.nozzle_diameter.get_at(region.extruder(bridge_role) - 1); + const double nozzle_diameter = nozzle_diameter_for_filament(m_config, region.extruder(bridge_role), this->is_BBL_printer()); const double bridge_width = bridge_width_opt.get_abs_value(nozzle_diameter); if (bridge_width <= 0.) continue; @@ -2784,7 +2784,7 @@ Flow Print::brim_flow() const frPerimeter, // Flow::new_from_config_width takes care of the percent to value substitution width, - (float)m_config.nozzle_diameter.get_at(m_print_regions.front()->config().outer_wall_filament_id-1), + (float)nozzle_diameter_for_filament(m_config, m_print_regions.front()->config().outer_wall_filament_id, this->is_BBL_printer()), (float)this->skirt_first_layer_height()); } @@ -2801,12 +2801,13 @@ Flow Print::skirt_flow() const extruders and take the one with, say, the smallest index; The same logic should be applied to the code that selects the extruder during G-code generation as well. */ - return Flow::new_from_config_width(frPerimeter, - // Flow::new_from_config_width takes care of the percent to value substitution - width, - (float) m_config.nozzle_diameter.get_at( - m_objects.empty() ? 0 : m_objects.front()->config().support_filament - 1), - (float) this->skirt_first_layer_height()); + return Flow::new_from_config_width( + frPerimeter, + // Flow::new_from_config_width takes care of the percent to value substitution + width, + // ORCA: resolve the actual nozzle the support filament is printed with (dual-nozzle printers). + (float)nozzle_diameter_for_filament(m_config, m_objects.empty() ? 0 : m_objects.front()->config().support_filament, this->is_BBL_printer()), + (float)this->skirt_first_layer_height()); } bool Print::has_support_material() const diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index fae1fcdb0b..f8416fa194 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -380,6 +380,8 @@ public: // Equal to trafo_centered() unless a belt rotation or pre-slice remap is active. Transform3d trafo_sliced() const; const PrintInstances& instances() const { return m_instances; } + // Orca: Bounding box of each connected body, indexed by Layer::lslices_separated_component_ids. + const std::vector& separated_body_bboxes() const { return m_separated_body_bboxes; } PrintInstances &instances() { return m_instances; } // Whoever will get a non-const pointer to PrintObject will be able to modify its layers. @@ -645,8 +647,8 @@ private: void discover_horizontal_shells(); void combine_infill(); void _generate_support_material(); - std::pair prepare_adaptive_infill_data( - const std::vector>& surfaces_w_bottom_z) const; + std::pair prepare_adaptive_infill_data( + const std::vector>& surfaces_w_layer) const; FillLightning::GeneratorPtr prepare_lightning_infill_data(); // BBS @@ -695,7 +697,8 @@ private: // so that next call to make_perimeters() performs a union() before computing loops bool m_typed_slices = false; - std::pair m_adaptive_fill_octrees; + std::pair m_adaptive_fill_octrees; + std::vector m_separated_body_bboxes; FillLightning::GeneratorPtr m_lightning_generator; std::vector < VolumeSlices > firstLayerObjSliceByVolume; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index c95ee6f5ce..e2ef7c410b 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -135,6 +135,15 @@ size_t get_extruder_index(const GCodeConfig& config, unsigned int filament_id) return 0; } +double nozzle_diameter_for_filament(const PrintConfig& config, int filament_id, bool is_bbl_printer) +{ + int extruder = filament_id; + if (is_bbl_printer && config.nozzle_diameter.size() > 1 && + filament_id >= 1 && static_cast(filament_id - 1) < config.filament_map.size()) + extruder = config.filament_map.get_at(filament_id - 1); + return config.nozzle_diameter.get_at(extruder - 1); +} + // Orca: input shaping values types by flavor std::vector get_shaper_type_values_for_flavor(GCodeFlavor flavor) @@ -7827,8 +7836,8 @@ void PrintConfigDef::init_fff_params() "whole assembly. Parts that touch or overlap are treated as one body and share a center; separate parts " "(or distinct 3D objects) each get their own.\n" "Useful when an assembly groups several objects that should each keep a consistent, self-centered infill.\n" - "Affects line and grid patterns and rotation-template infills.\n" - "Patterns locked to global coordinates (Gyroid, Honeycomb, TPMS, ...) are unaffected."); + "Adaptive Cubic and Support Cubic always center each part on itself, and Lightning infill is generated for " + "the whole object and is unaffected."); def->mode = comExpert; def->set_default_value(new ConfigOptionBool(false)); @@ -11087,6 +11096,21 @@ void set_filament_dev_options(DynamicPrintConfig &config, const std::vectorvalues.resize(std::min(old_slot_count, opt->values.size())); + opt->values.resize(new_slot_count); + }; + resize(config.option("filament_is_mixed", true)); + resize(config.option("filament_mixed_components", true)); + resize(config.option("filament_mixed_sublayer_ratios", true)); + resize(config.option("filament_mixed_gradient", true)); + resize(config.option("filament_mixed_gradient_range", true)); + resize(config.option("filament_mixed_gradient_curve", true)); + resize(config.option("filament_mixed_gradient_per_part", true)); +} + //used for object/region config //use the smallest of multiple to single diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 133d854a61..7c9633ff78 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -136,25 +136,31 @@ enum InfillPattern : int { ipCount, }; -// Orca: Infill patterns whose alignment origin follows the fill bounding box, so the -// "separated_infills" option can re-center them per connected body. Patterns evaluated in -// absolute/global coordinates (Gyroid, TPMS, Honeycomb, CrossHatch, ...) or that are shape-relative -// (Concentric) ignore that bounding box and are therefore excluded. +// Orca: Infill patterns that the "separated_infills" option can center on each connected body. inline bool is_separable_infill_pattern(InfillPattern pattern) { switch (pattern) { + case ipMonotonic: + case ipMonotonicLine: case ipRectilinear: case ipAlignedRectilinear: case ipZigZag: case ipCrossZag: case ipLockedZag: + case ipLine: case ipGrid: case ipTriangles: case ipStars: // tri-hexagon case ipCubic: case ipQuarterCubic: + case ipHoneycomb: + case ip3DHoneycomb: case ipLateralHoneycomb: case ipLateralLattice: + case ipCrossHatch: + case ipTpmsD: + case ipTpmsFK: + case ipGyroid: case ipHilbertCurve: case ipArchimedeanChords: case ipOctagramSpiral: @@ -164,6 +170,9 @@ inline bool is_separable_infill_pattern(InfillPattern pattern) } } +// Orca: Infill patterns laid out by an octree, which each connected body always gets of its own. +inline bool is_octree_infill_pattern(InfillPattern pattern) { return pattern == ipAdaptiveCubic || pattern == ipSupportCubic; } + // Orca: Infill patterns that round their corners by the "sparse_infill_smooth_factor" option. // Grid, Triangles and Tri-hexagon only do so in their trapezoidal form, which is generated with more // than one line per infill wall; a single line makes them plain crossing lines with nothing to round. @@ -958,6 +967,10 @@ extern std::set filament_dev_options; // filament_configs, one config per filament in slot order, as the filaments' values one after another. void set_filament_dev_options(DynamicPrintConfig &config, const std::vector &filament_configs); +// Orca: sizes the per-slot mixed-colour metadata options to new_slot_count, keeping the first +// old_slot_count values; an option the config lacks is created. +void resize_mixed_filament_metadata(DynamicPrintConfig &config, size_t old_slot_count, size_t new_slot_count); + extern void update_static_print_config_from_dynamic(ConfigBase& config, const DynamicPrintConfig& dest_config, std::vector variant_index, std::set& key_set1, int stride = 1); extern void compute_filament_override_value(const std::string& opt_key, const ConfigOption *opt_old_machine, const ConfigOption *opt_new_machine, const ConfigOption *opt_new_filament, const DynamicPrintConfig& new_full_config, t_config_option_keys& diff_keys, DynamicPrintConfig& filament_overrides, std::vector& f_map_indices); @@ -2619,6 +2632,8 @@ static bool has_zero_flush_volume_for_used_filaments(const std::vector &fv_ma size_t get_extruder_index(const GCodeConfig& config, unsigned int filament_id); +double nozzle_diameter_for_filament(const PrintConfig& config, int filament_id, bool is_bbl_printer); + } // namespace Slic3r // Serialization through the Cereal library diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index c2abb5466a..ae5517a04a 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -70,6 +70,7 @@ #include #include +#include #include #include @@ -723,7 +724,8 @@ void PrintObject::prepare_infill() bool needs_separated_components = false; for (size_t i = 0; i < this->num_printing_regions(); ++ i) { const PrintRegionConfig &rc = this->printing_region(i).config(); - if (rc.separated_infills || rc.center_of_surface_pattern == CenterOfSurfacePattern::Each_Model) { + if (rc.separated_infills || rc.center_of_surface_pattern == CenterOfSurfacePattern::Each_Model || + (rc.sparse_infill_density > 0 && is_octree_infill_pattern(rc.sparse_infill_pattern))) { needs_separated_components = true; break; } @@ -740,8 +742,9 @@ void PrintObject::prepare_infill() if (parts <= 1 && ! (first_part != nullptr && first_part->is_splittable())) needs_separated_components = false; } + m_separated_body_bboxes.clear(); for (Layer *layer : m_layers) - layer->lslices_separated_component_bboxes.clear(); + layer->lslices_separated_component_ids.clear(); if (needs_separated_components) { const size_t nl = m_layers.size(); std::vector offset(nl + 1, 0); // Orca: flat index of the first island of each layer @@ -792,17 +795,20 @@ void PrintObject::prepare_infill() }); } } - // Orca: Full bounding box of each body, indexed by its union-find root. - std::vector body_bbox(nreg); - for (size_t i = 0; i < nl; ++ i) - for (size_t a = 0; a < m_layers[i]->lslices.size(); ++ a) - body_bbox[find(offset[i] + a)].merge(m_layers[i]->lslices_bboxes[a]); - // Orca: Store the body bbox for every island. + // Orca: Number the bodies by their first island and merge the bounding boxes of their islands. + std::vector body_of_root(nreg, size_t(-1)); for (size_t i = 0; i < nl; ++ i) { Layer *layer = m_layers[i]; - layer->lslices_separated_component_bboxes.resize(layer->lslices.size()); - for (size_t a = 0; a < layer->lslices.size(); ++ a) - layer->lslices_separated_component_bboxes[a] = body_bbox[find(offset[i] + a)]; + layer->lslices_separated_component_ids.resize(layer->lslices.size()); + for (size_t a = 0; a < layer->lslices.size(); ++ a) { + size_t &body = body_of_root[find(offset[i] + a)]; + if (body == size_t(-1)) { + body = m_separated_body_bboxes.size(); + m_separated_body_bboxes.emplace_back(); + } + m_separated_body_bboxes[body].merge(layer->lslices_bboxes[a]); + layer->lslices_separated_component_ids[a] = body; + } } } @@ -840,16 +846,13 @@ void PrintObject::infill() if (this->set_started(posInfill)) { m_print->set_status(35, L("Generating infill toolpath")); - const auto& adaptive_fill_octree = this->m_adaptive_fill_octrees.first; - const auto& support_fill_octree = this->m_adaptive_fill_octrees.second; - BOOST_LOG_TRIVIAL(debug) << "Filling layers in parallel - start"; tbb::parallel_for( tbb::blocked_range(0, m_layers.size()), - [this, &adaptive_fill_octree = adaptive_fill_octree, &support_fill_octree = support_fill_octree](const tbb::blocked_range& range) { + [this](const tbb::blocked_range& range) { for (size_t layer_idx = range.begin(); layer_idx < range.end(); ++ layer_idx) { m_print->throw_if_canceled(); - m_layers[layer_idx]->make_fills(adaptive_fill_octree.get(), support_fill_octree.get(), this->m_lightning_generator.get()); + m_layers[layer_idx]->make_fills(&m_adaptive_fill_octrees.first, &m_adaptive_fill_octrees.second, this->m_lightning_generator.get()); } } ); @@ -1134,14 +1137,69 @@ void PrintObject::simplify_extrusion_path() } } -std::pair PrintObject::prepare_adaptive_infill_data( - const std::vector> &surfaces_w_bottom_z) const +// Orca: Separated body of the island containing a point of a layer, else of the island outline nearest within 1 mm, or -1. +static int separated_body_at(const Layer &layer, const Point &point) +{ + int body = -1; + double best = scaled(1.); + for (size_t i = 0; i < layer.lslices.size() && i < layer.lslices_separated_component_ids.size() && best > 0.; ++ i) { + BoundingBox bbox = layer.lslices_bboxes[i]; + bbox.offset(coord_t(best)); + if (! bbox.contains(point)) + continue; + const double dist = layer.lslices[i].contains(point) ? 0. : (layer.lslices[i].point_projection(point) - point).cast().norm(); + if (dist < best) { + best = dist; + body = int(layer.lslices_separated_component_ids[i]); + } + } + return body; +} + +// Orca: The object mesh in the octree frame split by separated body. Each connected component goes to the body +// most of its sampled triangles lie on, sampled a layer height inside the solid at the layer nearest to them. +static std::vector split_mesh_by_body(const PrintObject &object, const indexed_triangle_set &mesh, size_t num_bodies) +{ + const Eigen::Matrix3d to_object = FillAdaptive::transform_to_world().toRotationMatrix(); + const double inset = object.config().layer_height.value; + std::vector bodies(num_bodies); + for (const indexed_triangle_set &component : its_split(mesh)) { + std::vector votes(num_bodies, 0); + const size_t step = std::max(1, component.indices.size() / 8); + for (size_t i = 0; i < component.indices.size(); i += step) { + const stl_triangle_vertex_indices &tri = component.indices[i]; + const Vec3d a = component.vertices[tri[0]].cast(), b = component.vertices[tri[1]].cast(), + d = component.vertices[tri[2]].cast(); + const Vec3d normal = (b - a).cross(d - a); + const double area2 = normal.norm(); + const Vec3d c = to_object * ((a + b + d) / 3. - (area2 > 0. ? Vec3d(normal * (inset / area2)) : Vec3d::Zero())); + size_t lo = 0, hi = object.layer_count(); + while (lo < hi) { + const size_t mid = (lo + hi) / 2; + if (object.get_layer(int(mid))->slice_z < c.z()) + lo = mid + 1; + else + hi = mid; + } + if (lo == object.layer_count() || (lo > 0 && c.z() - object.get_layer(int(lo) - 1)->slice_z < object.get_layer(int(lo))->slice_z - c.z())) + -- lo; + if (const int body = separated_body_at(*object.get_layer(int(lo)), Point(scaled(c.x()), scaled(c.y()))); body >= 0) + ++ votes[body]; + } + if (const auto best = std::max_element(votes.begin(), votes.end()); *best > 0) + its_merge(bodies[best - votes.begin()], component); + } + return bodies; +} + +std::pair PrintObject::prepare_adaptive_infill_data( + const std::vector> &surfaces_w_layer) const { using namespace FillAdaptive; auto [adaptive_line_spacing, support_line_spacing] = adaptive_fill_line_spacing(*this); if ((adaptive_line_spacing == 0. && support_line_spacing == 0.) || this->layers().empty()) - return std::make_pair(OctreePtr(), OctreePtr()); + return {}; indexed_triangle_set mesh = this->model_object()->raw_indexed_triangle_set(); // Rotate mesh and build octree on it with axis-aligned (standart base) cubes. @@ -1152,27 +1210,60 @@ std::pair PrintObject::prepare its_transform(mesh, to_octree * object_trafo, true); // Triangulate internal bridging surfaces. - std::vector> overhangs(std::max(surfaces_w_bottom_z.size(), size_t(1))); + std::vector> overhangs(std::max(surfaces_w_layer.size(), size_t(1))); // ^ make sure vector is not empty, even with no briding surfaces we still want to build the adaptive trees later, some continue normally - tbb::parallel_for(tbb::blocked_range(0, surfaces_w_bottom_z.size()), - [this, &to_octree, &overhangs, &surfaces_w_bottom_z](const tbb::blocked_range &range) { + tbb::parallel_for(tbb::blocked_range(0, surfaces_w_layer.size()), + [this, &to_octree, &overhangs, &surfaces_w_layer](const tbb::blocked_range &range) { PRINT_OBJECT_TIME_LIMIT_MILLIS(PRINT_OBJECT_TIME_LIMIT_DEFAULT); for (int surface_idx = range.begin(); surface_idx < range.end(); ++surface_idx) { std::vector &out = overhangs[surface_idx]; m_print->throw_if_canceled(); - append(out, triangulate_expolygon_3d(surfaces_w_bottom_z[surface_idx].first->expolygon, - surfaces_w_bottom_z[surface_idx].second)); + append(out, triangulate_expolygon_3d(surfaces_w_layer[surface_idx].first->expolygon, + float(surfaces_w_layer[surface_idx].second->bottom_z()))); for (Vec3d &p : out) p = (to_octree * p).eval(); } }); + + // Orca: Each body gets the octree it has when sliced on its own, from its own triangles. + std::pair octrees; + const size_t num_bodies = m_separated_body_bboxes.size(); + bool need_object = num_bodies <= 1; + if (num_bodies > 1) { + const std::vector body_meshes = split_mesh_by_body(*this, mesh, num_bodies); + need_object = std::any_of(body_meshes.begin(), body_meshes.end(), [](const indexed_triangle_set &its) { return its.indices.empty(); }); + std::vector> body_overhangs(num_bodies); + for (size_t i = 0; i < surfaces_w_layer.size(); ++ i) + if (const int body = separated_body_at(*surfaces_w_layer[i].second, surfaces_w_layer[i].first->expolygon.contour.points.front()); body >= 0) + append(body_overhangs[body], overhangs[i]); + if (adaptive_line_spacing) + octrees.first.bodies.resize(num_bodies); + if (support_line_spacing) + octrees.second.bodies.resize(num_bodies); + tbb::parallel_for(tbb::blocked_range(0, num_bodies), [&, adaptive_spacing = adaptive_line_spacing, support_spacing = support_line_spacing]( + const tbb::blocked_range &range) { + for (size_t body = range.begin(); body < range.end(); ++ body) { + m_print->throw_if_canceled(); + if (body_meshes[body].indices.empty()) + continue; + if (adaptive_spacing) + octrees.first.bodies[body] = build_octree(body_meshes[body], body_overhangs[body], adaptive_spacing, false); + if (support_spacing) + octrees.second.bodies[body] = build_octree(body_meshes[body], body_overhangs[body], support_spacing, true); + } + }); + } + // and gather them. for (size_t i = 1; i < overhangs.size(); ++ i) append(overhangs.front(), std::move(overhangs[i])); - return std::make_pair( - adaptive_line_spacing ? build_octree(mesh, overhangs.front(), adaptive_line_spacing, false) : OctreePtr(), - support_line_spacing ? build_octree(mesh, overhangs.front(), support_line_spacing, true) : OctreePtr()); + // Orca: The object's octree only serves bodies that have none of their own. + if (need_object && adaptive_line_spacing) + octrees.first.object = build_octree(mesh, overhangs.front(), adaptive_line_spacing, false); + if (need_object && support_line_spacing) + octrees.second.object = build_octree(mesh, overhangs.front(), support_line_spacing, true); + return octrees; } FillLightning::GeneratorPtr PrintObject::prepare_lightning_infill_data() @@ -3089,14 +3180,14 @@ void PrintObject::bridge_over_infill() std::map infill_lines; // SECTION to generate infill polylines { - std::vector> surfaces_w_bottom_z; + std::vector> surfaces_w_layer; for (const auto &pair : surfaces_by_layer) { for (const CandidateSurface &c : pair.second) { - surfaces_w_bottom_z.emplace_back(c.original_surface, c.region->m_layer->bottom_z()); + surfaces_w_layer.emplace_back(c.original_surface, c.region->m_layer); } } - this->m_adaptive_fill_octrees = this->prepare_adaptive_infill_data(surfaces_w_bottom_z); + this->m_adaptive_fill_octrees = this->prepare_adaptive_infill_data(surfaces_w_layer); std::vector layers_to_generate_infill; for (const auto &pair : surfaces_by_layer) { @@ -3112,8 +3203,8 @@ void PrintObject::bridge_over_infill() for (size_t job_idx = r.begin(); job_idx < r.end(); job_idx++) { size_t lidx = layers_to_generate_infill[job_idx]; infill_lines.at( - lidx) = po->get_layer(lidx)->generate_sparse_infill_polylines_for_anchoring(po->m_adaptive_fill_octrees.first.get(), - po->m_adaptive_fill_octrees.second.get(), + lidx) = po->get_layer(lidx)->generate_sparse_infill_polylines_for_anchoring(&po->m_adaptive_fill_octrees.first, + &po->m_adaptive_fill_octrees.second, po->m_lightning_generator.get()); } }); @@ -4640,8 +4731,8 @@ void PrintObject::combine_infill() // Limit the number of combined layers to the maximum height allowed by this regions' nozzle. //FIXME limit the layer height to max_layer_height double nozzle_diameter = std::min( - this->print()->config().nozzle_diameter.get_at(region.config().sparse_infill_filament_id.value - 1), - this->print()->config().nozzle_diameter.get_at(region.config().internal_solid_filament_id.value - 1)); + nozzle_diameter_for_filament(this->print()->config(), region.config().sparse_infill_filament_id.value, this->print()->is_BBL_printer()), + nozzle_diameter_for_filament(this->print()->config(), region.config().internal_solid_filament_id.value, this->print()->is_BBL_printer())); //Orca: Limit combination of infill to up to infill_combination_max_layer_height const double infill_combination_max_layer_height = region.config().infill_combination_max_layer_height.get_abs_value(nozzle_diameter); diff --git a/src/libslic3r/PrintRegion.cpp b/src/libslic3r/PrintRegion.cpp index 52018223ca..e1a9797f01 100644 --- a/src/libslic3r/PrintRegion.cpp +++ b/src/libslic3r/PrintRegion.cpp @@ -57,7 +57,7 @@ Flow PrintRegion::flow(const PrintObject &object, FlowRole role, double layer_he // Get the configured nozzle_diameter for the extruder associated to the flow role requested. // Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will follback to zero'th element, so everything is all right. - auto nozzle_diameter = float(print_config.nozzle_diameter.get_at(this->extruder(role) - 1)); + auto nozzle_diameter = float(nozzle_diameter_for_filament(print_config, this->extruder(role), object.print()->is_BBL_printer())); return Flow::new_from_config_width(role, config_width, nozzle_diameter, float(layer_height)); } diff --git a/src/libslic3r/SLA/AGGRaster.hpp b/src/libslic3r/SLA/AGGRaster.hpp index 52c95eae5b..4651454dde 100644 --- a/src/libslic3r/SLA/AGGRaster.hpp +++ b/src/libslic3r/SLA/AGGRaster.hpp @@ -49,7 +49,6 @@ public: using TColor = typename PixelRenderer::color_type; using TValue = typename TColor::value_type; using TPixel = typename PixelRenderer::pixel_type; - using TRawBuffer = agg::rendering_buffer; protected: diff --git a/src/libslic3r/Shape/TextShape.cpp b/src/libslic3r/Shape/TextShape.cpp index dd7ca3f119..15d6744f45 100644 --- a/src/libslic3r/Shape/TextShape.cpp +++ b/src/libslic3r/Shape/TextShape.cpp @@ -44,7 +44,6 @@ #include "TDataStd_Name.hxx" #include "BRepBuilderAPI_Transform.hxx" #include "TopExp_Explorer.hxx" -#include "TopExp_Explorer.hxx" #include "BRep_Tool.hxx" #include "Font_BRepFont.hxx" #include "Font_BRepTextBuilder.hxx" diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index 17dc858262..813acecec4 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -2237,7 +2237,7 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::top_contact_layers( // check if the sharp tails should be extended higher bool detect_first_sharp_tail_only = false; - const coordf_t extrusion_width = m_object_config->line_width.get_abs_value(object.print()->config().nozzle_diameter.get_at(object.config().support_interface_filament-1)); + const coordf_t extrusion_width = m_object_config->line_width.get_abs_value(nozzle_diameter_for_filament(object.print()->config(), object.config().support_interface_filament, object.print()->is_BBL_printer())); const coordf_t extrusion_width_scaled = scale_(extrusion_width); if (is_auto(m_object_config->support_type.value) && g_config_support_sharp_tails && !detect_first_sharp_tail_only) { for (size_t layer_nr = layer_id_start; layer_nr < num_layers; layer_nr++) { diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 89a3a4987d..b1d0e0d1e8 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1503,7 +1503,7 @@ void TreeSupport::generate_toolpaths() { const PrintObjectConfig &object_config = m_object->config(); coordf_t support_extrusion_width = m_support_params.support_extrusion_width; - coordf_t nozzle_diameter = m_print_config->nozzle_diameter.get_at(object_config.support_filament - 1); + coordf_t nozzle_diameter = nozzle_diameter_for_filament(*m_print_config, object_config.support_filament, m_object->print()->is_BBL_printer()); coordf_t layer_height = object_config.layer_height.value; const size_t wall_count = object_config.tree_support_wall_count.value; diff --git a/src/libslic3r/TextureToColor/ColorUtils.cpp b/src/libslic3r/TextureToColor/ColorUtils.cpp index a32b4848b2..9584d8c8f9 100644 --- a/src/libslic3r/TextureToColor/ColorUtils.cpp +++ b/src/libslic3r/TextureToColor/ColorUtils.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -98,7 +98,7 @@ typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef boost::graph_traits::edge_descriptor edge_descriptor; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef CGAL::AABB_face_graph_triangle_primitive Primitive; -typedef CGAL::AABB_traits Traits; +typedef CGAL::AABB_traits_3 Traits; typedef CGAL::AABB_tree Tree; typedef CGALMesh::template Property_map VNMap; diff --git a/src/libslic3r/TextureToColor/ColorUtils.hpp b/src/libslic3r/TextureToColor/ColorUtils.hpp index e9b1be3623..efea0ecb36 100644 --- a/src/libslic3r/TextureToColor/ColorUtils.hpp +++ b/src/libslic3r/TextureToColor/ColorUtils.hpp @@ -17,9 +17,6 @@ typedef std::vector ColorList; typedef std::array ColorDouble; typedef std::array RGB; -// Function pointer type that points to a specific color-difference function based on the chosen method. -using DistanceFunction = double (*)(const Color&, const Color&); - // Color space used for computing color differences. enum struct ColorDifferenceMethod : std::size_t { RGB = 0, // Simplest and fastest diff --git a/src/libslic3r/TextureToColor/Repair.hpp b/src/libslic3r/TextureToColor/Repair.hpp index 092c0623fb..93f21b6222 100644 --- a/src/libslic3r/TextureToColor/Repair.hpp +++ b/src/libslic3r/TextureToColor/Repair.hpp @@ -2,7 +2,8 @@ #include "TriMesh.hpp" #include "CgalUtils.hpp" #include "Callbacks.hpp" -#include +#include +#include #include #include #include @@ -23,8 +24,6 @@ namespace Slic3r { namespace tex2color { -namespace PMP = CGAL::Polygon_mesh_processing; - // Default upper bound on the number of half-edges in any single boundary cycle // that CloseBoundariesAndRepairManifoldness will attempt to triangulate. The // cost of triangulate_hole grows non-linearly with cycle length, so this caps @@ -60,11 +59,12 @@ struct BoundaryEdgeStats // any pre-processing (e.g. stitch_borders) needed for the count to be meaningful. inline BoundaryEdgeStats ComputeBoundaryEdgeStats(const cgalutils::CGALMesh& cgal_mesh) { + namespace PMP = CGAL::Polygon_mesh_processing; using CGALMesh = cgalutils::CGALMesh; using HalfedgeDescriptor = boost::graph_traits::halfedge_descriptor; std::vector border_cycles; - PMP::extract_boundary_cycles(cgal_mesh, std::back_inserter(border_cycles)); + CGAL::extract_boundary_cycles(cgal_mesh, std::back_inserter(border_cycles)); BoundaryEdgeStats stats; stats.cycle_count = border_cycles.size(); @@ -86,6 +86,7 @@ inline BoundaryEdgeStats ComputeBoundaryEdgeStats(const cgalutils::CGALMesh& cga // boundary statistics; entering this function always triggers triangulation. inline void CloseBoundariesAndRepairManifoldness(cgalutils::CGALMesh& cgal_mesh) { + namespace PMP = CGAL::Polygon_mesh_processing; using CGALMesh = cgalutils::CGALMesh; using HalfedgeDescriptor = boost::graph_traits::halfedge_descriptor; using FaceDescriptor = boost::graph_traits::face_descriptor; @@ -94,11 +95,11 @@ inline void CloseBoundariesAndRepairManifoldness(cgalutils::CGALMesh& cgal_mesh) PMP::duplicate_non_manifold_vertices(cgal_mesh); std::vector border_cycles; - PMP::extract_boundary_cycles(cgal_mesh, std::back_inserter(border_cycles)); + CGAL::extract_boundary_cycles(cgal_mesh, std::back_inserter(border_cycles)); for (const HalfedgeDescriptor h : border_cycles) { std::vector patch_faces; - PMP::triangulate_hole(cgal_mesh, h, std::back_inserter(patch_faces)); + PMP::triangulate_hole(cgal_mesh, h, CGAL::parameters::face_output_iterator(std::back_inserter(patch_faces))); } PMP::remove_degenerate_faces(cgal_mesh); @@ -111,6 +112,7 @@ inline bool RepairMesh(const TriMesh& mesh, AlgoCancelCallback cancel_callback = nullptr, const RepairSetting& setting = RepairSetting{}) { + namespace PMP = CGAL::Polygon_mesh_processing; using Clock = std::chrono::steady_clock; auto elapsed_ms = [](Clock::time_point t0) { return std::chrono::duration_cast(Clock::now() - t0).count(); diff --git a/src/libslic3r/Utils.hpp b/src/libslic3r/Utils.hpp index 29adae1b74..24ebe9a337 100644 --- a/src/libslic3r/Utils.hpp +++ b/src/libslic3r/Utils.hpp @@ -25,8 +25,6 @@ #include #include #include -#include -#include #include #include diff --git a/src/libslic3r/libslic3r.h b/src/libslic3r/libslic3r.h index d3b0faa57f..b0a5250532 100644 --- a/src/libslic3r/libslic3r.h +++ b/src/libslic3r/libslic3r.h @@ -432,8 +432,6 @@ inline IntegerOnly fast_round_up(double a) return a == 0.49999999999999994 ? I(0) : I(floor(a + 0.5)); } -template using SamePair = std::pair; - } // namespace Slic3r #endif diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp index 83dd6a2d07..3859daf8e9 100644 --- a/src/slic3r/GUI/AMSMaterialsSetting.cpp +++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp @@ -1012,7 +1012,10 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi float machine_diameter = obj->GetExtderSystem()->GetNozzleDiameter(0); if (machine_diameter == 0.0f && preset_bundle) { const ConfigOption *opt = preset_bundle->printers.get_selected_preset().config.option("nozzle_diameter"); - if (opt) machine_diameter = static_cast(opt)->values[0]; + if (opt) { + const auto &nd = static_cast(opt)->values; + if (!nd.empty()) machine_diameter = nd.size() > 1 ? nd[1] : nd[0]; + } } stream << std::fixed << std::setprecision(1) << machine_diameter; std::string nozzle_diameter_str = stream.str(); @@ -1291,7 +1294,10 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt) float machine_diameter = obj->GetExtderSystem()->GetNozzleDiameter(0); if (machine_diameter == 0.0f) { const ConfigOption *opt = preset_bundle->printers.get_selected_preset().config.option("nozzle_diameter"); - if (opt) machine_diameter = static_cast(opt)->values[0]; + if (opt) { + const auto &nd = static_cast(opt)->values; + if (!nd.empty()) machine_diameter = nd.size() > 1 ? nd[1] : nd[0]; + } } stream << std::fixed << std::setprecision(1) << machine_diameter; } diff --git a/src/slic3r/GUI/AmsMappingPopup.hpp b/src/slic3r/GUI/AmsMappingPopup.hpp index f86b2a4497..90cf86bf57 100644 --- a/src/slic3r/GUI/AmsMappingPopup.hpp +++ b/src/slic3r/GUI/AmsMappingPopup.hpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -30,7 +29,6 @@ #include #include #include -#include #include #include "GUI_Utils.hpp" diff --git a/src/slic3r/GUI/AmsWidgets.hpp b/src/slic3r/GUI/AmsWidgets.hpp index 24f3f781b2..0c3c726b0c 100644 --- a/src/slic3r/GUI/AmsWidgets.hpp +++ b/src/slic3r/GUI/AmsWidgets.hpp @@ -19,20 +19,17 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include #include #include -#include #include diff --git a/src/slic3r/GUI/Auxiliary.hpp b/src/slic3r/GUI/Auxiliary.hpp index 4f25aab439..01ad99f648 100644 --- a/src/slic3r/GUI/Auxiliary.hpp +++ b/src/slic3r/GUI/Auxiliary.hpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -36,14 +35,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include diff --git a/src/slic3r/GUI/BBLStatusBar.hpp b/src/slic3r/GUI/BBLStatusBar.hpp index 1ff2fd6f0f..829c7445d7 100644 --- a/src/slic3r/GUI/BBLStatusBar.hpp +++ b/src/slic3r/GUI/BBLStatusBar.hpp @@ -8,7 +8,6 @@ #include #include #include -#include #include "Jobs/ProgressIndicator.hpp" diff --git a/src/slic3r/GUI/BBLStatusBarBind.hpp b/src/slic3r/GUI/BBLStatusBarBind.hpp index b1b06b60b6..f9c217b504 100644 --- a/src/slic3r/GUI/BBLStatusBarBind.hpp +++ b/src/slic3r/GUI/BBLStatusBarBind.hpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include "Jobs/ProgressIndicator.hpp" diff --git a/src/slic3r/GUI/BBLStatusBarPrint.hpp b/src/slic3r/GUI/BBLStatusBarPrint.hpp index bc82d80068..9780b7f24a 100644 --- a/src/slic3r/GUI/BBLStatusBarPrint.hpp +++ b/src/slic3r/GUI/BBLStatusBarPrint.hpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include "Jobs/ProgressIndicator.hpp" diff --git a/src/slic3r/GUI/BBLStatusBarSend.hpp b/src/slic3r/GUI/BBLStatusBarSend.hpp index 1c4b267c6f..cedab29e1d 100644 --- a/src/slic3r/GUI/BBLStatusBarSend.hpp +++ b/src/slic3r/GUI/BBLStatusBarSend.hpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include "Jobs/ProgressIndicator.hpp" diff --git a/src/slic3r/GUI/BaseTransparentDPIFrame.cpp b/src/slic3r/GUI/BaseTransparentDPIFrame.cpp index c9e4e4b76e..50fa700ec6 100644 --- a/src/slic3r/GUI/BaseTransparentDPIFrame.cpp +++ b/src/slic3r/GUI/BaseTransparentDPIFrame.cpp @@ -18,7 +18,6 @@ #include #include #include -#include "Widgets/Button.hpp" #include "CapsuleButton.hpp" namespace Slic3r::GUI { struct IntEvent; } diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp index 2f1283b790..60dd64bb57 100644 --- a/src/slic3r/GUI/BindDialog.cpp +++ b/src/slic3r/GUI/BindDialog.cpp @@ -46,7 +46,6 @@ #include "libslic3r/Model.hpp" #include "libslic3r/Polygon.hpp" #include "MainFrame.hpp" -#include "GUI_App.hpp" #include "Plater.hpp" #include "Jobs/BoostThreadWorker.hpp" #include "Jobs/PlaterWorker.hpp" diff --git a/src/slic3r/GUI/BonjourDialog.cpp b/src/slic3r/GUI/BonjourDialog.cpp index 566441c64f..914597fe40 100644 --- a/src/slic3r/GUI/BonjourDialog.cpp +++ b/src/slic3r/GUI/BonjourDialog.cpp @@ -29,7 +29,6 @@ #include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/I18N.hpp" #include "slic3r/GUI/format.hpp" -#include "slic3r/Utils/Bonjour.hpp" #include "slic3r/GUI/Widgets/DialogButtons.hpp" diff --git a/src/slic3r/GUI/Calibration.hpp b/src/slic3r/GUI/Calibration.hpp index c5318f818b..cc07b1452d 100644 --- a/src/slic3r/GUI/Calibration.hpp +++ b/src/slic3r/GUI/Calibration.hpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -24,7 +23,6 @@ #include #include #include -#include #include #include "GUI_Utils.hpp" diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index a587199e8c..b156f32cb8 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -1,4 +1,3 @@ -// #include "libslic3r/GCodeSender.hpp" #include "ConfigManipulation.hpp" #include "I18N.hpp" #include "GUI_App.hpp" @@ -920,10 +919,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in toggle_line("center_of_surface_pattern", has_centered_surface); // Orca: separate infills - bool is_internal_infill_separable = is_separable_infill_pattern(config->option>("sparse_infill_pattern")->value) || - config->opt_string("sparse_infill_rotate_template") != "" || - config->opt_string("solid_infill_rotate_template") != ""; - toggle_line("separated_infills", is_internal_infill_separable); + toggle_line("separated_infills", is_separable_infill_pattern(pattern)); // Fill order is only meaningful for the center-based surface fill patterns; hide it otherwise. auto is_centered_fill = [](InfillPattern p) { return p == ipConcentric || p == ipSpiralInset || p == ipArchimedeanChords || p == ipOctagramSpiral; }; diff --git a/src/slic3r/GUI/CreatePresetsDialog.cpp b/src/slic3r/GUI/CreatePresetsDialog.cpp index c7c9cd2760..1ae4e3b81b 100644 --- a/src/slic3r/GUI/CreatePresetsDialog.cpp +++ b/src/slic3r/GUI/CreatePresetsDialog.cpp @@ -540,12 +540,9 @@ static std::string calculate_md5(const std::string &input) return md5; } -static std::string get_filament_id(std::string vendor_typr_serial) +// Loads every system filament and the user's own, which a new filament id must not collide with. +static void load_filament_id_sources(PresetBundle &temp_preset_bundle) { - std::unordered_map> filament_id_to_filament_name; - - // temp filament presets - PresetBundle temp_preset_bundle; temp_preset_bundle.load_system_filaments_json(Slic3r::ForwardCompatibilitySubstitutionRule::EnableSilent); std::string dir_user_presets = wxGetApp().app_config->get("preset_folder"); if (dir_user_presets.empty()) { @@ -553,6 +550,13 @@ static std::string get_filament_id(std::string vendor_typr_serial) } else { temp_preset_bundle.load_user_presets(dir_user_presets, ForwardCompatibilitySubstitutionRule::EnableSilent); } +} + +static std::string get_filament_id(std::string vendor_typr_serial, const PresetBundle &temp_preset_bundle) +{ + std::unordered_map> filament_id_to_filament_name; + + // temp filament presets const std::deque &filament_presets = temp_preset_bundle.filaments.get_presets(); for (const Preset &preset : filament_presets) { @@ -1193,7 +1197,9 @@ wxWindow *CreateFilamentPresetDialog::create_dialog_buttons() if (wxID_YES != dlg.ShowModal()) { return; } } - std::string user_filament_id = get_filament_id(filament_preset_name); + PresetBundle filament_id_sources; + load_filament_id_sources(filament_id_sources); + std::string user_filament_id = get_filament_id(filament_preset_name, filament_id_sources); const wxString &curr_create_type = curr_create_filament_type(); @@ -2259,13 +2265,19 @@ bool CreatePrinterPresetDialog::load_system_and_user_presets_with_curr_model(Pre } else { selected_vendor_id = m_printer_preset_vendor_selected.id; + // The vendor list is built from the bundled profiles, so a vendor the user never + // installed loads from them. + const boost::filesystem::path vendor_dir = is_vendor_installed(selected_vendor_id) ? + boost::filesystem::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR : + boost::filesystem::path(Slic3r::resources_dir()) / PRESET_PROFILES_DIR; + try { // Pass the app's preset bundle (which already holds OrcaFilamentLibrary) as the base // bundle so vendor filaments that inherit OFL bases resolve via the existing // cross-vendor inheritance path. // Orca: served from the vendor's preset cache where one covers it — a shipped // build carries that instead of the raw preset JSONs — and parsed otherwise. - temp_preset_bundle.load_vendor_configs_from_json((boost::filesystem::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR).string(), + temp_preset_bundle.load_vendor_configs_from_json(vendor_dir.string(), selected_vendor_id, PresetBundle::LoadConfigBundleAttribute::LoadSystem, ForwardCompatibilitySubstitutionRule::EnableSilent, @@ -2873,13 +2885,21 @@ wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *paren return; } + // One load serves every clone below, since cloning assigns all filament ids before it saves a preset. + PresetBundle filament_id_sources; + if (!selected_filament_presets.empty()) + load_filament_id_sources(filament_id_sources); + auto create_filament_id = [&filament_id_sources](std::string vendor_typr_serial) { + return get_filament_id(vendor_typr_serial, filament_id_sources); + }; + std::vector successful_preset_names; if (curr_selected_preset_type == m_create_type.base_template) { BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " base template"; /****************************** clone filament preset ********************************/ std::vector failures; if (!selected_filament_presets.empty()) { - bool create_preset_result = preset_bundle->filaments.clone_presets_for_printer(selected_filament_presets, failures, printer_preset_name, get_filament_id, rewritten); + bool create_preset_result = preset_bundle->filaments.clone_presets_for_printer(selected_filament_presets, failures, printer_preset_name, create_filament_id, rewritten); if (!create_preset_result) { std::string message; for (const std::string &failure : failures) { message += "\t" + failure + "\n"; } @@ -2889,7 +2909,7 @@ wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *paren int res = dlg.ShowModal(); if (wxID_YES == res) { create_preset_result = preset_bundle->filaments.clone_presets_for_printer(selected_filament_presets, failures, printer_preset_name, - get_filament_id, true); + create_filament_id, true); } else { BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " printer preset no same preset but filament has same preset, user cancel create the printer preset"; return; @@ -2905,7 +2925,7 @@ wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *paren if (!selected_process_presets.empty()) { generate_process_presets_data(selected_process_presets, printer_nozzle_name); bool create_preset_result = preset_bundle->prints.clone_presets_for_printer(selected_process_presets, failures, printer_preset_name, - get_filament_id, rewritten); + create_filament_id, rewritten); if (!create_preset_result) { std::string message; for (const std::string &failure : failures) { message += "\t" + failure + "\n"; } @@ -2914,7 +2934,7 @@ wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *paren wxYES | wxYES_DEFAULT | wxCENTRE); int res = dlg.ShowModal(); if (wxID_YES == res) { - create_preset_result = preset_bundle->prints.clone_presets_for_printer(selected_process_presets, failures, printer_preset_name, get_filament_id, true); + create_preset_result = preset_bundle->prints.clone_presets_for_printer(selected_process_presets, failures, printer_preset_name, create_filament_id, true); } else { BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " printer preset no same preset but process has same preset, user cancel create the printer preset"; return; @@ -2926,7 +2946,7 @@ wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *paren /****************************** clone filament preset ********************************/ std::vector failures; if (!selected_filament_presets.empty()) { - bool create_preset_result = preset_bundle->filaments.clone_presets_for_printer(selected_filament_presets, failures, printer_preset_name, get_filament_id, rewritten); + bool create_preset_result = preset_bundle->filaments.clone_presets_for_printer(selected_filament_presets, failures, printer_preset_name, create_filament_id, rewritten); if (!create_preset_result) { std::string message; for (const std::string& failure : failures) { @@ -2937,7 +2957,7 @@ wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *paren wxYES | wxYES_DEFAULT | wxCENTRE); int res = dlg.ShowModal(); if (wxID_YES == res) { - create_preset_result = preset_bundle->filaments.clone_presets_for_printer(selected_filament_presets, failures, printer_preset_name, get_filament_id, true); + create_preset_result = preset_bundle->filaments.clone_presets_for_printer(selected_filament_presets, failures, printer_preset_name, create_filament_id, true); } else { BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " printer preset no same preset but filament has same preset, user cancel create the printer preset"; return; @@ -2948,7 +2968,7 @@ wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *paren /****************************** clone process preset ********************************/ failures.clear(); if (!selected_process_presets.empty()) { - bool create_preset_result = preset_bundle->prints.clone_presets_for_printer(selected_process_presets, failures, printer_preset_name, get_filament_id, rewritten); + bool create_preset_result = preset_bundle->prints.clone_presets_for_printer(selected_process_presets, failures, printer_preset_name, create_filament_id, rewritten); if (!create_preset_result) { std::string message; for (const std::string& failure : failures) { @@ -2957,7 +2977,7 @@ wxWindow *CreatePrinterPresetDialog::create_page2_dialog_buttons(wxWindow *paren MessageDialog dlg(this, _L("Create process presets failed. As follows:\n") + from_u8(message) + _L("\nDo you want to rewrite it?"), wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Info"), wxYES | wxYES_DEFAULT | wxCENTRE); int res = dlg.ShowModal(); if (wxID_YES == res) { - create_preset_result = preset_bundle->prints.clone_presets_for_printer(selected_process_presets, failures, printer_preset_name, get_filament_id, true); + create_preset_result = preset_bundle->prints.clone_presets_for_printer(selected_process_presets, failures, printer_preset_name, create_filament_id, true); } else { BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " printer preset no same preset but filament has same preset, user cancel create the printer preset"; return; diff --git a/src/slic3r/GUI/DeviceCore/DevDefs.h b/src/slic3r/GUI/DeviceCore/DevDefs.h index 6332d6b109..aa12482849 100644 --- a/src/slic3r/GUI/DeviceCore/DevDefs.h +++ b/src/slic3r/GUI/DeviceCore/DevDefs.h @@ -198,6 +198,3 @@ template<> struct std::hash return h1 ^ (h2 + 0x9e3779b9 + (h1 << 6) + (h1 >> 2)); }; }; - -// key(extruder_id) -> { key1(nozzle type info), val1( number of the nozzle type)} -using ExtruderNozzleInfos = std::unordered_map>; \ No newline at end of file diff --git a/src/slic3r/GUI/DeviceCore/DevFilaSystem.h b/src/slic3r/GUI/DeviceCore/DevFilaSystem.h index 27dc238e9e..b843eba4b3 100644 --- a/src/slic3r/GUI/DeviceCore/DevFilaSystem.h +++ b/src/slic3r/GUI/DeviceCore/DevFilaSystem.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 30e7282c0e..c1c357a2d5 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -11,7 +11,6 @@ #include "GUI_App.hpp" #include "DeviceErrorDialog.hpp" #include "Plater.hpp" -#include "GUI_App.hpp" #include "ReleaseNote.hpp" #include #include diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 95b8239387..2cc6c6747f 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2427,11 +2427,15 @@ void GLCanvas3D::_render_scene(const Camera& camera, const Size& cnv_size) if (m_canvas_type == ECanvasType::CanvasView3D) { // m_show_bed gates the plate list too: hiding the bed but leaving its grid and outline // floating would read as a rendering fault rather than a deliberate view option. - // Design tab: while its reference planes are up they draw their own axes from the modeling - // origin, where the bed's triad would otherwise sit on top of them. - if (show_bed) - _render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), - m_show_world_axes && !(m_design_sketch_tool != nullptr && m_design_sketch_tool->draws_reference_axes())); + if (show_bed) { + bool show_axes = m_show_world_axes; +#ifdef SLIC3R_CAD + // Design tab: while its reference planes are up they draw their own axes from the modeling + // origin, where the bed's triad would otherwise sit on top of them. + show_axes = show_axes && !(m_design_sketch_tool != nullptr && m_design_sketch_tool->draws_reference_axes()); +#endif + _render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), show_axes); + } m_frame_profiler.mark("bed"); if (show_bed) //BBS: add outline logic _render_platelist(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), only_current, only_body, hover_id, true, show_grid); diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index faf826ed7c..23fdfbb66d 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -183,13 +183,10 @@ wxDECLARE_EVENT(EVT_GLCANVAS_PLATE_NAME_CHANGE, SimpleEvent); //BBS: declare EVT_GLCANVAS_PLATE_SELECT wxDECLARE_EVENT(EVT_GLCANVAS_PLATE_SELECT, SimpleEvent); -using Vec2dEvent = Event; // _bool_ value is used as a indicator of selection in the 3DScene using RBtnEvent = Event>; using RBtnPlateEvent = Event>; -template using Vec2dsEvent = ArrayEvent; -using Vec3dEvent = Event; template using Vec3dsEvent = ArrayEvent; using HeightProfileSmoothEvent = Event; diff --git a/src/slic3r/GUI/GLTexture.cpp b/src/slic3r/GUI/GLTexture.cpp index 4cdb17dd28..f83dd1f854 100644 --- a/src/slic3r/GUI/GLTexture.cpp +++ b/src/slic3r/GUI/GLTexture.cpp @@ -46,7 +46,6 @@ #include "nanosvg/nanosvgrast.h" #include "libslic3r/Utils.hpp" -#include "GUI_App.hpp" #include #include #include diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 7de994960e..e376bfc097 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -50,7 +50,6 @@ #include "AboutDialog.hpp" #include "MsgDialog.hpp" #include "Plater.hpp" -#include "format.hpp" #include "WebUserLoginDialog.hpp" diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 80129fdee2..23ae29d8d7 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -174,12 +174,10 @@ #include "libslic3r/Utils.hpp" #include "libslic3r/Geometry.hpp" #include "libslic3r/Model.hpp" -#include "libslic3r/I18N.hpp" #include "libslic3r/PresetBundle.hpp" #include "libslic3r/InstanceLock.hpp" #include "libslic3r/Thread.hpp" #include "libslic3r/miniz_extension.hpp" -#include "libslic3r/Utils.hpp" #include "slic3r/plugin/PluginManager.hpp" #include "slic3r/plugin/host/PluginHostUi.hpp" #include "slic3r/plugin/PythonInterpreter.hpp" diff --git a/src/slic3r/GUI/HintNotification.cpp b/src/slic3r/GUI/HintNotification.cpp index 433a829c29..1ad5903dea 100644 --- a/src/slic3r/GUI/HintNotification.cpp +++ b/src/slic3r/GUI/HintNotification.cpp @@ -11,7 +11,6 @@ #include "libslic3r/Config.hpp" #include "libslic3r/PresetBundle.hpp" #include "libslic3r/Preset.hpp" -#include "libslic3r/Config.hpp" #include "libslic3r/PrintConfig.hpp" #include diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 5728ad5697..7def86aaeb 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -66,7 +66,6 @@ #include #include #include "OpenGLManager.hpp" -#include "GUI_App.hpp" namespace Slic3r { namespace GUI { diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index c882667d90..84b702d7e5 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -113,7 +113,6 @@ #include "MsgDialog.hpp" #include "Notebook.hpp" #include "GUI_Factories.hpp" -#include "GUI_ObjectList.hpp" #include "NotificationManager.hpp" #include "MarkdownTip.hpp" #include "NetworkTestDialog.hpp" diff --git a/src/slic3r/GUI/ModelMall.cpp b/src/slic3r/GUI/ModelMall.cpp index e8b08f7e02..f0d708640d 100644 --- a/src/slic3r/GUI/ModelMall.cpp +++ b/src/slic3r/GUI/ModelMall.cpp @@ -21,7 +21,6 @@ #include "wx/evtloop.h" #include "MainFrame.hpp" -#include "GUI_App.hpp" #include "Plater.hpp" using json = nlohmann::json; diff --git a/src/slic3r/GUI/Monitor.cpp b/src/slic3r/GUI/Monitor.cpp index b23c5ab468..4e7bae328d 100644 --- a/src/slic3r/GUI/Monitor.cpp +++ b/src/slic3r/GUI/Monitor.cpp @@ -45,7 +45,6 @@ #include "MainFrame.hpp" #include "MediaPlayCtrl.h" #include "MediaFilePanel.h" -#include "Plater.hpp" #include "BindDialog.hpp" #include "DeviceCore/DevManager.h" diff --git a/src/slic3r/GUI/Monitor.hpp b/src/slic3r/GUI/Monitor.hpp index ce7fcf0570..613a1f1ac7 100644 --- a/src/slic3r/GUI/Monitor.hpp +++ b/src/slic3r/GUI/Monitor.hpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -31,14 +30,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include diff --git a/src/slic3r/GUI/NetworkTestDialog.cpp b/src/slic3r/GUI/NetworkTestDialog.cpp index caff68b39e..54c0f11cf0 100644 --- a/src/slic3r/GUI/NetworkTestDialog.cpp +++ b/src/slic3r/GUI/NetworkTestDialog.cpp @@ -4,7 +4,6 @@ #include "libslic3r/Utils.hpp" #include "GUI.hpp" #include "GUI_App.hpp" -#include "I18N.hpp" #include "libslic3r_version.h" #include "slic3r/Utils/Http.hpp" #include "libslic3r/AppConfig.hpp" diff --git a/src/slic3r/GUI/OptionsGroup.hpp b/src/slic3r/GUI/OptionsGroup.hpp index 63ebee7176..0943922925 100644 --- a/src/slic3r/GUI/OptionsGroup.hpp +++ b/src/slic3r/GUI/OptionsGroup.hpp @@ -54,7 +54,6 @@ struct Option { Option(const ConfigOptionDef& _opt, t_config_option_key id) : opt(_opt), opt_id(id) {} }; -using t_option = std::unique_ptr