Merge branch 'tm_slice_func'

This commit is contained in:
tamasmeszaros 2019-12-05 13:38:33 +01:00
commit 60758abbb4

View File

@ -198,6 +198,29 @@ private:
void make_expolygons(std::vector<IntersectionLine> &lines, const float closing_radius, ExPolygons* slices) const;
};
inline void slice_mesh(
const TriangleMesh & mesh,
const std::vector<float> & z,
std::vector<Polygons> & layers,
TriangleMeshSlicer::throw_on_cancel_callback_type thr = nullptr)
{
if (mesh.empty()) return;
TriangleMeshSlicer slicer(&mesh);
slicer.slice(z, &layers, thr);
}
inline void slice_mesh(
const TriangleMesh & mesh,
const std::vector<float> & z,
std::vector<ExPolygons> & layers,
float closing_radius,
TriangleMeshSlicer::throw_on_cancel_callback_type thr = nullptr)
{
if (mesh.empty()) return;
TriangleMeshSlicer slicer(&mesh);
slicer.slice(z, closing_radius, &layers, thr);
}
TriangleMesh make_cube(double x, double y, double z);
// Generate a TriangleMesh of a cylinder