|
| 1 | +// Copyright (c) 2017 Doyub Kim |
| 2 | +// |
| 3 | +// I am making my contributions/submissions to this project solely in my |
| 4 | +// personal capacity and am not conveying any rights to any intellectual |
| 5 | +// property of any third parties. |
| 6 | + |
| 7 | +#ifndef INCLUDE_JET_ANISOTROPIC_POINTS_TO_IMPLICIT3_H_ |
| 8 | +#define INCLUDE_JET_ANISOTROPIC_POINTS_TO_IMPLICIT3_H_ |
| 9 | + |
| 10 | +#include <jet/points_to_implicit3.h> |
| 11 | + |
| 12 | +namespace jet { |
| 13 | + |
| 14 | +//! |
| 15 | +//! \brief 3-D points-to-implicit converter using Anisotropic kernels. |
| 16 | +//! |
| 17 | +//! This class converts 3-D points to implicit surface using anisotropic kernels |
| 18 | +//! so that the kernels are oriented and stretched to reflect the point |
| 19 | +//! distribution more naturally (thus less bumps). The implementation is based |
| 20 | +//! on Yu and Turk's 2013 paper with some modifications. |
| 21 | +//! |
| 22 | +//! \see Yu, Jihun, and Greg Turk. "Reconstructing surfaces of particle-based |
| 23 | +//! fluids using anisotropic kernels." ACM Transactions on Graphics (TOG) |
| 24 | +//! 32.1 (2013): 5. |
| 25 | +//! |
| 26 | +class AnisotropicPointsToImplicit3 final : public PointsToImplicit3 { |
| 27 | + public: |
| 28 | + //! |
| 29 | + //! \brief Constructs the converter with given parameters. |
| 30 | + //! |
| 31 | + //! \param kernelRadius Kernel radius for interpolations. |
| 32 | + //! \param cutOffDensity Iso-contour density value. |
| 33 | + //! \param positionSmoothingFactor Position smoothing factor. |
| 34 | + //! \param minNumNeighbors Minimum number of neighbors to enable anisotropic |
| 35 | + //! kernel. |
| 36 | + //! |
| 37 | + AnisotropicPointsToImplicit3(double kernelRadius = 1.0, |
| 38 | + double cutOffDensity = 0.5, |
| 39 | + double positionSmoothingFactor = 0.0, |
| 40 | + size_t minNumNeighbors = 25); |
| 41 | + |
| 42 | + //! Converts the given points to implicit surface scalar field. |
| 43 | + void convert(const ConstArrayAccessor1<Vector3D>& points, |
| 44 | + ScalarGrid3* output) const override; |
| 45 | + |
| 46 | + private: |
| 47 | + double _kernelRadius = 1.0; |
| 48 | + double _cutOffDensity = 0.5; |
| 49 | + double _positionSmoothingFactor = 0.0; |
| 50 | + size_t _minNumNeighbors = 25; |
| 51 | +}; |
| 52 | + |
| 53 | +//! Shared pointer for the AnisotropicPointsToImplicit3 type. |
| 54 | +typedef std::shared_ptr<AnisotropicPointsToImplicit3> |
| 55 | + AnisotropicPointsToImplicit3Ptr; |
| 56 | + |
| 57 | +} // namespace jet |
| 58 | + |
| 59 | +#endif // INCLUDE_JET_ANISOTROPIC_POINTS_TO_IMPLICIT3_H_ |
0 commit comments