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
|
https://github.com/prusa3d/PrusaSlicer/pull/13081#issuecomment-2384156635
--- a/tests/libslic3r/test_emboss.cpp
+++ b/tests/libslic3r/test_emboss.cpp
@@ -9,8 +9,16 @@
#include <libslic3r/IntersectionPoints.hpp>
using namespace Slic3r;
+template <typename T>
+auto access_pmap(std::optional<T> opt) -> T {
+ return opt.value();
+}
+
+template <typename Pair>
+auto access_pmap(Pair pair) { return pair.first; }
+
namespace Private{
-
+
// calculate multiplication of ray dir to intersect - inspired by
// segment_segment_intersection when ray dir is normalized retur distance from
// ray point to intersection No value mean no intersection
@@ -904,8 +912,8 @@
// identify glyph for intersected vertex
std::string vert_shape_map_name = "v:glyph_id";
MyMesh cgal_object = MeshBoolean::cgal2::to_cgal(cube, face_map_name);
- auto face_map = cgal_object.property_map<MyMesh::Face_index, int32_t>(face_map_name).first;
- auto vert_shape_map = cgal_object.add_property_map<MyMesh::Vertex_index, IntersectingElemnt>(vert_shape_map_name).first;
+ auto face_map = access_pmap(cgal_object.property_map<MyMesh::Face_index, int32_t>(face_map_name));
+ auto vert_shape_map = access_pmap(cgal_object.add_property_map<MyMesh::Vertex_index, IntersectingElemnt>(vert_shape_map_name));
std::string edge_shape_map_name = "e:glyph_id";
std::string face_shape_map_name = "f:glyph_id";
@@ -913,8 +921,8 @@
MyMesh cgal_shape = MeshBoolean::cgal2::to_cgal(shape, projection, 0, edge_shape_map_name, face_shape_map_name, glyph_contours);
- auto edge_shape_map = cgal_shape.property_map<MyMesh::Edge_index, IntersectingElemnt>(edge_shape_map_name).first;
- auto face_shape_map = cgal_shape.property_map<MyMesh::Face_index, IntersectingElemnt>(face_shape_map_name).first;
+ auto edge_shape_map = access_pmap(cgal_shape.property_map<MyMesh::Edge_index, IntersectingElemnt>(edge_shape_map_name));
+ auto face_shape_map = access_pmap(cgal_shape.property_map<MyMesh::Face_index, IntersectingElemnt>(face_shape_map_name));
// bool map for affected edge
using d_prop_bool = CGAL::dynamic_edge_property_t<bool>;
|