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 using namespace Slic3r; +template +auto access_pmap(std::optional opt) -> T { + return opt.value(); +} + +template +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(face_map_name).first; - auto vert_shape_map = cgal_object.add_property_map(vert_shape_map_name).first; + auto face_map = access_pmap(cgal_object.property_map(face_map_name)); + auto vert_shape_map = access_pmap(cgal_object.add_property_map(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(edge_shape_map_name).first; - auto face_shape_map = cgal_shape.property_map(face_shape_map_name).first; + auto edge_shape_map = access_pmap(cgal_shape.property_map(edge_shape_map_name)); + auto face_shape_map = access_pmap(cgal_shape.property_map(face_shape_map_name)); // bool map for affected edge using d_prop_bool = CGAL::dynamic_edge_property_t;