{"id":736,"date":"2006-11-28T15:08:18","date_gmt":"2006-11-28T07:08:18","guid":{"rendered":"http:\/\/127.0.0.1\/website_linux\/blog\/?p=736"},"modified":"2006-11-28T15:08:18","modified_gmt":"2006-11-28T07:08:18","slug":"%e7%94%a8java3d%e6%94%b9%e5%86%99%e7%9a%84marching-cubes%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/opgogo.com\/blog2\/?p=736","title":{"rendered":"\u7528Java3D\u6539\u5199\u7684Marching Cubes\u7a0b\u5e8f"},"content":{"rendered":"<p>\u4e0b\u9762\u4e24\u4e2a\u6587\u4ef6\u662f\u7528\u4ee5\u524d\u7528Java3D\u6539\u5199\u7684Marching Cubes\u7a0b\u5e8f<\/p>\n<p>\u6587\u4ef6\u4e00 \u6570\u636e\u6587\u4ef6<\/p>\n<p>package isosurface;<\/p>\n<p>\/**<br \/>\n* <\/p>\n<p>Title: Isosurface<\/p>\n<p>*<br \/>\n* <\/p>\n<p>Description: \u7b49\u503c\u9762\u56fe<\/p>\n<p>*<br \/>\n* <\/p>\n<p>Copyright: Copyright (c) 2006<\/p>\n<p>*<br \/>\n* <\/p>\n<p>Company: \u4e2d\u56fd\u79d1\u6280\u5927\u5b66cad\/cam\u5b9e\u9a8c\u5ba4<\/p>\n<p>*<br \/>\n* @author \u738b\u6653\u4e1c<br \/>\n* @version 1.0<br \/>\n*\/<br \/>\npublic class My3DData {<br \/>\npublic int myDataXNum=10; \/\/\u6570\u636e\u6570\u7ec4X\u7ef4\u7684\u6570\u76ee<br \/>\npublic int myDataYNum=10; \/\/\u6570\u636e\u6570\u7ec4Y\u7ef4\u7684\u6570\u76ee<br \/>\npublic int myDataZNum=10; \/\/\u6570\u636e\u6570\u7ec4Z\u7ef4\u7684\u6570\u76ee<br \/>\npublic float[][][] myDataArray=new float[myDataZNum][myDataYNum][myDataXNum]; \/\/\u6570\u636e\u6570\u7ec4\uff0c\u6620\u5c04\u5230\u4e09\u7ef4\u7a7a\u95f4\u4e0a\uff0c[Z][Y][X]<br \/>\npublic float maxData; \/\/\u6570\u636e\u4e2d\u7684\u6700\u5927\u503c<br \/>\npublic float minData; \/\/\u6570\u636e\u4e2d\u7684\u6700\u5c0f\u503c<br \/>\npublic int maxDataXIndex; \/\/\u6700\u5927\u503c\u7684X\u7d22\u5f15\u503c\uff0c\u4ece0\u5230myDataArray[0][0].length-1<br \/>\npublic int maxDataYIndex; \/\/\u6700\u5927\u503c\u7684Y\u7d22\u5f15\u503c\uff0c\u4ece0\u5230myDataArray[0].length-1<br \/>\npublic int maxDataZIndex; \/\/\u6700\u5927\u503c\u7684Z\u7d22\u5f15\u503c\uff0c\u4ece0\u5230myDataArray.length-1<br \/>\npublic int minDataXIndex; \/\/\u6700\u5c0f\u503c\u7684X\u7d22\u5f15\u503c\uff0c\u4ece0\u5230myDataArray[0][0].length-1<br \/>\npublic int minDataYIndex; \/\/\u6700\u5c0f\u503c\u7684Y\u7d22\u5f15\u503c\uff0c\u4ece0\u5230myDataArray[0].length-1<br \/>\npublic int minDataZIndex; \/\/\u6700\u5c0f\u503c\u7684Z\u7d22\u5f15\u503c\uff0c\u4ece0\u5230myDataArray.length-1<\/p>\n<p>public My3DData() {<br \/>\nfor(int i=0;i<myDataZNum;i++){ \/\/Z\u7ef4\u9012\u589e\nfor(int j=0;j<myDataYNum;j++){ \/\/Y\u7ef4\u9012\u589e\nfor(int k=0;k<myDataXNum;k++){ \/\/X\u7ef4\u9012\u589e\n\n\/\/myDataArray[i][j][k]=(float)Math.random();\n\nmyDataArray[i][j][k]=i+j+k; \/\/\u6570\u636e\u6570\u7ec4\u521d\u59cb\u5316\n}\n}\n}\nparseData();\n}\npublic void parseData(){ \/\/\u8ba1\u7b97\u6700\u503c\nmaxData=myDataArray[0][0][0];\nminData=myDataArray[0][0][0];\nmaxDataXIndex=0;\nmaxDataYIndex=0;\nmaxDataZIndex=0;\nminDataXIndex=0;\nminDataYIndex=0;\nminDataZIndex=0;\nfor(int i=0;i<myDataZNum;i++){ \/\/Z\u7ef4\u9012\u589e\nfor(int j=0;j<myDataYNum;j++){ \/\/Y\u7ef4\u9012\u589e\nfor(int k=0;k<myDataXNum;k++){ \/\/X\u7ef4\u9012\u589e\nif(myDataArray[i][j][k]>maxData){ \/\/\u6700\u5927\u503c<br \/>\nmaxData=myDataArray[i][j][k];<br \/>\nmaxDataXIndex=k;<br \/>\nmaxDataYIndex=j;<br \/>\nmaxDataZIndex=i;<br \/>\n}<br \/>\nif(myDataArray[i][j][k]<minData){ \/\/\u6700\u5c0f\u503c\nminData=myDataArray[i][j][k];\nminDataXIndex=k;\nminDataYIndex=j;\nminDataZIndex=i;\n}\n}\n}\n}\n}\n\npublic static void main(String[] args){\nMy3DData myData=new My3DData();\nSystem.out.println(\"\\n\u4e0b\u9762\u662f\u6570\u636e\u6570\u7ec4\u91cc\u7684\u6240\u6709\u6570\u636e\uff1a\\n\");\nfor(int i=0;i<myData.myDataZNum;i++){ \/\/Z\u7ef4\u9012\u589e\nfor(int j=0;j<myData.myDataYNum;j++){ \/\/Y\u7ef4\u9012\u589e\nfor(int k=0;k<myData.myDataXNum;k++){ \/\/X\u7ef4\u9012\u589e\nSystem.out.println(\"myDataArray[\"+i+\"][\"+j+\"][\"+k+\"]=\"+myData.myDataArray[i][j][k]);\n}\nSystem.out.print(\"\\n\");\n}\nSystem.out.print(\"\\n\");\n}\nSystem.out.println(\"\\n\u4e0b\u9762\u662f\u6570\u636e\u6570\u7ec4\u7684\u58f0\u660e\uff0c\u53ef\u4ee5\u77e5\u9053\u6570\u636e\u6570\u7ec4\u7684\u5143\u7d20\u4e2a\u6570\");\nSystem.out.println(\"public float[][][] myDataArray=new float[\"+myData.myDataZNum+\"][\"+myData.myDataYNum+\"][\"+myData.myDataXNum+\"];\");\nSystem.out.println(\"\\n\u4e0b\u9762\u662f\u6570\u636e\u6570\u7ec4\u7684\u6700\u503c\");\nSystem.out.println(\"\u6700\u5927\u503c\uff1amyDataArray[\"+myData.maxDataZIndex+\"][\"+myData.maxDataYIndex+\"][\"+myData.maxDataXIndex+\"]=\"+myData.maxData);\nSystem.out.println(\"\u6700\u5c0f\u503c\uff1amyDataArray[\"+myData.minDataZIndex+\"][\"+myData.minDataYIndex+\"][\"+myData.minDataXIndex+\"]=\"+myData.minData);\n}\n\n}\n\n\n\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\uff0d\n\n\u6587\u4ef6\u4e8c Marching Cubes\u7a0b\u5e8f\n\npackage isosurface;\n\nimport java.awt.*;\nimport java.awt.event.*;\nimport java.applet.*;\nimport javax.swing.*;\nimport javax.swing.event.*;\nimport java.util.*;\nimport com.sun.j3d.utils.applet.*;\nimport com.sun.j3d.utils.geometry.*;\nimport com.sun.j3d.utils.universe.*;\nimport javax.media.j3d.*;\nimport javax.vecmath.*;\nimport com.sun.j3d.utils.behaviors.vp.*;\n\n\/**\n* \n\n<p>Title: Isosurface<\/p>\n<p>*<br \/>\n* <\/p>\n<p>Description: \u7b49\u503c\u9762\u56fe<\/p>\n<p>*<br \/>\n* <\/p>\n<p>Copyright: Copyright (c) 2006<\/p>\n<p>*<br \/>\n* <\/p>\n<p>Company: \u4e2d\u56fd\u79d1\u6280\u5927\u5b66cad\/cam\u5b9e\u9a8c\u5ba4<\/p>\n<p>*<br \/>\n* @author \u738b\u6653\u4e1c<br \/>\n* @version 1.0<br \/>\n*\/<\/p>\n<p>\/\/\u4e09\u89d2\u5f62\uff1a3\u4e2a\u9876\u70b9<br \/>\nclass Triangle {<br \/>\nXYZ[] p = new XYZ[3];<br \/>\n}<\/p>\n<p>\/\/\u7f51\u683c\u7acb\u65b9\u4f53\uff1a8\u4e2a\u9876\u70b9\uff0c8\u4e2a\u6570\u636e\u503c<br \/>\nclass Gridcell {<br \/>\nXYZ[] p = new XYZ[8];<br \/>\ndouble[] val = new double[8];<br \/>\n}<\/p>\n<p>\/\/\u70b9\uff1a\u4e09\u4e2a\u5750\u6807<br \/>\nclass XYZ {<br \/>\ndouble x, y, z;<br \/>\n}<\/p>\n<p>public class IsoSurface<br \/>\nextends Applet {<\/p>\n<p>final double X_MAX = 250.0;<br \/>\nfinal double Y_MAX = 250.0;<br \/>\nfinal double Z_MAX = 250.0;<br \/>\nfinal double X_MIN = -250.0;<br \/>\nfinal double Y_MIN = -250.0;<br \/>\nfinal double Z_MIN = -250.0;<br \/>\nfinal int N_X = 64;\/\/\u6570\u636eX\u7ef4\u5143\u7d20\u4e2a\u6570<br \/>\nfinal int N_Y = 64;\/\/\u6570\u636eY\u7ef4\u5143\u7d20\u4e2a\u6570<br \/>\nfinal int N_Z = 64;\/\/\u6570\u636eZ\u7ef4\u5143\u7d20\u4e2a\u6570<\/p>\n<p>private Vector m_triArray = new Vector();<\/p>\n<p>SimpleUniverse u=null;<\/p>\n<p>boolean isStandalone = false;<br \/>\nBorderLayout borderLayout1 = new BorderLayout();<\/p>\n<p>\/\/Get a parameter value<br \/>\npublic String getParameter(String key, String def) {<br \/>\nreturn isStandalone ? System.getProperty(key, def) :<br \/>\n(getParameter(key) != null ? getParameter(key) : def);<br \/>\n}<\/p>\n<p>\/\/\u521b\u5efa\u573a\u666f\u56fe<br \/>\npublic BranchGroup drawBounds(){<br \/>\n\/\/\u521b\u5efa\u573a\u666f<br \/>\nBranchGroup objRoot=new BranchGroup();<\/p>\n<p>\/\/\u753b\u5305\u56f4\u76d2<br \/>\nPoint3f[] myCoords = new Point3f[24];<br \/>\nmyCoords[0]=new Point3f(-1.0f,1.0f,-1.0f);<br \/>\nmyCoords[1]=new Point3f(1.0f,1.0f,-1.0f);<br \/>\nmyCoords[2]=new Point3f(1.0f,1.0f,-1.0f);<br \/>\nmyCoords[3]=new Point3f(1.0f,-1.0f,-1.0f);<br \/>\nmyCoords[4]=new Point3f(1.0f,-1.0f,-1.0f);<br \/>\nmyCoords[5]=new Point3f(-1.0f,-1.0f,-1.0f);<br \/>\nmyCoords[6]=new Point3f(-1.0f,-1.0f,-1.0f);<br \/>\nmyCoords[7]=new Point3f(-1.0f,1.0f,-1.0f);<\/p>\n<p>myCoords[8]=new Point3f(-1.0f,1.0f,-1.0f);<br \/>\nmyCoords[9]=new Point3f(-1.0f,1.0f,1.0f);<br \/>\nmyCoords[10]=new Point3f(1.0f,1.0f,-1.0f);<br \/>\nmyCoords[11]=new Point3f(1.0f,1.0f,1.0f);<br \/>\nmyCoords[12]=new Point3f(1.0f,-1.0f,-1.0f);<br \/>\nmyCoords[13]=new Point3f(1.0f,-1.0f,1.0f);<br \/>\nmyCoords[14]=new Point3f(-1.0f,-1.0f,-1.0f);<br \/>\nmyCoords[15]=new Point3f(-1.0f,-1.0f,1.0f);<\/p>\n<p>myCoords[16]=new Point3f(-1.0f,1.0f,1.0f);<br \/>\nmyCoords[17]=new Point3f(1.0f,1.0f,1.0f);<br \/>\nmyCoords[18]=new Point3f(1.0f,1.0f,1.0f);<br \/>\nmyCoords[19]=new Point3f(1.0f,-1.0f,1.0f);<br \/>\nmyCoords[20]=new Point3f(1.0f,-1.0f,1.0f);<br \/>\nmyCoords[21]=new Point3f(-1.0f,-1.0f,1.0f);<br \/>\nmyCoords[22]=new Point3f(-1.0f,-1.0f,1.0f);<br \/>\nmyCoords[23]=new Point3f(-1.0f,1.0f,1.0f);<\/p>\n<p>LineArray myLines = new LineArray(myCoords.length,GeometryArray.COORDINATES );<br \/>\nmyLines.setCoordinates( 0, myCoords );<br \/>\nShape3D myShape = new Shape3D( myLines, null );<br \/>\nobjRoot.addChild(myShape) ;<\/p>\n<p>return objRoot;<br \/>\n}<\/p>\n<p>public BranchGroup drawIsoSurface(){<\/p>\n<p>\/\/\u521b\u5efa\u573a\u666f<br \/>\nBranchGroup objRoot=new BranchGroup();<\/p>\n<p>My3DData myData=new My3DData();<br \/>\nint xNum=myData.myDataXNum;<br \/>\nint yNum=myData.myDataYNum;<br \/>\nint zNum=myData.myDataZNum;<\/p>\n<p>System.out.println(&#8220;\\n\u4e0b\u9762\u662f\u6570\u636e\u6570\u7ec4\u7684\u58f0\u660e\uff0c\u53ef\u4ee5\u77e5\u9053\u6570\u636e\u6570\u7ec4\u7684\u5143\u7d20\u4e2a\u6570&#8221;);<br \/>\nSystem.out.println(&#8220;public float[][] myDataArray=new float[&#8220;+zNum+&#8221;][&#8220;+yNum+&#8221;][&#8220;+xNum+&#8221;];&#8221;);<br \/>\nSystem.out.println(&#8220;\\n\u4e0b\u9762\u662f\u6570\u636e\u6570\u7ec4\u7684\u6700\u503c&#8221;);<br \/>\nSystem.out.println(&#8220;\u6700\u5927\u503c\uff1amyDataArray[&#8220;+myData.maxDataZIndex+&#8221;][&#8220;+myData.maxDataYIndex+&#8221;][&#8220;+myData.maxDataXIndex+&#8221;]=&#8221;+myData.maxData);<br \/>\nSystem.out.println(&#8220;\u6700\u5c0f\u503c\uff1amyDataArray[&#8220;+myData.minDataZIndex+&#8221;][&#8220;+myData.minDataYIndex+&#8221;][&#8220;+myData.minDataXIndex+&#8221;]=&#8221;+myData.minData);<br \/>\nSystem.out.println(&#8220;\\n\u8fd9\u4e2a\u7a0b\u5e8f\u53ef\u4ee5\u7528\u9f20\u6807\u63a7\u5236\uff1a&#8221;);<br \/>\nSystem.out.println(&#8220;\u9f20\u6807\u5de6\u952e\u62d6\u52a8 \u65cb\u8f6c\u573a\u666f&#8221;);<br \/>\nSystem.out.println(&#8220;\u9f20\u6807\u4e2d\u952e\u62d6\u52a8 \u7f29\u653e\u573a\u666f&#8221;);<br \/>\nSystem.out.println(&#8220;\u9f20\u6807\u53f3\u952e\u62d6\u52a8 \u5e73\u79fb\u573a\u666f&#8221;);<\/p>\n<p>double[][][] data = new double[N_X][N_Y][N_Z];\/\/\u521b\u5efa\u4e00\u4e2a\u4e09\u7ef4\u6570\u7ec4 [X][Y][Z]<\/p>\n<p>XYZ p = new XYZ();\/\/\u521b\u5efa\u4e00\u4e2a\u70b9<\/p>\n<p>\/\/\u4e09\u7ef4\u6570\u7ec4\u521d\u59cb\u5316<br \/>\nfor (int i = 0; i < N_X; i++) {\nfor (int j = 0; j < N_Y; j++) {\nfor (int k = 0; k < N_Z; k++) {\np.x = X_MIN + i * (X_MAX - X_MIN) \/ (N_X-1);\np.y = Y_MIN + j * (Y_MAX - Y_MIN) \/ (N_Y-1);\np.z = Z_MIN + k * (Z_MAX - Z_MIN) \/ (N_Z-1);\ndata[i][j][k] = f(p);\n\/\/System.out.println(\"data[\"+i+\"][\"+j+\"][\"+k+\"]=\"+data[i][j][k]);\n}\n}\n}\n\nGridcell grid = new Gridcell();\/\/\u521b\u5efa\u4e00\u4e2a\u7f51\u683c\u7acb\u65b9\u4f53\nTriangle[] triangles = new Triangle[5];\/\/\u521b\u5efa5\u4e2a\u4e09\u89d2\u5f62\n\nfor (int i = 0; i < triangles.length; i++) {\ntriangles[i] = new Triangle();\n}\n\n\/\/\u6570\u636e\u7684\u5904\u7406\nfor (int i = 0; i < N_X - 1; i++) {\nfor (int j = 0; j < N_Y - 1; j++) {\nfor (int k = 0; k < N_Z - 1; k++) {\ncalcGridPos(i, j, k, grid);\ncalcGridVal(i, j, k, data, grid);\npolygonise(grid, 1.0);\n}\n}\n}\n\nmyPaint();\nreturn objRoot;\n}\n\n\/\/Construct the applet\npublic IsoSurface() {\nsetLayout(new BorderLayout ());\nCanvas3D c=new Canvas3D (SimpleUniverse.getPreferredConfiguration());\nadd(\"Center\",c);\n\nViewPlatform viewPlatform;\nViewer viewer = new Viewer(c);\n\/\/\u521d\u59cb\u89c2\u5bdf\u70b9\u4f4d\u7f6e\nVector3d viewpoint = new Vector3d(0.0f, 0.0f, 4.0f);\nTransform3D t = new Transform3D();\nt.set(viewpoint);\nViewingPlatform v = new ViewingPlatform( );\nv.getViewPlatformTransform().setTransform(t);\n\n\/\/ SimpleUniverse is a Convenience Utility class\nu =   new SimpleUniverse( v,   viewer);\nu.getViewingPlatform();\n\n\/\/ add mouse behaviors to the viewingPlatform\nViewingPlatform viewingPlatform = u.getViewingPlatform();\n\n\/\/ This will move the ViewPlatform back a bit so the\n\/\/ objects in the scene can be viewed.\no&#114;bitBehavior o&#114;bit = new o&#114;bitBehavior(c,\no&#114;bitBehavior.REVERSE_ALL);\nBoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),\n100.0);\no&#114;bit.setSchedulingBounds(bounds);\nviewingPlatform.setViewPlatformBehavior(orbit);\n\nBranchGroup scene1 = drawBounds();\nBranchGroup scene2 = drawIsoSurface();\nu.addBranchGraph(scene1);\nu.addBranchGraph(scene2);\n}\n\n\/*\n\u8fd9\u4e2a\u51fd\u6570\u7528\u6765\u5728\u5c4f\u5e55\u4e0a\u7ed8\u5236\u56fe\u5f62\n*\/\npublic void myPaint() {\nint nTriangle = m_triArray.size();\n\nTriangle tmpTriangle = new Triangle();\nfor (int i = 0; i < tmpTriangle.p.length; i ++)\ntmpTriangle.p[i] = new XYZ();\n\nfor (int i = 5; i < nTriangle; i++) {\nfinal Triangle triangle = (Triangle)m_triArray.elementAt(i);\n\nfor (int j = 0; j < triangle.p.length; j++) {\ntmpTriangle.p[j].x = triangle.p[j].x;\ntmpTriangle.p[j].y = triangle.p[j].y;\ntmpTriangle.p[j].z = triangle.p[j].z;\n\/\/System.out.println(tmpTriangle.p[j].x+\" \"+tmpTriangle.p[j].y+\" \"+tmpTriangle.p[j].z);\n}\n\nBranchGroup scene=new BranchGroup();\n\nPoint3d[] myCoords=new Point3d[3];\nmyCoords[0]=new Point3d(tmpTriangle.p[0].x\/250,tmpTriangle.p[0].y\/250,tmpTriangle.p[0].z\/250);\nmyCoords[1]=new Point3d(tmpTriangle.p[1].x\/250,tmpTriangle.p[1].y\/250,tmpTriangle.p[1].z\/250);\nmyCoords[2]=new Point3d(tmpTriangle.p[2].x\/250,tmpTriangle.p[2].y\/250,tmpTriangle.p[2].z\/250);\nVector3f[] myNormals={\nnew Vector3f(0.0f,1.0f,0.0f),\nnew Vector3f(0.0f,1.0f,0.0f),\nnew Vector3f(0.0f,1.0f,0.0f),\n};\nColor3f[] myColors={\nnew Color3f(1.0f,0.0f,1.0f),\nnew Color3f(1.0f,0.0f,1.0f),\nnew Color3f(1.0f,0.0f,1.0f),\n};\nint[] stripLengths={myCoords.length };\nTriangleStripArray myTris=new TriangleStripArray(myCoords.length ,GeometryArray.COORDINATES\n|GeometryArray.NORMALS|GeometryArray.COLOR_3 ,stripLengths);\nmyTris.setCoordinates(0,myCoords);\nmyTris.setNormals(0,myNormals);\nmyTris.setColors(0,myColors);\nShape3D myShape=new Shape3D(myTris);\nscene.addChild(myShape);\nu.addBranchGraph(scene);\n}\n}\n\n\/*\n\u8fd9\u4e2a\u51fd\u6570\u7528\u6765\u8ba1\u7b97\u7f51\u683c\u70b9\u4f4d\u7f6e\n*\/\nprivate void calcGridPos(int i, int j, int k, Gridcell grid) {\n\ngrid.p[0] = genPos(i, j, k);\ngrid.p[1] = genPos(i+1, j, k);\ngrid.p[2] = genPos(i+1, j+1, k);\ngrid.p[3] = genPos(i, j+1, k);\ngrid.p[4] = genPos(i, j, k+1);\ngrid.p[5] = genPos(i+1, j, k+1);\ngrid.p[6] = genPos(i+1, j+1, k+1);\ngrid.p[7] = genPos(i, j+1, k+1);\n}\n\n\/*\n\u8fd9\u4e2a\u51fd\u6570\u7528\u6765\u8ba1\u7b97\u7f51\u683c\u70b9\u7684\u4f4d\u7f6e\n*\/\nprivate XYZ genPos(int i, int j, int k) {\n\nXYZ p = new XYZ();\n\np.x = X_MIN + i * (X_MAX - X_MIN) \/ (N_X-1);\np.y = Y_MIN + j * (Y_MAX - Y_MIN) \/ (N_Y-1);\np.z = Z_MIN + k * (Z_MAX - Z_MIN) \/ (N_Z-1);\n\nreturn p;\n}\n\n\/*\n\u8fd9\u4e2a\u51fd\u6570\u7528\u6765\u8ba1\u7b97\u7f51\u683c\u70b9\u4e0a\u7684\u6570\u636e\u503c\n*\/\nprivate void calcGridVal(int i, int j, int k, double[][][] data,\nGridcell grid) {\ngrid.val[0] = data[i][j][k];\ngrid.val[1] = data[i+1][j][k];\ngrid.val[2] = data[i+1][j+1][k];\ngrid.val[3] = data[i][j+1][k];\ngrid.val[4] = data[i][j][k+1];\ngrid.val[5] = data[i+1][j][k+1];\ngrid.val[6] = data[i+1][j+1][k+1];\ngrid.val[7] = data[i][j+1][k+1];\n}\n\n\/*\n\u8fd9\u4e2a\u51fd\u6570\u7528\u6765\u521d\u59cb\u5316\u6570\u636e\u6570\u7ec4\n*\/\nprotected double f(XYZ p) {\n\n\/*\ndouble rsq = 2.0 * p.x * p.x + p.y * p.y + p.z * p.z;\nif (rsq < 40000.0)\nreturn 100.0;\nelse\nreturn 0.0;\n*\/\n\nfinal double a = 500, b = 1000, c = 700, d = 150;\ndouble tmp = Math.sqrt((p.x*p.x\/a*a) + (p.y*p.y\/b*b)) - d;\ndouble r = tmp*tmp + p.z*p.z\/c*c;\nif (r < 1500.0)\nreturn 100.0;\nelse\nreturn 0.0;\n\n\n}\n\n\/*\n\u8fd9\u4e2a\u51fd\u6570\u7528\u6765\u751f\u6210\u7f51\u683c\u91cc\u7684\u4e09\u89d2\u9762\n*\/\nprotected void polygonise(Gridcell grid, double isoLevel) {\n\nint cubeIndex = 0;\/\/\u8fd9\u662f\u7f51\u683c\u7acb\u65b9\u4f53\u7684\u6807\u5fd7\u4f4d\n\nif (grid.val[0] < isoLevel) cubeIndex |= 1;\nif (grid.val[1] < isoLevel) cubeIndex |= 2;\nif (grid.val[2] < isoLevel) cubeIndex |= 4;\nif (grid.val[3] < isoLevel) cubeIndex |= 8;\nif (grid.val[4] < isoLevel) cubeIndex |= 16;\nif (grid.val[5] < isoLevel) cubeIndex |= 32;\nif (grid.val[6] < isoLevel) cubeIndex |= 64;\nif (grid.val[7] < isoLevel) cubeIndex |= 128;\n\nif (edgeTable[cubeIndex] == 0)\/\/\u7f51\u683c\u7acb\u65b9\u4f53\u4e2d\u6ca1\u6709\u7b49\u503c\u9762\nreturn;\n\nXYZ[] vertList = new XYZ[12];\/\/\u751f\u621012\u4e2a\u70b9\n\n\/\/\u4e0b\u9762\u572812\u6761\u8fb9\u4e0a\u63d2\u503c\nif ((edgeTable[cubeIndex] &#038; 1) != 0)\nvertList[0] =\nvertexInterp(isoLevel, grid.p[0], grid.p[1], grid.val[0], grid.val[1]);\nif ((edgeTable[cubeIndex] &#038; 2) != 0)\nvertList[1] =\nvertexInterp(isoLevel, grid.p[1], grid.p[2], grid.val[1], grid.val[2]);\nif ((edgeTable[cubeIndex] &#038; 4) != 0)\nvertList[2] =\nvertexInterp(isoLevel, grid.p[2], grid.p[3], grid.val[2], grid.val[3]);\nif ((edgeTable[cubeIndex] &#038; 8) != 0)\nvertList[3] =\nvertexInterp(isoLevel, grid.p[3], grid.p[0], grid.val[3], grid.val[0]);\nif ((edgeTable[cubeIndex] &#038; 16) != 0)\nvertList[4] =\nvertexInterp(isoLevel, grid.p[4], grid.p[5], grid.val[4], grid.val[5]);\nif ((edgeTable[cubeIndex] &#038; 32) != 0)\nvertList[5] =\nvertexInterp(isoLevel, grid.p[5], grid.p[6], grid.val[5], grid.val[6]);\nif ((edgeTable[cubeIndex] &#038; 64) != 0)\nvertList[6] =\nvertexInterp(isoLevel, grid.p[6], grid.p[7], grid.val[6], grid.val[7]);\nif ((edgeTable[cubeIndex] &#038; 128) != 0)\nvertList[7] =\nvertexInterp(isoLevel, grid.p[7], grid.p[4], grid.val[7], grid.val[4]);\nif ((edgeTable[cubeIndex] &#038; 256) != 0)\nvertList[8] =\nvertexInterp(isoLevel, grid.p[0], grid.p[4], grid.val[0], grid.val[4]);\nif ((edgeTable[cubeIndex] &#038; 512) != 0)\nvertList[9] =\nvertexInterp(isoLevel, grid.p[1], grid.p[5], grid.val[1], grid.val[5]);\nif ((edgeTable[cubeIndex] &#038; 1024) != 0)\nvertList[10] =\nvertexInterp(isoLevel, grid.p[2], grid.p[6], grid.val[2], grid.val[6]);\nif ((edgeTable[cubeIndex] &#038; 2048) != 0)\nvertList[11] =\nvertexInterp(isoLevel, grid.p[3], grid.p[7], grid.val[3], grid.val[7]);\n\n\/\/\u4e0b\u9762\u5728\u7f51\u683c\u7acb\u65b9\u4f53\u4e2d\u751f\u6210\u4e09\u89d2\u5f62\nfor (int i = 0; triTable[cubeIndex][i] != -1; i+= 3) {\nTriangle triangle = new Triangle();\n\ntriangle.p[0] = vertList[ triTable[cubeIndex][i]   ];\ntriangle.p[1] = vertList[ triTable[cubeIndex][i+1] ];\ntriangle.p[2] = vertList[ triTable[cubeIndex][i+2] ];\n\nm_triArray.add(triangle);\n}\n\nreturn;\n}\n\n\/*\n\u8fd9\u4e2a\u51fd\u6570\u7528\u6765\u8ba1\u7b97\u63d2\u503c\u70b9\u4f4d\u7f6e\u3002\n\u8f93\u5165\uff1a\u7b49\u503c\u9762\u503c\uff0c\u70b91\u4f4d\u7f6e\uff0c\u70b92\u4f4d\u7f6e\uff0c\u70b91\u6570\u636e\u503c\uff0c\u70b92\u6570\u636e\u503c\u3002\n\u8f93\u51fa\uff1a\u63d2\u503c\u70b9\u4f4d\u7f6e\n*\/\nXYZ vertexInterp(double isoLevel, XYZ p1, XYZ p2, double valp1, double valp2) {\n\nXYZ p = new XYZ(); \/\/\u4e00\u4e2a\u4e34\u65f6\u70b9\n\nif (Math.abs(isoLevel - valp1) < 0.00001) \/\/\u5982\u679c\u7b49\u503c\u9762\u503c\u975e\u5e38\u63a5\u8fd1\u70b91\u503c\uff0c\u90a3\u4e2a\u5c31\u8fd4\u56de\u70b91\nreturn p1;\nif (Math.abs(isoLevel - valp2) < 0.00001) \/\/\u5982\u679c\u7b49\u503c\u9762\u503c\u975e\u5e38\u63a5\u8fd1\u70b92\u503c\uff0c\u90a3\u4e2a\u5c31\u8fd4\u56de\u70b92\nreturn p2;\nif (Math.abs(valp1 - valp2) < 0.00001) \/\/\u5982\u679c\u70b91\u503c\u975e\u5e38\u63a5\u8fd1\u70b92\u503c\uff0c\u90a3\u4e2a\u5c31\u8fd4\u56de\u70b91\nreturn p1;\n\n\/\/\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u8ba1\u7b97\u63d2\u503c\u70b9\ndouble mu = (isoLevel - valp1) \/ (valp2 - valp1);\np.x = p1.x + mu * (p2.x - p1.x);\np.y = p1.y + mu * (p2.y - p1.y);\np.z = p1.z + mu * (p2.z - p1.z);\n\nreturn p;\n}\n\n\n\/\/Initialize the applet\npublic void init() {\ntry {\njbInit();\n}\ncatch (Exception e) {\ne.printStackTrace();\n}\n}\n\n\/\/Component initialization\nprivate void jbInit() throws Exception {\n}\n\n\/\/Get Applet information\npublic String getAppletInfo() {\nreturn \"Applet Information\";\n}\n\n\/\/Get parameter info\npublic String[][] getParameterInfo() {\nreturn null;\n}\n\npublic static void main(String[] args){\nnew MainFrame (new IsoSurface() ,400,400);\n}\n\nint[] edgeTable = {\n0x0  , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,\n0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,\n0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,\n0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,\n0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,\n0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,\n0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,\n0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,\n0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,\n0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,\n0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,\n0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,\n0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,\n0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,\n0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,\n0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,\n0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,\n0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,\n0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,\n0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,\n0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,\n0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,\n0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,\n0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,\n0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,\n0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,\n0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,\n0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,\n0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,\n0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,\n0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,\n0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0   };\n\nint[][] triTable = {\n{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1},\n{3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1},\n{3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1},\n{3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1},\n{9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1},\n{9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1},\n{2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1},\n{8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1},\n{9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1},\n{4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1},\n{3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1},\n{1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1},\n{4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1},\n{4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1},\n{9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1},\n{5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1},\n{2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1},\n{9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1},\n{0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1},\n{2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1},\n{10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1},\n{4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1},\n{5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1},\n{5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1},\n{9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1},\n{0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1},\n{1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1},\n{10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1},\n{8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1},\n{2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1},\n{7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1},\n{9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1},\n{2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1},\n{11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1},\n{9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1},\n{5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1},\n{11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1},\n{11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1},\n{1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1},\n{9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1},\n{5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1},\n{2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1},\n{0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1},\n{5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1},\n{6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1},\n{3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1},\n{6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1},\n{5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1},\n{1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1},\n{10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1},\n{6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1},\n{8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1},\n{7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1},\n{3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1},\n{5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1},\n{0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1},\n{9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1},\n{8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1},\n{5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1},\n{0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1},\n{6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1},\n{10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1},\n{10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1},\n{8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1},\n{1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1},\n{3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1},\n{0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1},\n{10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1},\n{3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1},\n{6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1},\n{9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1},\n{8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1},\n{3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1},\n{6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1},\n{0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1},\n{10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1},\n{10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1},\n{2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1},\n{7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1},\n{7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1},\n{2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1},\n{1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1},\n{11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1},\n{8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1},\n{0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1},\n{7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1},\n{10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1},\n{2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1},\n{6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1},\n{7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1},\n{2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1},\n{1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1},\n{10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1},\n{10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1},\n{0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1},\n{7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1},\n{6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1},\n{8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1},\n{9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1},\n{6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1},\n{4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1},\n{10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1},\n{8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1},\n{0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1},\n{1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1},\n{8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1},\n{10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1},\n{4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1},\n{10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1},\n{5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1},\n{11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1},\n{9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1},\n{6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1},\n{7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1},\n{3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1},\n{7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1},\n{9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1},\n{3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1},\n{6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1},\n{9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1},\n{1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1},\n{4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1},\n{7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1},\n{6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1},\n{3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1},\n{0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1},\n{6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1},\n{0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1},\n{11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1},\n{6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1},\n{5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1},\n{9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1},\n{1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1},\n{1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1},\n{10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1},\n{0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1},\n{5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1},\n{10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1},\n{11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1},\n{9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1},\n{7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1},\n{2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1},\n{8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1},\n{9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1},\n{9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1},\n{1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1},\n{9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1},\n{9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1},\n{5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1},\n{0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1},\n{10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1},\n{2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1},\n{0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1},\n{0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1},\n{9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1},\n{5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1},\n{3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1},\n{5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1},\n{8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1},\n{0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1},\n{9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1},\n{0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1},\n{1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1},\n{3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1},\n{4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1},\n{9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1},\n{11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1},\n{11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1},\n{2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1},\n{9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1},\n{3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1},\n{1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1},\n{4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1},\n{4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1},\n{0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1},\n{3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1},\n{3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1},\n{0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1},\n{9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1},\n{1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},\n{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}};\n\n}\n\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u4e24\u4e2a\u6587\u4ef6\u662f\u7528\u4ee5\u524d\u7528Java3D\u6539\u5199\u7684Marching Cubes\u7a0b\u5e8f \u6587\u4ef6\u4e00 \u6570\u636e\u6587\u4ef6 package isosurface; \/** * Title: Isosurface * * Descri&hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[16],"tags":[],"class_list":["post-736","post","type-post","status-publish","format-standard","hentry","category-study"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=\/wp\/v2\/posts\/736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=736"}],"version-history":[{"count":0,"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=\/wp\/v2\/posts\/736\/revisions"}],"wp:attachment":[{"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opgogo.com\/blog2\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}