Reply To: Voxelisation
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › Bug Reports › Voxelisation › Reply To: Voxelisation
Hello,
I have solved my problem by looking in the file “stlReader.hh”. Then I have seen these lines :
template<typename T>
bool STLtriangle<T>::isPointInside(const PhysR<T,3>& pt) const
{
// tests with T=double and T=float show that the epsilon must be increased
const T epsilon = std::numeric_limits<BaseType<T>>::epsilon()*T(10);
const T beta = pt * uBeta + kBeta;
const T gamma = pt * uGamma + kGamma;
// check if approximately equal
if ( util::nearZero(norm(pt – (point[0].coords + beta*(point[1].coords-point[0].coords) + gamma*(point[2].coords-point[0].coords))), epsilon) ) {
const T alpha = T(1) – beta – gamma;
return (beta >= T(0) || util::nearZero(beta, epsilon))
&& (gamma >= T(0) || util::nearZero(gamma, epsilon))
&& (alpha >= T(0) || util::nearZero(alpha, epsilon));
}
return false;
}
There is a first solution which is change the FLOATING_POINT_TYPE in the file “config.mk” from double to float. But the calculation is slower. So, I am trying another solution which is to change the “epsilon” used by the STLreader in two files : “stlReader.hh” and “octree.hh”