Commit 60beb9e6 authored by untereiner's avatar untereiner

volumetric sqrt(3) subdivision refinements

parent 61df65ee
......@@ -28,6 +28,7 @@
#include <math.h>
#include <vector>
#include "Geometry/plane_3d.h"
#include "Algo/Modelisation/tetrahedralization.h"
namespace CGoGN
{
......
......@@ -640,8 +640,12 @@ void sqrt3Vol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& posit
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);
Traversor3WF<typename PFP::MAP> tWF(map, dit);
for(Dart ditWF = tWF.begin() ; ditWF != tWF.end() ; ditWF = tWF.next())
{
if(!map.isBoundaryFace(ditWF))
m.markOrbit<FACE>(ditWF);
}
Algo::Modelisation::Tetrahedralization::flip1To4<PFP>(map, dit, position);
}
......@@ -667,6 +671,13 @@ void sqrt3Vol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& posit
{
if(map.isBoundaryVolume(dit))
{
Traversor3WE<typename PFP::MAP> tWE(map, dit);
for(Dart ditWE = tWE.begin() ; ditWE != tWE.end() ; ditWE = tWE.next())
{
if(map.isBoundaryEdge(ditWE))
m.markOrbit<EDGE>(ditWE);
}
Algo::Modelisation::Tetrahedralization::flip1To3<PFP>(map, dit, position);
}
}
......@@ -674,6 +685,19 @@ void sqrt3Vol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& posit
//
// edge-removal on all old boundary edges
//
TraversorE<typename PFP::MAP> tE(map,selected);
for(Dart dit = tE.begin() ; dit != tE.end() ; dit = tE.next())
{
if(m.isMarked(dit))
{
m.unmarkOrbit<EDGE>(dit);
//std::cout << " nb F of E : " << map.template degree<typename PFP::MAP,EDGE,FACE>(dit) << std::endl;
Dart d = map.phi2(map.phi3(map.findBoundaryFaceOfEdge(dit)));
Algo::Modelisation::Tetrahedralization::swapGen3To2<PFP>(map, d);
}
}
}
......
......@@ -25,6 +25,7 @@
#ifndef __TETRAHEDRALIZATION_H__
#define __TETRAHEDRALIZATION_H__
namespace CGoGN
{
......@@ -37,22 +38,22 @@ namespace Modelisation
namespace Tetrahedralization
{
/**
* subdivide a hexahedron into 5 tetrahedron
*/
template <typename PFP>
void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d);
/**
* WARNING : assume all volumes to be hexahedrons
* subdivide a hexahedron mesh into a tetrahedron mesh
*/
template <typename PFP>
void hexahedronsToTetrahedrons(typename PFP::MAP& map);
template <typename PFP>
void tetrahedrizeVolume(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& position);
///**
//* subdivide a hexahedron into 5 tetrahedron
//*/
//template <typename PFP>
//void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d);
//
///**
//* WARNING : assume all volumes to be hexahedrons
//* subdivide a hexahedron mesh into a tetrahedron mesh
//*/
//template <typename PFP>
//void hexahedronsToTetrahedrons(typename PFP::MAP& map);
//
//
//template <typename PFP>
//void tetrahedrizeVolume(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& position);
/************************************************************************************************
* Collapse / Split Operators *
......@@ -123,6 +124,20 @@ Dart swap2To3(typename PFP::MAP& map, Dart d);
template <typename PFP>
Dart swap5To4(typename PFP::MAP& map, Dart d);
//!
/*!
* called edge removal (equivalent to G32)
*/
template <typename PFP>
void swapGen3To2(typename PFP::MAP& map, Dart d);
//!
/*!
* called multi-face removal (equivalent to G23 )
*/
template <typename PFP>
void swapGen2To3(typename PFP::MAP& map, Dart d);
/************************************************************************************************
* Flip Functions *
************************************************************************************************/
......
......@@ -551,7 +551,7 @@ void Map2::splitSurface(std::vector<Dart>& vd, bool firstSideClosed, bool second
//unsew the edge path
for(std::vector<Dart>::iterator it = vd.begin() ; it != vd.end() ; ++it)
{
if(!Map2::isBoundaryEdge(*it))
//if(!Map2::isBoundaryEdge(*it))
unsewFaces(*it) ;
}
......
......@@ -940,7 +940,8 @@ unsigned int Map3::edgeDegree(Dart d)
Dart it = d;
do
{
++deg;
if(!isBoundaryMarked(it))
++deg;
it = alpha2(it);
} while(it != d);
return deg;
......
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