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..89d3955b29 100644
--- a/src/libslic3r/CutSurface.cpp
+++ b/src/libslic3r/CutSurface.cpp
@@ -3,6 +3,7 @@
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
///|/
#include "CutSurface.hpp"
+#include <CGAL/AABB_traits.h>
/// models_input.obj - Check transormation of model to each others
/// projection_center.obj - circle representing center of projection with correct distance
@@ -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 = cgal_shape.property_map<EI, IntersectingElement>(edge_shape_map_name).value();
+ const FaceShapeMap& face_shape_map = cgal_shape.property_map<FI, IntersectingElement>(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
@@ -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 = mesh.property_map<VI, const IntersectingElement*>(vert_shape_map_name).value();
+ const EdgeBoolMap &ecm = mesh.property_map<EI, bool>(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 {
@@ -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;
+ models[patch.model_id].property_map<VI, const IntersectingElement *>(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<VI, VI>(patch_source_name).first;
+ const CvtVI2VI& cvt = patch.mesh.property_map<VI, VI>(patch_source_name).value();
// 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 = model.property_map<VI, const IntersectingElement *>(vert_shape_map_name).value();
// 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 = patch_new.mesh.property_map<VI, VI>(patch_source_name).value();
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 = patch.mesh.property_map<VI, VI>(patch_source_name).value();
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 = mesh.property_map<VI, const IntersectingElement*>(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)];
|