Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libslic3r/OpenVDBUtils.hpp')
-rw-r--r--src/libslic3r/OpenVDBUtils.hpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/libslic3r/OpenVDBUtils.hpp b/src/libslic3r/OpenVDBUtils.hpp
index bd52e81ee..151647bfc 100644
--- a/src/libslic3r/OpenVDBUtils.hpp
+++ b/src/libslic3r/OpenVDBUtils.hpp
@@ -7,26 +7,37 @@
namespace Slic3r {
-openvdb::FloatGrid::Ptr meshToVolume(const TriangleMesh & mesh,
+inline Vec3f to_vec3f(const openvdb::Vec3s &v) { return Vec3f{v.x(), v.y(), v.z()}; }
+inline Vec3d to_vec3d(const openvdb::Vec3s &v) { return to_vec3f(v).cast<double>(); }
+inline Vec3i to_vec3i(const openvdb::Vec3I &v) { return Vec3i{int(v[0]), int(v[1]), int(v[2])}; }
+inline Vec4i to_vec4i(const openvdb::Vec4I &v) { return Vec4i{int(v[0]), int(v[1]), int(v[2]), int(v[3])}; }
+
+openvdb::FloatGrid::Ptr mesh_to_grid(const TriangleMesh & mesh,
+ const openvdb::math::Transform &tr = {},
+ float exteriorBandWidth = 3.0f,
+ float interiorBandWidth = 3.0f,
+ int flags = 0);
+
+openvdb::FloatGrid::Ptr mesh_to_grid(const sla::Contour3D & mesh,
const openvdb::math::Transform &tr = {},
float exteriorBandWidth = 3.0f,
float interiorBandWidth = 3.0f,
int flags = 0);
-TriangleMesh volumeToMesh(const openvdb::FloatGrid &grid,
+sla::Contour3D grid_to_contour3d(const openvdb::FloatGrid &grid,
+ double isovalue,
+ double adaptivity,
+ bool relaxDisorientedTriangles = true);
+
+TriangleMesh grid_to_mesh(const openvdb::FloatGrid &grid,
double isovalue = 0.0,
double adaptivity = 0.0,
bool relaxDisorientedTriangles = true);
-using HollowingFilter = std::function<void(openvdb::FloatGrid& grid, double thickness, double scale)>;
-
-// 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,
- double quality = 0.5,
- HollowingFilter filt = nullptr);
+openvdb::FloatGrid::Ptr redistance_grid(const openvdb::FloatGrid &grid,
+ double iso,
+ double ext_range = 3.,
+ double int_range = 3.);
} // namespace Slic3r