BowlerKernel
QhullTest.java
Go to the documentation of this file.
1 package eu.mihosoft.vrl.v3d.ext.quickhull3d;
2 
3 // TODO: Auto-generated Javadoc
7 class QhullTest
8 {
9 
11  static double[] coords = new double[]
12  {
13  };
14 
16  static int[][] faces = new int[][]
17  {
18  };
19 
25  public static void main (String[] args)
26  {
27  QuickHull3D hull = new QuickHull3D ();
28  QuickHull3DTest tester = new QuickHull3DTest();
29 
30  hull = new QuickHull3D();
31 
32  for (int i=0; i<100; i++)
33  {
34  double[] pnts = tester.randomCubedPoints (100, 1.0, 0.5);
35 
36  hull.setFromQhull (pnts, pnts.length/3, /*triangulated=*/false);
37 
38  pnts = tester.addDegeneracy (
39  QuickHull3DTest.VERTEX_DEGENERACY, pnts, hull);
40 
41 // hull = new QuickHull3D ();
42  hull.setFromQhull (pnts, pnts.length/3, /*triangulated=*/true);
43 
44  if (!hull.check(System.out))
45  { System.out.println ("failed for qhull triangulated");
46  }
47 
48 // hull = new QuickHull3D ();
49  hull.setFromQhull (pnts, pnts.length/3, /*triangulated=*/false);
50 
51  if (!hull.check(System.out))
52  { System.out.println ("failed for qhull regular");
53  }
54 
55 // hull = new QuickHull3D ();
56  hull.build (pnts, pnts.length/3);
57  hull.triangulate();
58 
59  if (!hull.check(System.out))
60  { System.out.println ("failed for QuickHull3D triangulated");
61  }
62 
63 // hull = new QuickHull3D ();
64  hull.build (pnts, pnts.length/3);
65 
66  if (!hull.check(System.out))
67  { System.out.println ("failed for QuickHull3D regular");
68  }
69  }
70  }
71 }