Go to the documentation of this file.
7 #ifndef INCLUDE_JET_CUSTOM_IMPLICIT_SURFACE2_H_
8 #define INCLUDE_JET_CUSTOM_IMPLICIT_SURFACE2_H_
33 double resolution = 1e-3,
34 double rayMarchingResolution = 1e-6,
35 unsigned int numberOfIterations = 5,
46 std::function<double(
const Vector2D&)> _func;
48 double _resolution = 1e-3;
49 double _rayMarchingResolution = 1e-6;
50 unsigned int _maxNumOfIterations = 5;
54 bool intersectsLocal(
const Ray2D& ray)
const override;
60 double signedDistanceLocal(
const Vector2D& otherPoint)
const override;
63 const Ray2D& ray)
const override;
79 const std::function<
double(
const Vector2D&)>& func);
102 std::function<double(
const Vector2D&)> _func;
104 double _resolution = 1e-3;
105 double _rayMarchingResolution = 1e-6;
106 unsigned int _maxNumOfIterations = 5;
111 #endif // INCLUDE_JET_CUSTOM_IMPLICIT_SURFACE2_H_
Custom 2-D implicit surface using arbitrary function.
Definition: custom_implicit_surface2.h:16
Struct that represents ray-surface intersection point.
Definition: surface2.h:19
bool isNormalFlipped
Flips normal.
Definition: surface2.h:33
CustomImplicitSurface2Ptr makeShared() const
Builds shared pointer of CustomImplicitSurface2 instance.
static Builder builder()
Returns builder for CustomImplicitSurface2.
Class for 2-D ray.
Definition: ray2.h:21
Builder & withSignedDistanceFunction(const std::function< double(const Vector2D &)> &func)
Returns builder with custom signed-distance function.
Builder & withDomain(const BoundingBox2D &domain)
Returns builder with domain.
BoundingBox2< double > BoundingBox2D
Double-type 2-D BoundingBox.
Definition: bounding_box2.h:124
Builder & withRayMarchingResolution(double rayMarchingResolution)
CustomImplicitSurface2 build() const
Builds CustomImplicitSurface2.
std::shared_ptr< CustomImplicitSurface2 > CustomImplicitSurface2Ptr
Shared pointer type for the CustomImplicitSurface2.
Definition: custom_implicit_surface2.h:69
Definition: advection_solver2.h:18
Transform2 transform
Local-to-world transform.
Definition: surface2.h:30
Builder & withMaxNumberOfIterations(unsigned int numIter)
2-D vector class.
Definition: vector2.h:24
Base class for 2-D surface builder.
Definition: surface2.h:115
Builder & withResolution(double resolution)
Returns builder with finite differencing resolution.
CustomImplicitSurface2(const std::function< double(const Vector2D &)> &func, const BoundingBox2D &domain=BoundingBox2D(), double resolution=1e-3, double rayMarchingResolution=1e-6, unsigned int numberOfIterations=5, const Transform2 &transform=Transform2(), bool isNormalFlipped=false)
2-D axis-aligned bounding box class.
Definition: bounding_box2.h:41
Front-end to create CustomImplicitSurface2 objects step by step.
Definition: custom_implicit_surface2.h:75
virtual ~CustomImplicitSurface2()
Destructor.
Abstract base class for 2-D implicit surface.
Definition: implicit_surface2.h:15