#ifndef slic3r_CutSurface_hpp_ #define slic3r_CutSurface_hpp_ #include #include // indexed_triangle_set #include "ExPolygon.hpp" #include "Emboss.hpp" // IProjection namespace Slic3r{ /// /// Represents cutted surface from object /// Extend index triangle set by outlines /// struct SurfaceCut : public indexed_triangle_set { // vertex indices(index to mesh vertices) using Index = unsigned int; using Contour = std::vector; using Contours = std::vector; // list of circulated open surface Contours contours; }; /// /// 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::IProject3d &projection); /// /// Separate (A)rea (o)f (I)nterest .. AoI from model /// NOTE: Only 2d filtration, do not filtrate by Z coordinate /// /// Input model /// Bounding box to project into space /// Define tranformation of BB into space /// Triangles lay at least partialy inside of projected Bounding box indexed_triangle_set its_cut_AoI(const indexed_triangle_set &its, const BoundingBox &bb, const Emboss::IProjection &projection); /// /// Separate triangles by mask /// /// Input model /// Mask - same size as its::indices /// Copy of indices by mask(with their vertices) indexed_triangle_set its_mask(const indexed_triangle_set &its, const std::vector &mask); bool corefine_test(const std::string &model_path, const std::string &shape_path); } // namespace Slic3r #endif // slic3r_CutSurface_hpp_