import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.applet.*; import java.awt.geom.*; import java.math.*; import java.io.*; /**The purpose of this routine is to extract the list of faces of an integer polyhedron (LongPolyhedron). The idea is that we consider all subsets of the vertex set, and accept those which satisfy 3 properties. -- the vertices are coplanar -- the vertices are on the boundary of P -- the set in question is a maximal set satisfying the first 2 properties. Suppose P has N vertices. Then the subsets of P are encoded by the integers a=0,1,...,(2^N-1). To extract the subset, we convert the integer a into binary and then include those members which correspond to a 1 digit. */ public class LongPolyFace { /*This gets the raw list of faces. The subsets are not cyclically ordered. We don't really use this routine in practice because, once we use it once, we are done with it.*/ public static int[] faceList(LongPolyhedron P) { int N=P.count; int lim=(int)(Math.pow(2,N)); int[] A=new int[lim]; int count=0; for(int i=0;i=target) return(true); return(false); } public static void checkBad(LongPolyhedron P) { int v=P.count; for(int i=0;id12+d20-.00000001) System.out.println("bad "+k); if(d12>d20+d01-.00000001) System.out.println("bad "+i); if(d20>d01+d12-.00000001) System.out.println("bad "+j); return(true); } }