53template<
typename T,
unsigned D>
92 std::vector<Vertex<T,3> >
point;
137 std::vector<T>
getE0();
139 std::vector<T>
getE1();
149 const std::string _fName;
151 std::vector<STLtriangle<T> > _triangles;
165 STLmesh(std::string, T stlSize = 1.);
172 STLmesh(
const std::vector<std::vector<T>> meshPoints, T stlSize = 1.);
177 return _triangles[i];
187 return _triangles.size();
205 void print(
bool full =
false);
207 void write(std::string fName);
231 void indicate2_Xray();
236 void indicate2_Yray();
261 short evalSignForSignedDistance(
const Vector<T,3>& pt);
272 const std::string _fName;
292 STLreader(
const std::string fName, T voxelSize, T stlSize=1,
int method=2,
293 bool verbose =
false, T overlap=0., T max=0.);
304 STLreader(
const std::vector<std::vector<T>> meshPoints, T voxelSize, T stlSize=1,
int method=2,
305 bool verbose =
false, T overlap=0., T max=0.);
309 bool operator() (
bool output[],
const T input[])
override;
324 void writeSTL(std::string stlName=
"");
IndicatorF3D is an application from .
virtual bool normal(Vector< T, 3 > &normal, const Vector< T, 3 > &origin, const Vector< T, 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.
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.
STLreader(const std::string fName, T voxelSize, T stlSize=1, int method=2, bool verbose=false, T overlap=0., T max=0.)
Constructs a new STLreader from a file.
T signedDistance(const Vector< T, 3 > &input) override
Computes signed distance to closest triangle in direction of the surface normal.
void print()
Prints console output.
void writeSTL(std::string stlName="")
Writes STL mesh in Si units.
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)
STLmesh< T > & getMesh()
Returns mesh.
void setBoundaryInsideNodes()
Every octree leaf intersected by the STL will be part of the inside nodes.
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.
Octree< T > * getTree() const
Returns tree.
void writeOctree()
Writes Octree.
The description of a vector of 3D cuboid – header file.
This file contains indicator functions.
Top level namespace for all of OpenLB.
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.
void init()
Initializes triangle and precomputes member variables.
Vector< T, 3 > getCenter()
Returns center.
Vector< T, 3 > & getNormal()
Return write access to normal.
Vector< T, 3 > closestPtPointTriangle(const Vector< T, 3 > &pt) const
computes closest Point in a triangle to another point.
const Vector< T, 3 > & getNormal() const
Return read access to normal.
STLtriangle< T > & operator=(STLtriangle< T > const &tri)
Operator= equals.
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)
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