summarylogtreecommitdiffstats
path: root/0004-cgal6.patch
blob: 9e106db11a36b2a35e4331abc3282869c8bd4881 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff --git a/src/libslic3r/CutSurface.cpp b/src/libslic3r/CutSurface.cpp
index c229ff246b..1c982daddf 100644
--- a/src/libslic3r/CutSurface.cpp
+++ b/src/libslic3r/CutSurface.cpp
@@ -33,6 +33,7 @@ using namespace Slic3r;
 #include <CGAL/Exact_integer.h>
 #include <CGAL/Surface_mesh.h>
 #include <CGAL/Cartesian_converter.h>
+#include <CGAL/AABB_traits.h>
 #include <oneapi/tbb/parallel_for.h>
 
 // libslic3r
@@ -1429,8 +1430,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<EI, IntersectingElement>(edge_shape_map_name).first;
-    const FaceShapeMap& face_shape_map = cgal_shape.property_map<FI, IntersectingElement>(face_shape_map_name).first;
+    const EdgeShapeMap& edge_shape_map = access_pmap(cgal_shape.property_map<EI, IntersectingElement>(edge_shape_map_name));
+    const FaceShapeMap& face_shape_map = access_pmap(cgal_shape.property_map<FI, IntersectingElement>(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
@@ -1579,8 +1580,8 @@ void priv::collect_surface_data(std::queue<FI>  &process,
 
 void priv::create_reduce_map(ReductionMap &reduction_map, const CutMesh &mesh)
 {
-    const VertexShapeMap &vert_shape_map = mesh.property_map<VI, const IntersectingElement*>(vert_shape_map_name).first;
-    const EdgeBoolMap &ecm = mesh.property_map<EI, bool>(is_constrained_edge_name).first;
+    const VertexShapeMap &vert_shape_map = access_pmap(mesh.property_map<VI, const IntersectingElement*>(vert_shape_map_name));
+    const EdgeBoolMap &ecm = access_pmap(mesh.property_map<EI, bool>(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 {
@@ -1765,10 +1766,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<VI, const IntersectingElement *>(vert_shape_map_name).first;
+            access_pmap(models[patch.model_id].property_map<VI, const IntersectingElement *>(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<VI, VI>(patch_source_name).first;
+        const CvtVI2VI& cvt = access_pmap(patch.mesh.property_map<VI, VI>(patch_source_name));
         // for each point on outline
         for (const Loop &loop : patch.loops) 
         for (const VI &vi_patch : loop) {
@@ -2929,7 +2930,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<VI, const IntersectingElement *>(vert_shape_map_name).first;
+    const VertexShapeMap &vert_shape_map = access_pmap(model.property_map<VI, const IntersectingElement *>(vert_shape_map_name));
     // for each half edge of outline
     for (HI hi : cut.second) {
         VI vi = model.source(hi);
@@ -2954,7 +2955,7 @@ priv::SurfacePatch priv::separate_patch(const std::vector<FI>& fis,
     patch_new.model_id     = patch.model_id;
     patch_new.shape_id     = patch.shape_id;
     // fix cvt
-    CvtVI2VI cvt = patch_new.mesh.property_map<VI, VI>(patch_source_name).first;
+    CvtVI2VI cvt = access_pmap(patch_new.mesh.property_map<VI, VI>(patch_source_name));
     for (VI &vi : cvt) {
         if (!vi.is_valid()) continue;
         vi = cvt_from[vi];
@@ -2974,7 +2975,7 @@ void priv::divide_patch(size_t i, SurfacePatchesEx &patches)
     std::string patch_number_name = "f:patch_number";
     CutMesh::Property_map<FI,bool> is_processed = access_pmap(cm.add_property_map<FI, bool>(patch_number_name, false));
     
-    const CvtVI2VI& cvt_from = patch.mesh.property_map<VI, VI>(patch_source_name).first;
+    const CvtVI2VI& cvt_from = access_pmap(patch.mesh.property_map<VI, VI>(patch_source_name));
 
     std::vector<FI> fis;
     fis.reserve(cm.faces().size());
@@ -3161,7 +3162,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<VI, const IntersectingElement*>(vert_shape_map_name).first;
+    const VertexShapeMap &vert_shape_map = access_pmap(mesh.property_map<VI, const IntersectingElement*>(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)];