OpenLB 1.7
|
#include <stlReader.h>
Public Member Functions | |
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. | |
STLreader (const std::vector< std::vector< T > > meshPoints, T voxelSize, T stlSize=1, int method=2, bool verbose=false, T overlap=0., T max=0.) | |
Constructs a new STLreader from a file. | |
~STLreader () override | |
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 | signedDistance (const Vector< T, 3 > &input) override |
Computes signed distance to closest triangle in direction of the surface normal. | |
Vector< T, 3 > | surfaceNormal (const Vector< T, 3 > &pos, const T meshSize=0) override |
Finds and returns normal of the closest surface (triangle) | |
void | print () |
Prints console output. | |
void | writeSTL (std::string stlName="") |
Writes STL mesh in Si units. | |
void | writeOctree () |
Writes Octree. | |
void | setNormalsOutside () |
Rearranges normals of triangles to point outside of geometry. | |
void | setBoundaryInsideNodes () |
Every octree leaf intersected by the STL will be part of the inside nodes. | |
Octree< T > * | getTree () const |
Returns tree. | |
STLmesh< T > & | getMesh () |
Returns mesh. | |
Public Member Functions inherited from olb::IndicatorF3D< T > | |
virtual Vector< T, 3 > & | getMin () |
virtual Vector< T, 3 > & | getMax () |
virtual bool | distance (T &distance, const Vector< T, 3 > &origin, T precision, const Vector< T, 3 > &direction) |
virtual bool | distance (T &distance, const Vector< T, 3 > &origin, const Vector< T, 3 > &direction, T precision, T pitch) |
virtual bool | distance (T &distance, const Vector< T, 3 > &origin, const Vector< T, 3 > &direction, int iC=-1) |
virtual bool | distance (T &distance, const Vector< T, 3 > &origin) |
virtual bool | distance (T &distance, const T input[]) |
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 | |
virtual bool | rotOnAxis (Vector< T, 3 > &vec_rot, const Vector< T, 3 > &vec, const Vector< T, 3 > &axis, T &theta) |
Rotate vector around axis by angle theta. | |
virtual bool | operator() (bool output[1], const T input[3]) |
Returns true if input is inside the indicator. | |
virtual T | signedDistance (const Vector< T, 3 > &input) |
Returns signed distance to the nearest point on the indicator surface. | |
virtual Vector< T, 3 > | surfaceNormal (const Vector< T, 3 > &pos, const T meshSize) |
Return surface normal. | |
Vector< T, 3 > | surfaceNormal (const Vector< T, 3 > &pos, const T meshSize, std::function< Vector< T, 3 >(const Vector< T, 3 > &)> transformPos) |
Return surface normal after possible translation and rotation. | |
bool | isInsideBox (Vector< T, 3 > point) |
Returns true if point is inside a cube with corners _myMin and _myMax | |
virtual Vector< T, 3 > | getSample (const std::function< T()> &randomness) const |
Public Member Functions inherited from olb::GenericF< T, S > | |
virtual | ~GenericF ()=default |
int | getSourceDim () const |
read only access to member variable _m | |
int | getTargetDim () const |
read only access to member variable _n | |
std::string & | getName () |
read and write access to name | |
std::string const & | getName () const |
read only access to name | |
virtual bool | operator() (T output[], const S input[])=0 |
has to be implemented for 'every' derived class | |
bool | operator() (T output[]) |
wrapper that call the pure virtual operator() (T output[], const S input[]) from above | |
bool | operator() (T output[], S input0) |
bool | operator() (T output[], S input0, S input1) |
bool | operator() (T output[], S input0, S input1, S input2) |
bool | operator() (T output[], S input0, S input1, S input2, S input3) |
Additional Inherited Members | |
Public Types inherited from olb::GenericF< T, S > | |
using | targetType = T |
using | sourceType = S |
Public Attributes inherited from olb::GenericF< T, S > | |
std::shared_ptr< GenericF< T, S > > | _ptrCalcC |
memory management, frees resouces (calcClass) | |
Protected Member Functions inherited from olb::IndicatorF3D< T > | |
IndicatorF3D () | |
Protected Member Functions inherited from olb::GenericF< T, S > | |
GenericF (int targetDim, int sourceDim) | |
Protected Attributes inherited from olb::IndicatorF3D< T > | |
Vector< T, 3 > | _myMin |
Vector< T, 3 > | _myMax |
Definition at line 214 of file stlReader.h.
olb::STLreader< T >::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.
fName | The STL file name |
voxelSize | Voxelsize in SI units |
stlSize | Conversion factor for STL (e.g. STL in mm stlSize=10^-3) |
method | Choose indication method 0: fast, less stable 1: slow, more stable (for untight STLs) |
verbose | Get additional information. |
Find center of tree and move by _voxelSize/4.
Create tree
Compute _myMin, _myMax such that they are the smallest (greatest) Voxel inside the STL.
Indicate nodes of the tree. (Inside/Outside)
Definition at line 713 of file stlReader.hh.
References olb::IndicatorF3D< T >::_myMax, olb::IndicatorF3D< T >::_myMin, olb::GenericF< T, S >::getName(), olb::util::max(), olb::util::nearZero(), olb::util::pow(), and olb::STLreader< T >::print().
olb::STLreader< T >::STLreader | ( | const std::vector< std::vector< T > > | meshPoints, |
T | voxelSize, | ||
T | stlSize = 1, | ||
int | method = 2, | ||
bool | verbose = false, | ||
T | overlap = 0., | ||
T | max = 0. ) |
Constructs a new STLreader from a file.
fName | The STL file name |
voxelSize | Voxelsize in SI units |
stlSize | Conversion factor for STL (e.g. STL in mm stlSize=10^-3) |
method | Choose indication method 0: fast, less stable 1: slow, more stable (for untight STLs) |
verbose | Get additional information. |
Find center of tree and move by _voxelSize/4.
Create tree
Compute _myMin, _myMax such that they are the smallest (greatest) Voxel inside the STL.
Definition at line 794 of file stlReader.hh.
References olb::IndicatorF3D< T >::_myMax, olb::IndicatorF3D< T >::_myMin, olb::GenericF< T, S >::getName(), olb::util::max(), olb::util::nearZero(), olb::util::pow(), olb::STLreader< T >::print(), and olb::STLreader< T >::setNormalsOutside().
|
override |
Definition at line 888 of file stlReader.hh.
|
override |
Computes distance to closest triangle intersection.
Definition at line 1241 of file stlReader.hh.
References olb::Octree< T >::closestIntersection(), olb::util::fabs(), olb::Octree< T >::find(), olb::Octree< T >::intersectRayNode(), olb::norm(), and olb::normalize().
|
inline |
|
inline |
|
override |
Returns whether node is inside or not.
Definition at line 1227 of file stlReader.hh.
void olb::STLreader< T >::print | ( | ) |
Prints console output.
Definition at line 1494 of file stlReader.hh.
void olb::STLreader< T >::setBoundaryInsideNodes | ( | ) |
Every octree leaf intersected by the STL will be part of the inside nodes.
Artificially enlarges all details that would otherwise be cut off by the voxelSize.
Definition at line 1545 of file stlReader.hh.
void olb::STLreader< T >::setNormalsOutside | ( | ) |
Rearranges normals of triangles to point outside of geometry.
Definition at line 1523 of file stlReader.hh.
References olb::util::sqrt().
|
override |
Computes signed distance to closest triangle in direction of the surface normal.
Definition at line 1467 of file stlReader.hh.
References olb::norm_squared(), and olb::util::sqrt().
|
override |
Finds and returns normal of the closest surface (triangle)
Definition at line 1488 of file stlReader.hh.
void olb::STLreader< T >::writeOctree | ( | ) |
void olb::STLreader< T >::writeSTL | ( | std::string | stlName = "" | ) |
Writes STL mesh in Si units.
Definition at line 1512 of file stlReader.hh.