Ported test_trianglemesh from upstream slic3r, thanks @lordofhyphens

This commit is contained in:
bubnikv 2019-10-15 13:49:28 +02:00
parent 67e1eba8e6
commit c99e7cb0df
7 changed files with 506 additions and 9 deletions

View file

@ -58,8 +58,14 @@ public:
BoundingBoxf3 bounding_box() const;
// Returns the bbox of this TriangleMesh transformed by the given transformation
BoundingBoxf3 transformed_bounding_box(const Transform3d &trafo) const;
// Return the size of the mesh in coordinates.
Vec3d size() const { return stl.stats.size.cast<double>(); }
/// Return the center of the related bounding box.
Vec3d center() const { return this->bounding_box().center(); }
// Returns the convex hull of this TriangleMesh
TriangleMesh convex_hull_3d() const;
// Slice this mesh at the provided Z levels and return the vector
std::vector<ExPolygons> slice(const std::vector<double>& z);
void reset_repair_stats();
bool needed_repair() const;
void require_shared_vertices();