#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 --> inheritance is used //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); // call private function with same name to test it bool merge_intersection(SurfaceCut &sc1, const SurfaceCut &sc2); /// /// Merge surface cuts int one /// /// input SurfaceCut merge(SurfaceCuts&& cuts); /// /// Cut surface shape from models. /// /// Multiple shape to cut from model /// Multi mesh to cut, need to be in same coordinate system /// Define transformation 2d shape into 3d /// Define ideal ratio between front and back projection to cut /// 0 .. means use closest to front projection /// 1 .. means use closest to back projection /// value from <0, 1> /// /// Cutted surface from model SurfaceCut cut_surface(const ExPolygons &shapes, const std::vector &models, const Emboss::IProjection &projection, float projection_ratio); /// /// 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::IProject3f &projection); } // namespace Slic3r #endif // slic3r_CutSurface_hpp_