2019-11-01 14:31:26 +00:00
|
|
|
#ifndef OPENVDBUTILS_HPP
|
|
|
|
#define OPENVDBUTILS_HPP
|
2019-10-31 13:36:33 +00:00
|
|
|
|
|
|
|
#include <libslic3r/TriangleMesh.hpp>
|
2019-11-05 13:48:00 +00:00
|
|
|
#include <libslic3r/SLA/SLACommon.hpp>
|
2019-10-31 13:36:33 +00:00
|
|
|
#include <openvdb/openvdb.h>
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2019-11-05 13:48:00 +00:00
|
|
|
openvdb::FloatGrid::Ptr meshToVolume(const TriangleMesh & mesh,
|
|
|
|
const openvdb::math::Transform &tr = {},
|
2019-11-05 08:43:42 +00:00
|
|
|
float exteriorBandWidth = 3.0f,
|
|
|
|
float interiorBandWidth = 3.0f,
|
2019-11-05 13:48:00 +00:00
|
|
|
int flags = 0);
|
2019-10-31 13:36:33 +00:00
|
|
|
|
2019-11-06 12:38:43 +00:00
|
|
|
TriangleMesh volumeToMesh(const openvdb::FloatGrid &grid,
|
|
|
|
double isovalue = 0.0,
|
|
|
|
double adaptivity = 0.0,
|
|
|
|
bool relaxDisorientedTriangles = true);
|
|
|
|
|
2019-11-08 08:21:30 +00:00
|
|
|
using HollowingFilter = std::function<void(openvdb::FloatGrid& grid, double thickness, double scale)>;
|
|
|
|
|
2019-11-06 12:38:43 +00:00
|
|
|
// Generate an interior for any solid geometry maintaining a given minimum
|
|
|
|
// wall thickness. The returned mesh has triangles with normals facing inside
|
|
|
|
// the mesh so the result can be directly merged with the input to finish the
|
|
|
|
// hollowing.
|
|
|
|
TriangleMesh hollowed_interior(const TriangleMesh &mesh, double min_thickness,
|
2019-11-08 08:21:30 +00:00
|
|
|
double quality = 0.5,
|
|
|
|
HollowingFilter filt = nullptr);
|
2019-10-31 13:36:33 +00:00
|
|
|
|
|
|
|
} // namespace Slic3r
|
|
|
|
|
2019-11-01 14:31:26 +00:00
|
|
|
#endif // OPENVDBUTILS_HPP
|