diff --git a/analysis/dcel.cpp b/analysis/dcel.cpp index 01e7b571..71f69951 100644 --- a/analysis/dcel.cpp +++ b/analysis/dcel.cpp @@ -1,7 +1,5 @@ #include "analysis/dcel.h" - - DECL::DECL(){ } @@ -369,243 +367,37 @@ double DECL::EdgeAngle(int edge) return angle; } -void Isosurface(DoubleArray &A, const double &v) +void iso_surface(const Array&Field, const double isovalue) { - NULL_USE( v ); - - Point P,Q; - Point PlaceHolder; - Point C0,C1,C2,C3,C4,C5,C6,C7; - - int TriangleCount; - int VertexCount; - int CubeIndex; - - Point VertexList[12]; - Point NewVertexList[12]; - int LocalRemap[12]; - - Point cellvertices[20]; - std::array,20> Triangles; - Triangles.fill( { 0 } ); - - // Values from array 'A' at the cube corners - double CubeValues[8]; - - int Nx = A.size(0); - int Ny = A.size(1); - int Nz = A.size(2); - - // Points corresponding to cube corners - C0.x = 0.0; C0.y = 0.0; C0.z = 0.0; - C1.x = 1.0; C1.y = 0.0; C1.z = 0.0; - C2.x = 1.0; C2.y = 1.0; C2.z = 0.0; - C3.x = 0.0; C3.y = 1.0; C3.z = 0.0; - C4.x = 0.0; C4.y = 0.0; C4.z = 1.0; - C5.x = 1.0; C5.y = 0.0; C5.z = 1.0; - C6.x = 1.0; C6.y = 1.0; C6.z = 1.0; - C7.x = 0.0; C7.y = 1.0; C7.z = 1.0; - - std::vector> HalfEdge; - for (int k=1; kV2 - HalfEdge[idx_edge][0] = V1; // first vertex - HalfEdge[idx_edge][1] = V2; // second vertex - HalfEdge[idx_edge][2] = idx; // triangle - HalfEdge[idx_edge][3] = -1; // twin - HalfEdge[idx_edge][4] = idx_edge+2; // previous edge - HalfEdge[idx_edge][5] = idx_edge+1; // next edge - idx_edge++; - // second edge: V2->V3 - HalfEdge[idx_edge][0] = V2; // first vertex - HalfEdge[idx_edge][1] = V3; // second vertex - HalfEdge[idx_edge][2] = idx; // triangle - HalfEdge[idx_edge][3] = -1; // twin - HalfEdge[idx_edge][4] = idx_edge-1; // previous edge - HalfEdge[idx_edge][5] = idx_edge+1; // next edge - idx_edge++; - // third edge: V3->V1 - HalfEdge[idx_edge][0] = V3; // first vertex - HalfEdge[idx_edge][1] = V1; // second vertex - HalfEdge[idx_edge][2] = idx; // triangle - HalfEdge[idx_edge][3] = -1; // twin - HalfEdge[idx_edge][4] = idx_edge-1; // previous edge - HalfEdge[idx_edge][5] = idx_edge-2; // next edge - idx_edge++; - } - int EdgeCount=idx_edge; - for (int idx=0; idx #include "analysis/pmmc.h" @@ -79,3 +82,7 @@ public: private: std::vector FaceData; }; + +void iso_surface(const Array&Field, const double isovalue); + +#endif