53template<
typename T,
unsigned D>
92 std::vector<Vertex<T,3> >
point;
156 const std::string _fName;
158 std::vector<STLtriangle<T> > _triangles;
179 STLmesh(
const std::vector<std::vector<T>> meshPoints, T stlSize = 1.);
184 return _triangles[i];
194 return _triangles.size();
257 void indicate2_Xray();
262 void indicate2_Yray();
272 template <
typename F>
273 void iterateOverCloseTriangles(
const PhysR<T,3>& pt, F func,
Octree<T>* leafNode =
nullptr);
281 template <SignMode SIGNMODE>
297 template <SignMode SIGNMODE>
300template<SignMode SIGNMODE>
314 short evalSignForSignedDistanceFromWindingNumber(
const Vector<T,3>& pt);
317 short evalSignForSignedDistanceFromCache(
const Vector<T,3>& pt);
328 const std::string _fName;
349 bool verbose =
false, T overlap=0., T max=0.);
361 bool verbose =
false, T overlap=0., T max=0.);
384 template <SignMode SIGNMODE>
394 template <SignMode SIGNMODE>
IndicatorF3D is an application from .
virtual bool normal(Vector< S, 3 > &normal, const Vector< S, 3 > &origin, const Vector< S, 3 > &direction, int iC=-1)
returns true and the normal if there was one found for an given origin and direction
class for marking output with some text
STLmesh(std::string, T stlSize=1.)
Constructs a new STLmesh from a file.
bool testRayIntersect(const std::set< unsigned int > &tris, const Vector< T, 3 > &pt, const Vector< T, 3 > &dir, Vector< T, 3 > &q, T &alpha)
Compute intersection between Ray and set of triangles; returns true if intersection is found.
STLtriangle< T > & getTri(unsigned int i)
Returns reference to a triangle.
float maxDist2() const
Returns maxDist squared.
Vector< T, 3 > & getMin()
Returns _min.
void print(bool full=false)
Prints console output.
STLmesh(const std::vector< std::vector< T > > meshPoints, T stlSize=1.)
Constructs a new STLmesh from a file.
std::vector< STLtriangle< T > > & getTriangles()
Returns reference to all triangles.
unsigned int triangleSize() const
Returns number of triangles.
Vector< T, 3 > & getMax()
Returns _max.
void write(std::string fName)
Writes STL mesh in Si units.
T signedDistance(const Vector< T, 3 > &input) override
Computes signed distance to closest triangle in direction of the surface normal Using the cached info...
void print()
Prints console output.
void writeSTL(std::string stlName="")
Writes STL mesh in Si units.
bool isInsideRootTree(const T input[])
Returns whether node is inside the top-level octree or not.
void setNormalsOutside()
Rearranges normals of triangles to point outside of geometry.
Vector< T, 3 > surfaceNormal(const Vector< T, 3 > &pos, const T meshSize=0) override
Finds and returns normal of the closest surface (triangle) Using the cached information (faster,...
STLmesh< T > & getMesh()
Returns mesh.
Vector< T, 3 > closestPointInBoundingBox(const Vector< T, 3 > &input)
Returns the closest point in the bounding box If input is already inside, then it returns input.
Vector< T, 3 > surfaceNormal(const Vector< T, 3 > &pos, const T meshSize=0)
Finds and returns normal of the closest surface (triangle)
void setBoundaryInsideNodes()
Every octree leaf intersected by the STL will be part of the inside nodes.
STLreader(const std::vector< std::vector< T > > meshPoints, T voxelSize, T stlSize=1, RayMode method=RayMode::FastRayZ, bool verbose=false, T overlap=0., T max=0.)
Constructs a new STLreader from a file.
Vector< T, 3 > surfaceNormalExact(const Vector< T, 3 > &pos, const T meshSize=0) override
Finds and returns normal of the closest surface (triangle) Much slower, but more accurate.
STLreader(const std::string fName, T voxelSize, T stlSize=1, RayMode method=RayMode::FastRayZ, bool verbose=false, T overlap=0., T max=0.)
Constructs a new STLreader from a file.
bool operator()(bool output[], const T input[]) override
Returns whether node is inside or not.
bool distance(T &distance, const Vector< T, 3 > &origin, const Vector< T, 3 > &direction, int iC=-1) override
Computes distance to closest triangle intersection.
T signedDistanceExact(const Vector< T, 3 > &input) override
Computes exact signed distance to closest triangle in direction of the surface normal Much slower,...
T signedDistance(const Vector< T, 3 > &input)
Computes signed distance to closest triangle in direction of the surface normal.
Octree< T > * getTree() const
Returns tree.
void writeOctree()
Writes Octree.
This file contains indicator functions.
Top level namespace for all of OpenLB.
SignMode
Enum class that specifies the mode to use for computing the sign of the signed distance.
@ DoubleRay
Indicate function with ray in Y-direction(faster, less stable).
@ FastRayX
Old indicate function (slower, more stable)
@ FastRayY
Indicate function with ray in X-direction(faster, less stable).
@ Robust
Indicate function with ray in Z-direction(faster, less stable). Default option.
std::vector< T > getE0()
Returns Pt0-Pt1.
STLtriangle(STLtriangle< T > const &tri)
CopyConstructor copies.
STLtriangle()
Constructor constructs.
std::vector< T > getE1()
Returns Pt0-Pt2.
Vector< T, 3 > uBeta
variables explained in http://www.uninformativ.de/bin/RaytracingSchnitttests-76a577a-CC-BY....
Vector< T, 3 > normal
normal of triangle
std::vector< Vertex< T, 3 > > point
A triangle contains 3 Points.
bool testRayIntersect(const Vector< T, 3 > &pt, const Vector< T, 3 > &dir, Vector< T, 3 > &q, T &alpha, const T &rad=T(), bool print=false)
Test intersection between ray and triangle.
bool getPointToEdgeDistances(const Vector< T, 3 > &input, Vector< T, 3 > &output, T sensitivity=1.e-15)
Returns true if the point is on a edge (smaller than sensitivity) and gives the perpendicular distanc...
void init()
Initializes triangle and precomputes member variables.
bool isVortexPoint(const Vector< T, 3 > &input, Vector< T, 3 > &P, T sensitivity=1.e-15)
Returns true if is near vortex (smaller than sensitivity) and saves in P the vortex points.
Vector< T, 3 > getCenter()
Returns center.
Vector< T, 3 > & getNormal()
Return write access to normal.
bool isEdgePoint(const Vector< T, 3 > &input, Vector< T, 3 > &P1, Vector< T, 3 > &P2, T sensitivity=1.e-15)
Returns true if is near edge (smaller than sensitivity) and not near vortex and saves in P1 and P2 th...
Vector< T, 3 > closestPtPointTriangle(const Vector< T, 3 > &pt) const
const Vector< T, 3 > & getNormal() const
Return read access to normal.
STLtriangle< T > & operator=(STLtriangle< T > const &tri)
Operator= equals.
std::vector< Vector< T, 3 > > point
A triangle contains 3 Points.
bool isPointInside(const PhysR< T, 3 > &pt) const
Check whether a point is inside a triangle.
int getDim() const
Get dimension.
Vertex()
Constructor constructs.
Vertex(Vector< T, D > coords_)
Vertex(Vertex< T, D > const &rhs)(rhs)
CopyConstructor copies.
Vertex< T, D > & operator=(Vertex< T, D > const &rhs)
Operator= equals.
Vector< T, D > coords
Point coordinates in SI units.
efficient implementation of a vector class