@@ -23,6 +23,7 @@ CommandSplitFaces(Internal::Context& c, std::vector<Topo::CoFace* > &cofaces, Co
2323, m_ratio_dec(ratio_dec)
2424, m_ratio_ogrid(ratio_ogrid)
2525, m_project_on_meshing_edges(project_on_meshing_edges)
26+ , m_cas_2D(true )
2627{
2728#ifdef _DEBUG_SPLIT
2829 std::cout<<" CommandSplitFaces::CommandSplitFaces(" <<cofaces.size ()<<" cofaces, " <<arete->getName ()<<" , " <<ratio_dec<<" , " <<ratio_ogrid<<" , " <<project_on_meshing_edges<<" )" <<std::endl;
@@ -49,6 +50,7 @@ CommandSplitFaces(Internal::Context& c, std::vector<Topo::CoFace* > &cofaces, Co
4950, m_ratio_dec(0 )
5051, m_ratio_ogrid(ratio_ogrid)
5152, m_project_on_meshing_edges(project_on_meshing_edges)
53+ , m_cas_2D(true )
5254{
5355 m_ratio_dec = arete->computeRatio (pt);
5456
@@ -77,6 +79,7 @@ CommandSplitFaces(Internal::Context& c, CoEdge* arete, double ratio_dec, double
7779, m_ratio_dec(ratio_dec)
7880, m_ratio_ogrid(ratio_ogrid)
7981, m_project_on_meshing_edges(project_on_meshing_edges)
82+ , m_cas_2D(true )
8083{
8184#ifdef _DEBUG_SPLIT
8285 std::cout<<" CommandSplitFaces::CommandSplitFaces(" <<arete->getName ()<<" , " <<ratio_dec<<" , " <<ratio_ogrid<<" , " <<project_on_meshing_edges<<" )" <<std::endl;
@@ -93,6 +96,7 @@ CommandSplitFaces(Internal::Context& c, CoEdge* arete, const Point& pt, double r
9396, m_ratio_dec(0 )
9497, m_ratio_ogrid(ratio_ogrid)
9598, m_project_on_meshing_edges(project_on_meshing_edges)
99+ , m_cas_2D(true )
96100{
97101 m_ratio_dec = arete->computeRatio (pt);
98102#ifdef _DEBUG_SPLIT
@@ -114,6 +118,11 @@ void CommandSplitFaces::init(std::vector<Topo::CoFace* > &cofaces)
114118 Topo::CoFace* hcf = *iter;
115119
116120 if (hcf->isStructured ()){
121+ if (hcf->getNbFaces ()) {
122+ // si hcf est 2D, elle n'a pas de face
123+ // et si au moins une coface est 3D, le cas est 3D
124+ m_cas_2D = false ;
125+ }
117126 m_cofaces.push_back (hcf);
118127 verif (hcf);
119128#ifdef _DEBUG_SPLIT
@@ -290,7 +299,9 @@ internalExecute()
290299
291300 std::vector<Edge*> splitingEdges;
292301
293- try {
302+ if (m_cas_2D) {
303+ TopoHelper::splitFaces (m_cofaces, m_arete, m_ratio_dec, m_ratio_ogrid, false , true , splitingEdges, &getInfoCommand ());
304+ } else {
294305 do {
295306 Vertex* sommet = 0 ;
296307 CoFace* coface = 0 ;
@@ -349,9 +360,6 @@ internalExecute()
349360
350361 } while (nb_faces_dep != nb_faces_split);
351362 }
352- catch (const TkUtil::Exception& exc){
353- throw TkUtil::Exception (exc);
354- }
355363
356364 // on replace les sommets en fonction de m_ratio_dec
357365 if (!m_project_on_meshing_edges)
0 commit comments