diff --git a/0001-libbgcode-binarize-public-deps.patch b/0001-libbgcode-binarize-public-deps.patch new file mode 100644 index 0000000..97e0195 --- /dev/null +++ b/0001-libbgcode-binarize-public-deps.patch @@ -0,0 +1,13 @@ +diff --git a/src/LibBGCode/binarize/CMakeLists.txt b/src/LibBGCode/binarize/CMakeLists.txt +index 71bf85c..af0f9b5 100644 +--- a/src/LibBGCode/binarize/CMakeLists.txt ++++ b/src/LibBGCode/binarize/CMakeLists.txt +@@ -36,7 +36,7 @@ target_include_directories(${_libname}_binarize + $ + ) + +-target_link_libraries(${_libname}_binarize PRIVATE heatshrink::heatshrink_dynalloc ZLIB::ZLIB) ++target_link_libraries(${_libname}_binarize PUBLIC heatshrink::heatshrink_dynalloc ZLIB::ZLIB) + target_link_libraries(${_libname}_binarize PUBLIC ${_libname}_core) + + set(Binarize_DOWNSTREAM_DEPS ${Binarize_DOWNSTREAM_DEPS} PARENT_SCOPE) diff --git a/0013-fix-missing-template-args.patch b/0013-fix-missing-template-args.patch new file mode 100644 index 0000000..4e4e179 --- /dev/null +++ b/0013-fix-missing-template-args.patch @@ -0,0 +1,13 @@ +diff --git a/src/libslic3r/Arrange/Core/DataStoreTraits.hpp b/src/libslic3r/Arrange/Core/DataStoreTraits.hpp +index ba932d57a8..624569d3f4 100644 +--- a/src/libslic3r/Arrange/Core/DataStoreTraits.hpp ++++ b/src/libslic3r/Arrange/Core/DataStoreTraits.hpp +@@ -71,7 +71,7 @@ template using WritableDataStoreOnly = std::enable_if_t + void set_data(ArrItem &itm, const std::string &key, T &&data) + { +- WritableDataStoreTraits::template set(itm, key, std::forward(data)); ++ WritableDataStoreTraits::template set(itm, key, std::forward(data)); + } + + template constexpr bool IsReadWritableDataStore = IsDataStore && IsWritableDataStore; diff --git a/PKGBUILD b/PKGBUILD index 7f3a93a..daa6ece 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -16,7 +16,7 @@ license=('AGPL3') options=(!emptydirs) depends=( 'boost-libs>=1.85.0' - 'cgal<6' + 'cgal' 'glew' 'imath' 'heatshrink' @@ -43,6 +43,8 @@ conflicts=('superslicer' 'superslicer-git') source=("https://github.com/supermerill/SuperSlicer/archive/$_pkgtag.tar.gz" "https://github.com/prusa3d/libbgcode/archive/$_libbgcode.tar.gz" "prusaslicer-2.8.1-boost-1.87.0-asio.patch::https://bugs.gentoo.org/attachment.cgi?id=914594" + "prusaslicer-2.8.1-cgal-6.0.patch" + "0001-libbgcode-binarize-public-deps.patch" "0001-findwxwidgets.patch" "0002-addlib-expat.patch" "0003-openexr3.patch" @@ -52,10 +54,13 @@ source=("https://github.com/supermerill/SuperSlicer/archive/$_pkgtag.tar.gz" "0009-fix-multiple-choice.patch" "0010-occtwrapper-install-dir.patch" "0011-fix-constructible-svgfile.patch" - "0012-boost1.87.patch") + "0012-boost1.87.patch" + "0013-fix-missing-template-args.patch") sha512sums=('0d72bf61adcafe8eef2ed860449dc25ca295ba0732d956bff8c0ae50b381387b803fd88241ab855a9b38daf8f5eaa4c41d17241b8c15c66d63576874179aa1c0' '04cb7cb69d887e1fa5ced5c0219b0ee6cab81f09d1bc1226ebd26563e2ce60b85fb6e5aef11a36dffd3e00779849906fc5c19ad2cdd22d45360226912b6af31b' '3466fbbb00a4b9295c4c6a8fc5a983b5c5a78c7f091cd4502137301e10d0087abb50d5994ceba717a435693d8e4b6f5e4b084bd950b82ec91a33b1981d13226b' + '188a5efa0128f848c6b3d882c2e472b3fbdd9db8c130735083b3410095197bc69dea855f4622d1011c8540cdfbfc25dc4a14e81fd28f2510067293ae5de15fce' + 'ecbe9bdec72a372dfdc25b32dee382a9937c544567fa2da42a30467ddff2594495bf244a773401f655930301a2debc94636a362383239fa08808d0e51bc687a4' 'd910cf1fc07219b6c776240eae0f203813368e69b6a0215bcdcabba385531744093b6214b21d0dffbafa8992d3549c96bbdb02e939c52a4e81dbce98389397f9' '93a943eb9be52085a811d7cc8379dc5a3942befdc3d19eecf6310f8dfcfdef72bfa15dfcb85ac1f4f9d7731c973b9815a532ae444e3fe275f8f624825fe8e98b' '840e51b8feb3568ff46d309ece063f7188018fcaa43d19ec50ede408fdf2c237a3b7eaa11ba24409d8c3f7d6f5fb270181508cc56e0b2b0fef68b766130ef1eb' @@ -65,7 +70,8 @@ sha512sums=('0d72bf61adcafe8eef2ed860449dc25ca295ba0732d956bff8c0ae50b381387b803 '6d7ab93042a75f04e1c3c8f294d19dd39abaf22aa75caf996c6a0cf753f6472134a3d4fa443b73924800b2d3a710416a931745c168911c0df3709fb71ec00570' '92929ba1cb6ee104a10f34a649eba3789ca02f1725104a57412279ff68c46614b1812b13e7dcdf0d235618b9f2a868b4798b1404d9e712d9f1efd46e6c71fcb5' '6b677b68ebc7eda67d2f378c4d1cb5aca0a92fcecb04f685ae04aa4975655c36a606887526c4ff34b7e0b0ae2627eaf759fdeda896dffa0e0925132be36881ca' - '559b52ed83f4032b00e2daaf22e2f86c66ce016bd4f1368f216cffed38fd5436ae12ddea427655d39c969e7de35cdcec06a0be317e58cf3d8ba1388a29664164') + '559b52ed83f4032b00e2daaf22e2f86c66ce016bd4f1368f216cffed38fd5436ae12ddea427655d39c969e7de35cdcec06a0be317e58cf3d8ba1388a29664164' + '2141359af03193ef8afe7e5cd38b03e8888dadabe58be8c9625e24572062167a10a3bf990728f16ab765cae776e834eaab88ff9c7e6a96f909a7c6ae807a1e82') _apply_patches() { for patch in "${@}" @@ -80,6 +86,9 @@ prepare() { rm -rf build mkdir -p build + _apply_patches \ + "$srcdir/0001-libbgcode-binarize-public-deps.patch" + cd "$srcdir/SuperSlicer-$_pkgtag" rm -rf build # build fails everytime if it isn't a clean build?!? mkdir -p build @@ -90,6 +99,7 @@ prepare() { # apply patches for superslicer _apply_patches \ "$srcdir/prusaslicer-2.8.1-boost-1.87.0-asio.patch" \ + "$srcdir/prusaslicer-2.8.1-cgal-6.0.patch" \ "$srcdir/0001-findwxwidgets.patch" \ "$srcdir/0002-addlib-expat.patch" \ "$srcdir/0003-openexr3.patch" \ @@ -99,7 +109,8 @@ prepare() { "$srcdir/0009-fix-multiple-choice.patch" \ "$srcdir/0010-occtwrapper-install-dir.patch" \ "$srcdir/0011-fix-constructible-svgfile.patch" \ - "$srcdir/0012-boost1.87.patch" + "$srcdir/0012-boost1.87.patch" \ + "$srcdir/0013-fix-missing-template-args.patch" } build() { diff --git a/prusaslicer-2.8.1-cgal-6.0.patch b/prusaslicer-2.8.1-cgal-6.0.patch new file mode 100644 index 0000000..87de410 --- /dev/null +++ b/prusaslicer-2.8.1-cgal-6.0.patch @@ -0,0 +1,190 @@ +From a9283c62cec2b802aa2133c92b7ff5bf320c0bb6 Mon Sep 17 00:00:00 2001 +From: Laurent Rineau +Date: Sat, 13 Jul 2024 01:19:21 +0200 +Subject: [PATCH] compatibility with CGAL-6.0 (and 5.6.x) + +updated for 2.8.1 +updated for SuperSlicer + +--- a/src/libslic3r/CutSurface.cpp ++++ b/src/libslic3r/CutSurface.cpp +@@ -4,6 +4,14 @@ + ///|/ + #include "CutSurface.hpp" + ++template ++auto access_pmap(std::optional opt) -> T { ++ return opt.value(); ++} ++ ++template ++auto access_pmap(Pair pair) { return pair.first; } ++ + /// models_input.obj - Check transormation of model to each others + /// projection_center.obj - circle representing center of projection with correct distance + /// {M} .. model index +@@ -31,4 +39,5 @@ using namespace Slic3r; + #include + #include + #include ++#include + #include +@@ -1021,8 +1030,8 @@ priv::CutMesh priv::to_cgal(const ExPolygons &shapes, + if (shapes.empty()) return {}; + + CutMesh result; +- EdgeShapeMap edge_shape_map = result.add_property_map(edge_shape_map_name).first; +- FaceShapeMap face_shape_map = result.add_property_map(face_shape_map_name).first; ++ EdgeShapeMap edge_shape_map = access_pmap((result.add_property_map(edge_shape_map_name))); ++ FaceShapeMap face_shape_map = access_pmap((result.add_property_map(face_shape_map_name))); + + std::vector indices; + auto insert_contour = [&projection, &indices, &result, +@@ -1432,17 +1441,17 @@ priv::CutAOIs priv::cut_from_model(CutMesh &cgal_model, + const ExPolygonsIndices &s2i) + { + // pointer to edge or face shape_map +- VertexShapeMap vert_shape_map = cgal_model.add_property_map(vert_shape_map_name, nullptr).first; ++ VertexShapeMap vert_shape_map = access_pmap((cgal_model.add_property_map(vert_shape_map_name, nullptr))); + + // 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 = access_pmap((cgal_shape.property_map(edge_shape_map_name))); ++ const FaceShapeMap& face_shape_map = access_pmap((cgal_shape.property_map(face_shape_map_name))); + 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 +- EdgeBoolMap ecm = cgal_model.add_property_map(is_constrained_edge_name, false).first; ++ EdgeBoolMap ecm = access_pmap((cgal_model.add_property_map(is_constrained_edge_name, false))); + const auto &p = CGAL::parameters::visitor(visitor) + .edge_is_constrained_map(ecm) + .throw_on_self_intersection(false); +@@ -1451,7 +1460,7 @@ priv::CutAOIs priv::cut_from_model(CutMesh &cgal_model, + + if (!is_valid) return {}; + +- FaceTypeMap face_type_map = cgal_model.add_property_map(face_type_map_name, FaceType::not_constrained).first; ++ FaceTypeMap face_type_map = access_pmap((cgal_model.add_property_map(face_type_map_name, FaceType::not_constrained))); + + // Select inside and outside face in model + set_face_type(face_type_map, cgal_model, vert_shape_map, ecm, cgal_shape, s2i); +@@ -1587,8 +1596,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 = access_pmap((mesh.property_map(vert_shape_map_name))); ++ const EdgeBoolMap &ecm = access_pmap((mesh.property_map(is_constrained_edge_name))); + + // check if vertex was made by edge_2 which is diagonal of quad + auto is_reducible_vertex = [&vert_shape_map](VI reduction_from) -> bool { +@@ -1773,10 +1782,10 @@ priv::VDistances priv::calc_distances(const SurfacePatches &patches, + 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; ++ access_pmap((models[patch.model_id].property_map(vert_shape_map_name))); + 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 = access_pmap((patch.mesh.property_map(patch_source_name))); + // for each point on outline + for (const Loop &loop : patch.loops) + for (const VI &vi_patch : loop) { +@@ -2666,7 +2675,7 @@ priv::SurfacePatch priv::create_surface_patch(const std::vector &fis, + /* const */ CutMesh &mesh, + const ReductionMap *rmap) + { +- auto is_counted = mesh.add_property_map("v:is_counted").first; ++ auto is_counted = access_pmap((mesh.add_property_map("v:is_counted"))); + uint32_t count_vertices = 0; + if (rmap == nullptr) { + for (FI fi : fis) +@@ -2696,7 +2705,7 @@ priv::SurfacePatch priv::create_surface_patch(const std::vector &fis, + cm.reserve(count_vertices, count_edges, count_faces); + + // vertex conversion function from mesh VI to result VI +- CvtVI2VI mesh2result = mesh.add_property_map("v:mesh2result").first; ++ CvtVI2VI mesh2result = access_pmap((mesh.add_property_map("v:mesh2result"))); + + if (rmap == nullptr) { + for (FI fi : fis) { +@@ -2748,7 +2757,7 @@ priv::SurfacePatch priv::create_surface_patch(const std::vector &fis, + assert(count_edges >= cm.edges().size()); + + // convert VI from this patch to source VI, when exist +- CvtVI2VI cvt = cm.add_property_map(patch_source_name).first; ++ CvtVI2VI cvt = access_pmap((cm.add_property_map(patch_source_name))); + // vi_s .. VertexIndex into mesh (source) + // vi_d .. new VertexIndex in cm (destination) + for (VI vi_s : mesh.vertices()) { +@@ -2939,7 +2948,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 = access_pmap((model.property_map(vert_shape_map_name))); + // for each half edge of outline + for (HI hi : cut.second) { + VI vi = model.source(hi); +@@ -2964,7 +2973,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 = access_pmap((patch_new.mesh.property_map(patch_source_name))); + for (VI &vi : cvt) { + if (!vi.is_valid()) continue; + vi = cvt_from[vi]; +@@ -2982,9 +2991,9 @@ void priv::divide_patch(size_t i, SurfacePatchesEx &patches) + CutMesh& cm = patch.mesh; + assert(!cm.faces().empty()); + std::string patch_number_name = "f:patch_number"; +- CutMesh::Property_map is_processed = cm.add_property_map(patch_number_name, false).first; ++ CutMesh::Property_map is_processed = access_pmap((cm.add_property_map(patch_number_name, false))); + +- const CvtVI2VI& cvt_from = patch.mesh.property_map(patch_source_name).first; ++ const CvtVI2VI& cvt_from = access_pmap((patch.mesh.property_map(patch_source_name))); + + std::vector fis; + fis.reserve(cm.faces().size()); +@@ -3085,7 +3094,7 @@ priv::SurfacePatches priv::diff_models(VCutAOIs &cuts, + CutAOIs &model_cuts = cuts[model_index]; + CutMesh &cut_model_ = cut_models[model_index]; + const CutMesh &cut_model = cut_model_; +- ReductionMap vertex_reduction_map = cut_model_.add_property_map(vertex_reduction_map_name).first; ++ ReductionMap vertex_reduction_map = access_pmap((cut_model_.add_property_map(vertex_reduction_map_name))); + create_reduce_map(vertex_reduction_map, cut_model); + + for (size_t cut_index = 0; cut_index < model_cuts.size(); ++cut_index, ++index) { +@@ -3171,7 +3180,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 = access_pmap((mesh.property_map(vert_shape_map_name))); + 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)]; +@@ -3708,7 +3717,7 @@ void priv::store(const CutMesh &mesh, const FaceTypeMap &face_type_map, const st + } + + CutMesh &mesh_ = const_cast(mesh); +- auto face_colors = mesh_.add_property_map("f:color").first; ++ auto face_colors = access_pmap((mesh_.add_property_map("f:color"))); + for (FI fi : mesh.faces()) { + auto &color = face_colors[fi]; + switch (face_type_map[fi]) { +@@ -3734,7 +3743,7 @@ void priv::store(const CutMesh &mesh, const ReductionMap &reduction_map, const s + std::string off_file = dir + "model" + std::to_string(reduction_order++) + ".off"; + + CutMesh &mesh_ = const_cast(mesh); +- auto vertex_colors = mesh_.add_property_map("v:color").first; ++ auto vertex_colors = access_pmap((mesh_.add_property_map("v:color"))); + // initialize to gray color + for (VI vi: mesh.vertices()) + vertex_colors[vi] = CGAL::Color{127, 127, 127};