Commit c2668883 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

add quads2TrianglesCC function

parent ecac838d
...@@ -45,11 +45,10 @@ namespace Modelisation ...@@ -45,11 +45,10 @@ namespace Modelisation
enum { NONE, GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED }; enum { NONE, GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED };
/** /**
* sudivide the all quads of primtive into 2 triangles * sudivide the all quads of a CC into 2 triangles
* the vertex darts table remain valid (adding only darts, no remove)
*/ */
// template <typename PFP> template <typename PFP>
// void onlyTriangles(typename PFP::MAP& the_map, Dart primd); void quads2TrianglesCC(typename PFP::MAP& the_map, Dart primd);
/** /**
* Create a triangle fans (to close cylinders) * Create a triangle fans (to close cylinders)
......
...@@ -1142,52 +1142,51 @@ void Polyhedron<PFP>::embedHelicoid(float radius_min, float radius_max, float ma ...@@ -1142,52 +1142,51 @@ void Polyhedron<PFP>::embedHelicoid(float radius_min, float radius_max, float ma
} }
} }
// template <typename PFP> template <typename PFP>
// void onlyTriangles(typename PFP::MAP& the_map, Dart primd) void quads2TrianglesCC(typename PFP::MAP& the_map, Dart primd)
// { {
// DartMarker m(the_map); DartMarker m(the_map);
//
// // list of faces to process and processed(before pos iterator) // list of faces to process and processed(before pos iterator)
// std::list<Dart> ld; std::list<Dart> ld;
// ld.push_back(primd); ld.push_back(primd);
// // current position in list // current position in list
// typename std::list<Dart>::iterator pos = ld.begin(); typename std::list<Dart>::iterator pos = ld.begin();
// do do
// { {
// Dart d = *pos; Dart d = *pos;
//
// // cut the face of first dart of list // cut the face of first dart of list
// Dart d1 = the_map.phi1(d); Dart d1 = the_map.phi1(d);
// Dart e = the_map.phi1(d1); Dart e = the_map.phi1(d1);
// Dart e1 = the_map.phi1(e); Dart e1 = the_map.phi1(e);
// Dart f = the_map.phi1(e1); Dart f = the_map.phi1(e1);
// m.markOrbit<FACE>(d); if (f==d) // quad
// if (f==d) // quad {
// { the_map.splitFace(d,e);
// Dart n = the_map.cutFace(d,e); // mark the face
// Dart nn = the_map.phi2(n); m.markOrbit<FACE>(d);
// // mark the face m.markOrbit<FACE>(e);
// m.mark(n); }
// m.mark(nn); else m.markOrbit<FACE>(d);
// }
// // and store neighbours faces in the list
// // and store neighbours faces in the list d = the_map.phi2(d);
// d = the_map.phi2(d); e = the_map.phi2(e);
// e = the_map.phi2(e); d1 = the_map.phi1(the_map.phi2(d1));
// d1 = the_map.phi1(the_map.phi2(d1)); e1 = the_map.phi1(the_map.phi2(e1));
// e1 = the_map.phi1(the_map.phi2(e1));
// if (!m.isMarked(d))
// if (!m.isMarked(d)) ld.push_back(d);
// ld.push_back(d); if (!m.isMarked(e))
// if (!m.isMarked(e)) ld.push_back(e);
// ld.push_back(e); if (!m.isMarked(d1))
// if (!m.isMarked(d1)) ld.push_back(d1);
// ld.push_back(d1); if ((f==d) && (!m.isMarked(e1)))
// if ((f==d) && (!m.isMarked(e1))) ld.push_back(e1);
// ld.push_back(e1); pos++;
// pos++; }while (pos!=ld.end()); // stop when no more face to process
// }while (pos!=ld.end()); // stop when no more face to process }
// }
// template <typename PFP> // template <typename PFP>
// Dart triangleFan_topo(typename PFP::MAP& the_map, int n) // Dart triangleFan_topo(typename PFP::MAP& the_map, int n)
......
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