OpenLB 1.7
|
#include <blockLatticeSTLreader.h>
Public Member Functions | |
BlockLatticeSTLreader (CuboidGeometry3D< T > &cbg3d, LoadBalancer< T > &hlb, const std::string fName, T voxelSize, T stlSize=1, int method=2, bool verbose=false, T overlap=0., T max=0.) | |
Constructs a new BlockLatticeSTLreader from a file. | |
BlockLatticeSTLreader (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 BlockLatticeSTLreader from a file. | |
~BlockLatticeSTLreader () 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 (int locC, const Vector< T, 3 > &input) |
Computes signed distance to closest triangle in direction of the surface normal in local cuboid locC. | |
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 54 of file blockLatticeSTLreader.h.
olb::BlockLatticeSTLreader< T >::BlockLatticeSTLreader | ( | CuboidGeometry3D< T > & | cbg3d, |
LoadBalancer< T > & | hlb, | ||
const std::string | fName, | ||
T | voxelSize, | ||
T | stlSize = 1, | ||
int | method = 2, | ||
bool | verbose = false, | ||
T | overlap = 0., | ||
T | max = 0. ) |
Constructs a new BlockLatticeSTLreader 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 51 of file blockLatticeSTLreader.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::BlockLatticeSTLreader< T >::print().
olb::BlockLatticeSTLreader< T >::BlockLatticeSTLreader | ( | 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 BlockLatticeSTLreader 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 156 of file blockLatticeSTLreader.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::BlockLatticeSTLreader< T >::print().
|
override |
Definition at line 248 of file blockLatticeSTLreader.hh.
|
override |
Computes distance to closest triangle intersection.
Definition at line 601 of file blockLatticeSTLreader.hh.
References olb::Octree< T >::closestIntersection(), olb::util::fabs(), olb::Octree< T >::find(), olb::Octree< T >::intersectRayNode(), olb::norm(), and olb::normalize().
|
inline |
Returns mesh.
Definition at line 179 of file blockLatticeSTLreader.h.
|
inline |
Returns tree.
Definition at line 172 of file blockLatticeSTLreader.h.
|
override |
Returns whether node is inside or not.
Definition at line 587 of file blockLatticeSTLreader.hh.
void olb::BlockLatticeSTLreader< T >::print | ( | ) |
Prints console output.
Definition at line 842 of file blockLatticeSTLreader.hh.
void olb::BlockLatticeSTLreader< 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 893 of file blockLatticeSTLreader.hh.
void olb::BlockLatticeSTLreader< T >::setNormalsOutside | ( | ) |
Rearranges normals of triangles to point outside of geometry.
Definition at line 871 of file blockLatticeSTLreader.hh.
References olb::util::sqrt().
|
override |
Computes signed distance to closest triangle in direction of the surface normal.
Definition at line 818 of file blockLatticeSTLreader.hh.
T olb::BlockLatticeSTLreader< T >::signedDistance | ( | int | locC, |
const Vector< T, 3 > & | input ) |
Computes signed distance to closest triangle in direction of the surface normal in local cuboid locC.
Definition at line 787 of file blockLatticeSTLreader.hh.
References olb::util::dotProduct3D(), olb::util::fabs(), olb::STLtriangle< T >::getNormal(), olb::util::min(), olb::norm(), and olb::normalize().
|
override |
Finds and returns normal of the closest surface (triangle)
Definition at line 836 of file blockLatticeSTLreader.hh.
void olb::BlockLatticeSTLreader< T >::writeOctree | ( | ) |
Writes Octree.
Definition at line 854 of file blockLatticeSTLreader.hh.
void olb::BlockLatticeSTLreader< T >::writeSTL | ( | std::string | stlName = "" | ) |
Writes STL mesh in Si units.
Definition at line 860 of file blockLatticeSTLreader.hh.