14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/volume/api.h>
20#include <lagrange/utils/warnoff.h>
21#include <openvdb/openvdb.h>
22#include <openvdb/tools/Interpolation.h>
23#include <lagrange/utils/warnon.h>
26namespace lagrange::volume {
35 using Grid = openvdb::Vec3SGrid;
36 using Accessor = Grid::ConstAccessor;
49 template <
typename Scalar,
typename Index>
57 Grid::ConstPtr
grid()
const {
return m_grid; }
60 Accessor
accessor()
const {
return m_grid->getConstAccessor(); }
72 bool sample_direction(
73 const Eigen::Vector3d& position,
74 Eigen::Vector3d& direction_out,
75 Accessor* accessor =
nullptr)
const;
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
Grid::ConstPtr grid() const
Return a read-only shared handle to the underlying OpenVDB grid.
Definition SmoothedMeshGradientField.h:57
Accessor accessor() const
Return a read-only accessor to the underlying OpenVDB grid.
Definition SmoothedMeshGradientField.h:60
SmoothedMeshGradientField(const SurfaceMesh< Scalar, Index > &mesh, double voxel_size, double epsilon, double query_reach)
Construct a smoothed gradient field for a triangle surface mesh.
Definition SmoothedMeshGradientField.cpp:33