Commit 3a528102 authored by untereiner's avatar untereiner
Browse files

Tetrahedra swaps: 2-3, 3-2, 2-2, 4-4, 5-4

Tetrahedra flips: 1-3, 1-4
Tetrahedra edge bisection
parent 8ea0bcc9
...@@ -95,6 +95,9 @@ void catmullClarkVol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3> ...@@ -95,6 +95,9 @@ void catmullClarkVol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>
catmullClarkVol<PFP, VertexAttribute<typename PFP::VEC3>, typename PFP::VEC3>(map, position, selected); catmullClarkVol<PFP, VertexAttribute<typename PFP::VEC3>, typename PFP::VEC3>(map, position, selected);
} }
template <typename PFP>
void sqrt3Vol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& position, const FunctorSelect& selected = allDarts);
} // namespace Modelisation } // namespace Modelisation
} // namespace Algo } // namespace Algo
......
...@@ -626,10 +626,57 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec ...@@ -626,10 +626,57 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
// { // {
// map.embedOrbit<VERTEX>(map.phi2(map.phi1(d)), map.getEmbedding<VERTEX>(map.phi2(map.phi1(d)))); // map.embedOrbit<VERTEX>(map.phi2(map.phi1(d)), map.getEmbedding<VERTEX>(map.phi2(map.phi1(d))));
// } // }
}
template <typename PFP>
void sqrt3Vol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& position, const FunctorSelect& selected)
{
DartMarkerStore m(map);
//
// 1-4 flip of all tetrahedra
//
TraversorW<typename PFP::MAP> tW(map,selected);
for(Dart dit = tW.begin() ; dit != tW.end() ; dit = tW.next())
{
if(!map.isBoundaryFace(dit))
m.markOrbit<VOLUME>(dit);
Algo::Modelisation::Tetrahedralization::flip1To4<PFP>(map, dit, position);
}
//
// 2-3 swap of all old interior faces
//
TraversorF<typename PFP::MAP> tF(map,selected);
for(Dart dit = tF.begin() ; dit != tF.end() ; dit = tF.next())
{
if(m.isMarked(dit))
{
m.unmarkOrbit<FACE>(dit);
Algo::Modelisation::Tetrahedralization::swap2To3<PFP>(map, dit);
}
}
//
// 1-3 flip of all boundary tetrahedra
//
TraversorW<typename PFP::MAP> tWb(map,selected);
for(Dart dit = tWb.begin() ; dit != tWb.end() ; dit = tWb.next())
{
if(map.isBoundaryVolume(dit))
{
Algo::Modelisation::Tetrahedralization::flip1To3<PFP>(map, dit, position);
}
}
//
// edge-removal on all old boundary edges
//
} }
} //namespace Modelisation } //namespace Modelisation
} //namespace Algo } //namespace Algo
......
...@@ -50,96 +50,107 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d); ...@@ -50,96 +50,107 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d);
template <typename PFP> template <typename PFP>
void hexahedronsToTetrahedrons(typename PFP::MAP& map); void hexahedronsToTetrahedrons(typename PFP::MAP& map);
template <typename PFP> template <typename PFP>
void tetrahedrizeVolume(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& position); void tetrahedrizeVolume(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& position);
/************************************************************************************************ /************************************************************************************************
* Collapse / Split Operators * Collapse / Split Operators *
************************************************************************************************/ ************************************************************************************************/
//!
/*!
*
*/
template <typename PFP> template <typename PFP>
Dart splitVertex(typename PFP::MAP& map, std::vector<Dart>& vd); Dart splitVertex(typename PFP::MAP& map, std::vector<Dart>& vd);
/************************************************************************************************ /************************************************************************************************
* Tetrahedron functions * * Tetrahedron functions *
************************************************************************************************/ ************************************************************************************************/
/** //!
* test if the volume is a tetrahedron /*!
* @param map *
* @param a dart from the volume
*/ */
template <typename PFP> template <typename PFP>
bool isTetrahedron(typename PFP::MAP& the_map, Dart d, unsigned int thread=0); bool isTetrahedron(typename PFP::MAP& the_map, Dart d, unsigned int thread=0);
/** //!
* test if a mesh (or submesh) is a tetrahedral mesh /*!
* @param map *
* @param selected
*/ */
template <typename PFP> template <typename PFP>
bool isTetrahedralization(typename PFP::MAP& map, const FunctorSelect& selected = allDarts); bool isTetrahedralization(typename PFP::MAP& map, const FunctorSelect& selected = allDarts);
/************************************************************************************************ /************************************************************************************************
* Swap Functions * * Swap Functions *
************************************************************************************************/ ************************************************************************************************/
/** //!
* Swap a configuration of 2 Tetrahedron to another one /*!
* @param map
* @param d a dart from the face between the two tetahedron to swap
* *
* TODO ajouter image
*/ */
template <typename PFP> template <typename PFP>
void swap2To2(typename PFP::MAP& map, Dart d); Dart swap2To2(typename PFP::MAP& map, Dart d);
/** //!
/*!
* *
*/ */
template <typename PFP> template <typename PFP>
void swap4To4(typename PFP::MAP& map, Dart d); void swap4To4(typename PFP::MAP& map, Dart d);
/** //!
* Swap a configuration of 3 tetrahedron to another one with 2 tetrahedron /*!
* @param map
* @param d
*
* TODO ajouter image
* *
*/ */
template <typename PFP> template <typename PFP>
void swap3To2(typename PFP::MAP& map, Dart d); Dart swap3To2(typename PFP::MAP& map, Dart d);
/** //!
/*!
* *
*/ */
template <typename PFP> template <typename PFP>
Dart swap2To3(typename PFP::MAP& map, Dart d); Dart swap2To3(typename PFP::MAP& map, Dart d);
/** //!
/*!
* *
*/ */
template <typename PFP> template <typename PFP>
void swap5To4(typename PFP::MAP& the_map, Dart d, VertexAttribute<typename PFP::VEC3>& positions); Dart swap5To4(typename PFP::MAP& map, Dart d);
/************************************************************************************************ /************************************************************************************************
* Flip Functions * * Flip Functions *
************************************************************************************************/ ************************************************************************************************/
/* //!
/*!
* *
*/ */
template <typename PFP> template <typename PFP>
void flip1To4(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3>& position); Dart flip1To4(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3>& position);
/** //!
/*!
*
*/
template <typename PFP>
Dart flip1To3(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3>& position);
/************************************************************************************************
* Bisection Functions *
************************************************************************************************/
//!
/*!
* *
*/ */
template <typename PFP> template <typename PFP>
void edgeBisection(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3>& position); Dart edgeBisection(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP::VEC3>& position);
} // namespace Tetrahedralization } // namespace Tetrahedralization
......
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