Commit b63ccbbd authored by Lionel Untereiner's avatar Lionel Untereiner

some changes in the tetra management

parent c96106aa
......@@ -45,9 +45,9 @@ bool isEdgeConvexe(typename PFP::MAP& map, Dart d, const VertexAttribute<typenam
const VEC3 e = Algo::Geometry::vectorOutOfDart<PFP>(map, map.phi1(map.phi2(d)), position) ;
if((e * n) > 0)
return false;
else
return true;
else
return false;
}
} // namespace Geometry
......
......@@ -35,6 +35,7 @@ namespace Algo
namespace Modelisation
{
//TODO change namespace
namespace Tetrahedralization
{
......
......@@ -347,7 +347,7 @@ template <typename VEC3>
Intersection intersectionSegmentTriangle(const VEC3& PA, const VEC3& PB, const VEC3& Ta, const VEC3& Tb, const VEC3& Tc, VEC3& Inter)
{
typedef typename VEC3::DATA_TYPE T ;
const T precision = std::numeric_limits<T>::min();
const T precision = 0.0001;//std::numeric_limits<T>::min();
VEC3 u = Tb - Ta ;
VEC3 v = Tc - Ta ;
......@@ -381,9 +381,18 @@ Intersection intersectionSegmentTriangle(const VEC3& PA, const VEC3& PB, const V
// get and test parametric coords
T s = ((uv * wv) - (vv * wu)) / D ;
if(s <= precision)
s = 0.0f;
if(s < T(0) || s > T(1))
return NO_INTERSECTION ;
T t = ((uv * wu) - (uu * wv)) / D ;
if(t <= precision)
t = 0.0f;
if(t < T(0) || (s + t) > T(1))
return NO_INTERSECTION ;
......
......@@ -452,6 +452,15 @@ void EmbeddedMap3::splitVolume(std::vector<Dart>& vd)
copyDartEmbedding<VERTEX>(phi2(dit), phi1(dit));
}
// embed the edge embedded from the origin volume to the new darts
if(isOrbitEmbedded<EDGE2>())
{
setOrbitEmbeddingOnNewCell<EDGE2>(dit23) ;
copyCell<EDGE2>(dit23, dit) ;
copyDartEmbedding<EDGE2>(phi2(dit), dit);
}
// embed the edge embedded from the origin volume to the new darts
if(isOrbitEmbedded<EDGE>())
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment