Loading...
Searching...
No Matches
ImplicitTriangleMesh3.hpp
Go to the documentation of this file.
1// This code is based on Jet framework.
2// Copyright (c) 2018 Doyub Kim
3// CubbyFlow is voxel-based fluid simulation engine for computer games.
4// Copyright (c) 2020 CubbyFlow Team
5// Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6// AI Part: Dongheon Cho, Minseo Kim
7// We are making my contributions/submissions to this project solely in our
8// personal capacity and are not conveying any rights to any intellectual
9// property of any third parties.
10
11#ifndef CUBBYFLOW_IMPLICIT_TRIANGLE_MESH3_HPP
12#define CUBBYFLOW_IMPLICIT_TRIANGLE_MESH3_HPP
13
18
19namespace CubbyFlow
20{
31{
32 public:
33 class Builder;
34
37 size_t resolutionX = 32, double margin = 0.2,
39 bool _isNormalFlipped = false);
40
43
46
49
52
55 default;
56
59
62
63 private:
64 [[nodiscard]] Vector3D ClosestPointLocal(
66
67 [[nodiscard]] double ClosestDistanceLocal(
69
70 [[nodiscard]] bool IntersectsLocal(const Ray3D& ray) const override;
71
72 [[nodiscard]] BoundingBox3D BoundingBoxLocal() const override;
73
74 [[nodiscard]] Vector3D ClosestNormalLocal(
76
77 [[nodiscard]] double SignedDistanceLocal(
79
80 [[nodiscard]] SurfaceRayIntersection3 ClosestIntersectionLocal(
82
83 TriangleMesh3Ptr m_mesh;
85 CustomImplicitSurface3Ptr m_customImplicitSurface;
86};
87
90
95{
96 public:
99
102
105
108
111
112 private:
113 TriangleMesh3Ptr m_mesh;
114 size_t m_resolutionX = 32;
115 double m_margin = 0.2;
116};
117} // namespace CubbyFlow
118
119#endif
N-D axis-aligned bounding box class.
Definition BoundingBox.hpp:47
Abstract base class for N-D implicit surface.
Definition ImplicitSurface.hpp:21
Front-end to create ImplicitTriangleMesh3 objects step by step.
Definition ImplicitTriangleMesh3.hpp:95
Builder & WithTriangleMesh(const TriangleMesh3Ptr &mesh)
Returns builder with triangle mesh.
ImplicitTriangleMesh3Ptr MakeShared() const
Builds shared pointer of ImplicitTriangleMesh3 instance.
Builder & WithMargin(double margin)
Returns builder with margin around the mesh.
Builder & WithResolutionX(size_t resolutionX)
Returns builder with resolution in x axis.
ImplicitTriangleMesh3 Build() const
Builds ImplicitTriangleMesh3.
TriangleMesh3 to ImplicitSurface3 converter.
Definition ImplicitTriangleMesh3.hpp:31
ImplicitTriangleMesh3(const ImplicitTriangleMesh3 &)=default
Default copy constructor.
ImplicitTriangleMesh3(ImplicitTriangleMesh3 &&) noexcept=default
Default move constructor.
const VertexCenteredScalarGrid3Ptr & GetGrid() const
Returns grid data.
ImplicitTriangleMesh3(TriangleMesh3Ptr mesh, size_t resolutionX=32, double margin=0.2, const Transform3 &_transform=Transform3{}, bool _isNormalFlipped=false)
Constructs an ImplicitSurface3 with mesh and other grid parameters.
static Builder GetBuilder()
Returns builder fox ImplicitTriangleMesh3.
Definition Matrix.hpp:30
Class for N-D ray.
Definition Ray.hpp:26
Base class for N-D surface builder.
Definition Surface.hpp:154
Represents N-D rigid body transform.
Definition Transform.hpp:83
Definition pybind11Utils.hpp:21
std::shared_ptr< VertexCenteredScalarGrid3 > VertexCenteredScalarGrid3Ptr
Shared pointer for the VertexCenteredScalarGrid3 type.
Definition VertexCenteredScalarGrid.hpp:107
std::shared_ptr< ImplicitTriangleMesh3 > ImplicitTriangleMesh3Ptr
Shared pointer for the ImplicitTriangleMesh3 type.
Definition ImplicitTriangleMesh3.hpp:89
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
std::shared_ptr< TriangleMesh3 > TriangleMesh3Ptr
Shared pointer for the TriangleMesh3 type.
Definition TriangleMesh3.hpp:250
std::shared_ptr< CustomImplicitSurface3 > CustomImplicitSurface3Ptr
Shared pointer type for the CustomImplicitSurface3.
Definition CustomImplicitSurface.hpp:102
Struct that represents ray-surface intersection point.
Definition Surface.hpp:26