#ifndef slic3r_CutSurface_hpp_ #define slic3r_CutSurface_hpp_ #include #include #include #include // indexed_triangle_set #include "Polygon.hpp" #include "ExPolygon.hpp" #include "Emboss.hpp" namespace Slic3r{ /// /// Represents cutted surface from object /// Extend index triangle set by outlines /// struct SurfaceCut : public indexed_triangle_set { // connected cutted surface indexed_triangle_set mesh; // vertex indices(index to mesh vertices) using Index = unsigned int; using CutContour = std::vector>; // list of circulated open surface CutContour contours; // Conversion map from vertex index to contour point // Could be used for filtration of surface cuts // Still I don't have an idea how to filtrate it. // What is wanted result on wave? // std::map vertex2contour; }; using SurfaceCuts = std::vector; /// /// Merge two surface cuts together /// Added surface cut will be consumed /// /// Surface cut to extend /// Surface cut to consume void append(SurfaceCut &sc, SurfaceCut &&sc_add); /// /// Merge surface cuts int one /// /// input SurfaceCut merge(SurfaceCuts&& cuts); /// /// Cut surface shape from model. /// IMPROVE1: It is possible to prefiltrate model triangles befor cut.(AABB) /// IMPROVE2: Make a cut by quad. Two triangles are possible slower but it is question for profiler. /// /// Mesh to cut /// Multiple shape to cut from model /// Define transformation from 2d coordinate of shape to 3d /// Cutted surface from model SurfaceCuts cut_surface(const indexed_triangle_set &model, const ExPolygons &shapes, const Emboss::IProject &projection); /// /// Create model from surface cuts by projection /// /// Surfaces from model /// Way of emboss /// Mesh indexed_triangle_set cuts2model(const SurfaceCuts &cuts, const Emboss::IProject &projection); /// /// Create model from surface cuts by projection /// /// Surface from model with outlines /// Way of emboss /// Mesh indexed_triangle_set cut2model(const SurfaceCut &cut, const Emboss::IProject &projection); } // namespace Slic3r #endif // slic3r_CutSurface_hpp_