From b7dce2b3654df801a3904bc270dfcb641fcdb66e Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 02 Nov 2015 19:20:40 -0500
Subject: [PATCH] Rename GrafreeD

---
 ImplicitTiler.java |    4 
 ObjEditor.java     |   34 ++-
 MorphNode.java     |    8 
 Texture.java       |    4 
 SwitchNode.java    |    6 
 LA.java            |    2 
 GrafreeD.java      |   43 ++++
 Vertex.java        |    6 
 cMaterial.java     |    2 
 Merge.java         |    2 
 Mocap.java         |   29 +++
 GenericJoint.java  |    2 
 cMesh.java         |   10 
 BoundaryRep.java   |   30 +-
 CameraPane.java    |   83 ++++++---
 cRadio.java        |    2 
 GroupEditor.java   |  162 ++++++++++---------
 RandomNode.java    |    2 
 Object3D.java      |   24 +-
 cVector.java       |    2 
 20 files changed, 274 insertions(+), 183 deletions(-)

diff --git a/BoundaryRep.java b/BoundaryRep.java
index 693d818..12a985c 100644
--- a/BoundaryRep.java
+++ b/BoundaryRep.java
@@ -172,16 +172,16 @@
             bufV = other.bufV;
             bufF = other.bufF;
 
-            positions = (float[]) GraphreeD.clone(other.positions);
-            normals = (float[]) GraphreeD.clone(other.normals);
-            colors = (float[]) GraphreeD.clone(other.colors);
-            uvmap = (float[]) GraphreeD.clone(other.uvmap);
-            triangles = (int[]) GraphreeD.clone(other.triangles);
+            positions = (float[]) GrafreeD.clone(other.positions);
+            normals = (float[]) GrafreeD.clone(other.normals);
+            colors = (float[]) GrafreeD.clone(other.colors);
+            uvmap = (float[]) GrafreeD.clone(other.uvmap);
+            triangles = (int[]) GrafreeD.clone(other.triangles);
             
-            indices = (int[]) GraphreeD.clone(other.indices);
+            indices = (int[]) GrafreeD.clone(other.indices);
 
-            vertices = (Vector<Vertex>) GraphreeD.clone(other.vertices);
-            faces = (Vector<Face>) GraphreeD.clone(other.faces);
+            vertices = (Vector<Vertex>) GrafreeD.clone(other.vertices);
+            faces = (Vector<Face>) GrafreeD.clone(other.faces);
         }
         else
         {
@@ -1492,7 +1492,7 @@
             InitFaceIndices();
         }
         
-        BoundaryRep rep = (BoundaryRep) GraphreeD.clone(this);
+        BoundaryRep rep = (BoundaryRep) GrafreeD.clone(this);
         //float[] v = new float[100];
         
         for (int loops=1; --loops>=0;)
@@ -1522,7 +1522,7 @@
             InitFaceIndices();
         }
         
-        BoundaryRep rep = (BoundaryRep) GraphreeD.clone(this);
+        BoundaryRep rep = (BoundaryRep) GrafreeD.clone(this);
         //float[] v = new float[100];
         
         for (int loops=10; --loops>=0;)
@@ -2600,7 +2600,7 @@
 //                    if (stepout && !playedonce)
 //                    {
 //                        // sound
-//                        GraphreeD.wav.play();
+//                        GrafreeD.wav.play();
 //                        playedonce = true;
 //                    }
 //                    
@@ -2644,7 +2644,7 @@
 
             if (CameraPane.framecount - lastsoundtime > 30) // 0.25 secs
             {
-                GraphreeD.wav.play((Math.random()+0.5)/Math.max(tmp.length2(),0.2)); //, 1);
+                GrafreeD.wav.play((Math.random()+0.5)/Math.max(tmp.length2(),0.2)); //, 1);
 
                 lastsoundtime = CameraPane.framecount;
             }
@@ -3229,7 +3229,7 @@
                     k /= x*x + y*y;
                 }
                 else
-                    GraphreeD.Assert(z == 1);
+                    GrafreeD.Assert(z == 1);
                 
                 if (k < 0)
                     k = 0;
@@ -7391,7 +7391,7 @@
             Trim();
             Untrim();
         
-        BoundaryRep tmp = new BoundaryRep(); // (BoundaryRep) GraphreeD.clone(this);
+        BoundaryRep tmp = new BoundaryRep(); // (BoundaryRep) GrafreeD.clone(this);
         
         double minx = Float.POSITIVE_INFINITY;
         double maxx = Float.NEGATIVE_INFINITY;
@@ -8067,7 +8067,7 @@
         if (!trimmed)
             return;
         
-        GraphreeD.linkUV = false;
+        GrafreeD.linkUV = false;
         
         try
         {
diff --git a/CameraPane.java b/CameraPane.java
index 3e6f8d9..dda961a 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -228,7 +228,7 @@
     void PushMatrix(double[][] matrix, int count)
     {
         matrixdepth++;
-     //   GraphreeD.tracein(matrix);
+     //   GrafreeD.tracein(matrix);
         if (matrix == null)
             return; // Identity
         
@@ -253,13 +253,13 @@
     
     void PushMatrix(double[][] matrix)
     {
-    //    GraphreeD.tracein(matrix);
+    //    GrafreeD.tracein(matrix);
         PushMatrix(matrix,1);
     }
     
     void PushMatrix()
     {
-    //    GraphreeD.tracein(null);
+    //    GrafreeD.tracein(null);
         if (matrixdepth++ < MAXSTACK - 1)
         {
             currentGL.glPushMatrix();
@@ -274,7 +274,7 @@
     {
         --matrixdepth;
         
-    //    GraphreeD.traceout(inverse);
+    //    GrafreeD.traceout(inverse);
         if (inverse == null)
             return; // Identity
         
@@ -292,7 +292,7 @@
 
     void PopMatrix()
     {
-    //    GraphreeD.traceout(null);
+    //    GrafreeD.traceout(null);
         // inverse == null??
         if (--matrixdepth < MAXSTACK - 1)
         {
@@ -491,7 +491,7 @@
         System.err.println("LIVE = " + isLIVE());
         
         if (!isLIVE()) // save sound
-            GraphreeD.savesound = true; // wav.save();
+            GrafreeD.savesound = true; // wav.save();
      //   else
             repaint(); // start loop // may 2013
     }
@@ -6333,7 +6333,7 @@
         {
             bumpdepth--;
 
-          //  GraphreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);
+          //  GrafreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);
             if (bumpstack[bumpdepth] != (texture!=null?texture.texture:null))
             {
             //    assert (bumpstack[bumpdepth] == texture);
@@ -6363,7 +6363,7 @@
         {
             pigmentdepth--;
 
-          //  GraphreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);
+          //  GrafreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);
             if (pigmentstack[pigmentdepth] != (texture!=null?texture.texture:null))
             {
             //    assert (pigmentstack[pigmentdepth] == texture);
@@ -6694,12 +6694,12 @@
                 
         if (bump)
         {
-    //        GraphreeD.trace("PUSH BUMP " + tex  + "(" + bumpdepth + ")" + " : " + texture);
+    //        GrafreeD.trace("PUSH BUMP " + tex  + "(" + bumpdepth + ")" + " : " + texture);
             bumpstack[bumpdepth++] = texture!=null?texture.texture:null;
         }
         else
         {
-    //        GraphreeD.trace("PUSH PIGMENT " + tex  + "(" + pigmentdepth + ")" + " : " + texture);
+    //        GrafreeD.trace("PUSH PIGMENT " + tex  + "(" + pigmentdepth + ")" + " : " + texture);
             pigmentstack[pigmentdepth++] = texture!=null?texture.texture:null;
         }
         
@@ -7628,14 +7628,14 @@
         
 //System.out.println("start frame");
         gl.glClear(gl.GL_ACCUM_BUFFER_BIT);
-        for (jitter = 0; jitter < ACSIZE; jitter++) //, GraphreeD.wav.cursor += LIVE ? 735 : 0)
+        for (jitter = 0; jitter < ACSIZE; jitter++) //, GrafreeD.wav.cursor += LIVE ? 735 : 0)
         {
             framecount++;
             
             if (CameraPane.tickcount > 0)
                 CameraPane.tickcount--;
             
-//            GraphreeD.wav.cursor += 735; // 44100 Hz / 120 Hz * 2 (for 16 bits)
+//            GrafreeD.wav.cursor += 735; // 44100 Hz / 120 Hz * 2 (for 16 bits)
 //            restartframe = true;
             if (options1[2] > 100 && (jitter%2==0))
             {
@@ -7923,7 +7923,7 @@
             
             if (!BOXMODE)
             {
-                System.out.println("image: " + fullname + " (" + (GraphreeD.wav.cursor / 735 / 4) + ")");
+                System.out.println("image: " + fullname + " (" + (GrafreeD.wav.cursor / 735 / 4) + ")");
             }
     
             if (!BOXMODE)
@@ -7951,7 +7951,7 @@
         {
             if (ACSIZE > 1)
             {
-           //     System.err.println("image #" + (GraphreeD.wav.cursor / 735 / 4));
+           //     System.err.println("image #" + (GrafreeD.wav.cursor / 735 / 4));
             }
         }
         
@@ -7961,7 +7961,7 @@
             ABORTED = false;
         }
         else
-            GraphreeD.wav.cursor += 735 * ACSIZE;
+            GrafreeD.wav.cursor += 735 * ACSIZE;
         
         if (false)
         {
@@ -8631,11 +8631,11 @@
 
     public void display(GLAutoDrawable drawable)
     {
-        if (GraphreeD.savesound && GraphreeD.hassound)
+        if (GrafreeD.savesound && GrafreeD.hassound)
         {
-            GraphreeD.wav.save();
-            GraphreeD.savesound = false;
-            GraphreeD.hassound = false;
+            GrafreeD.wav.save();
+            GrafreeD.savesound = false;
+            GrafreeD.hassound = false;
         }
 //        if (DEBUG_SELECTION)
 //        {
@@ -8765,7 +8765,7 @@
             Object3D theobject = object;
             Object3D theparent = object.parent;
             object.parent = null;
-            object = (Object3D)GraphreeD.clone(object);
+            object = (Object3D)GrafreeD.clone(object);
             object.Stripify();
             if (theobject.selection == null || theobject.selection.Size() == 0)
                 theobject.PreprocessOcclusion(this);
@@ -9660,8 +9660,8 @@
             e.printStackTrace();
         }
         
-        if (GraphreeD.RENDERME > 0)
-            GraphreeD.RENDERME--; // mechante magouille
+        if (GrafreeD.RENDERME > 0)
+            GrafreeD.RENDERME--; // mechante magouille
         
         ONESTEP = false;
     }
@@ -9734,7 +9734,7 @@
                 BindTextures(DEFAULT_TEXTURES, 2);
             }
             //System.out.println("--> " + stackdepth);
-//            GraphreeD.traceon();
+//            GrafreeD.traceon();
         
         // DRAW
         object.draw(this, /*(Composite)*/ object, false, false);
@@ -9765,17 +9765,31 @@
                         debugpoint2.material.color = 0.75f;
                         debugpoint2.material.modulation = 0.75f;
                         
+                        debugpoint3.radius = radius;
+                        debugpoint3.recalculate();
+                        debugpoint3.material = new cMaterial();
+                        debugpoint3.material.color = 0.5f;
+                        debugpoint3.material.modulation = 0.75f;
+                        
+                        debugpoint4.radius = radius;
+                        debugpoint4.recalculate();
+                        debugpoint4.material = new cMaterial();
+                        debugpoint4.material.color = 0f;
+                        debugpoint4.material.modulation = 0.75f;
+                        
                         InitPoints(radius);
                     }
                     selectedpoint.draw(this, /*(Composite)*/ null, false, false);
-                    //debugpoint.draw(this, /*(Composite)*/ null, false);
-                    //debugpoint2.draw(this, /*(Composite)*/ null, false);
-                    DrawPoints(this);
+                    debugpoint.draw(this, /*(Composite)*/ null, false,false);
+                    debugpoint2.draw(this, /*(Composite)*/ null, false,false);
+                    debugpoint3.draw(this, /*(Composite)*/ null, false,false);
+                    debugpoint4.draw(this, /*(Composite)*/ null, false,false);
+                    // DrawPoints(this);
                 }
                 
        //         debugstuff.draw(this, /*(Composite)*/ null, false);
             }
-//            GraphreeD.traceoff();
+//            GrafreeD.traceoff();
             //System.out.println(stackdepth);
             if (drawMode == 0)
             {
@@ -11092,10 +11106,17 @@
               "MOV final.z, zero.x;" +
               "MOV final.a, one.w;":""
               ) +
+                /*
     (NORMALdebug?"MOV final.x, normal.x;" +
               "MOV final.y, normal.y;" +
               "MOV final.z, normal.z;" +
               "MOV final.a, one.w;":""
+              ) +
+                */
+    (NORMALdebug?"SUB final.x, one.x, final.x;" +
+              "SUB final.y, one.x, final.y;" +
+              "SUB final.z, one.x, final.z;" +
+              "MOV final.a, final.a;":""
               ) +
 //          "MOV final, bumpmap;" +
                 "MOV result.color, final;" +
@@ -14700,16 +14721,16 @@
                             System.out.println("; fromto " + sel + " " + Trunk(previousselectedpoint.toParent[3][0]) + " " + Trunk(previousselectedpoint.toParent[3][2]) + " " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][2]));
                         }
                         
-                        previousselectedpoint = (Sphere) GraphreeD.clone(selectedpoint);
+                        previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
                     }
                 }
                 
                 if (!movingcamera && !PAINTMODE)
                     object.editWindow.ScreenFitPoint(); // fev 2014
                 
-                if (PAINTMODE && GraphreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
+                if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
                 {
-                    Object3D paintobj = GraphreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
+                    Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
                     
                     Object3D group = new Object3D("inst" + paintcount++);
                     
@@ -15283,6 +15304,8 @@
     static Sphere previousselectedpoint = null;
     static Sphere debugpoint = new Sphere();
     static Sphere debugpoint2 = new Sphere();
+    static Sphere debugpoint3 = new Sphere();
+    static Sphere debugpoint4 = new Sphere();
     
     static Sphere debugpoints[] = new Sphere[8];
  
diff --git a/GenericJoint.java b/GenericJoint.java
index 231796a..0e2ebd5 100644
--- a/GenericJoint.java
+++ b/GenericJoint.java
@@ -379,7 +379,7 @@
         try
         {
             //font = FontRender.createFont("Dialog", 11, false, true);
-            font = new FontRender.GLFont(gl, GraphreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
+            font = new FontRender.GLFont(gl, GrafreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
         } catch (java.io.IOException e)
         {
             e.printStackTrace();
diff --git a/GraphreeD.java b/GrafreeD.java
similarity index 96%
rename from GraphreeD.java
rename to GrafreeD.java
index c12afe1..bc4d7f1 100644
--- a/GraphreeD.java
+++ b/GrafreeD.java
@@ -13,7 +13,7 @@
 import javax.sound.sampled.*;
 
 //import com.jamonapi.*;
-public class GraphreeD extends Applet implements ActionListener
+public class GrafreeD extends Applet implements ActionListener
 {
     static int RENDERME = 0;
 
@@ -25,7 +25,7 @@
     static boolean hassound = false;
     static boolean savesound = false;
     
-    public GraphreeD()
+    public GrafreeD()
     {
         javax.swing.Timer timer = new javax.swing.Timer(1000, this);
 
@@ -44,7 +44,7 @@
     
     public void init()
     {
-        add(openEditorButton = new Button("GraphreeD"));
+        add(openEditorButton = new Button("GrafreeD"));
         //Composite god = new Composite();
         universe = new Composite();
         universe.material = new cMaterial();
@@ -595,6 +595,39 @@
     
     public static void main(String argv[])
     {
+        if (argv.length == 0)
+        {
+            String javaPath = System.getProperty("java.home") + "/bin/java";
+            java.net.URL u = new GrafreeD().getClass().getResource("default.png");
+
+                System.out.println(u);
+                
+            String jarfile = u.toString().split("file:")[1].split("default.png")[0];
+
+            String jarpath = u.toString().split("file:")[1].split("GrafreeD.jar")[0];
+            
+                System.out.println(jarfile);
+                System.out.println(jarpath);
+                
+            jarfile = jarfile.substring(0, jarfile.length() - 2);
+
+            // -Djava.library.path=/Users/nbriere/Projects/shared/lib
+            
+            String command = "" + javaPath + " -Xmx1024m -Djava.library.path=" + jarpath + "lib -jar " + jarfile + " dummyarg";
+            
+            try
+            {
+                System.out.println(command);
+                Runtime.getRuntime().exec(command);
+
+                return;
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
 //        InitDictionary();
         
 //        Spell("is over".toUpperCase());
@@ -717,7 +750,7 @@
 
         //Monitor mon=MonitorFactory.start("myFirstMonitor");
         standAlone = true;
-        theApplet3D = new GraphreeD();
+        theApplet3D = new GrafreeD();
         theApplet3D.universe = new Composite();
         theApplet3D.universe.name = "Scene";
         theApplet3D.universe.material = new cMaterial();
@@ -951,7 +984,7 @@
         } while (avail > 0 && numRead >= 0);
         return new String(data, 0, pos, "US-ASCII");
     }
-    public static GraphreeD theApplet3D;
+    public static GrafreeD theApplet3D;
     public static boolean standAlone = true;
     public Composite universe;
     public static Object3D clipboard = new Object3D();
diff --git a/GroupEditor.java b/GroupEditor.java
index 200e78d..e40eb06 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -83,7 +83,7 @@
 
     void CloneSelection(boolean supports)
     {
-        //   Object3D keep = GraphreeD.clipboard;
+        //   Object3D keep = GrafreeD.clipboard;
            //Object3D obj;
            for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
            {
@@ -97,14 +97,14 @@
 
     void CloneClipboard(boolean supports)
     {
-        assert(GraphreeD.clipboard.parent == null);
-        Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
-        GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
-        if (LA.isIdentity(GraphreeD.clipboard.toParent))
-            makeSomething(CloneObject(GraphreeD.clipboard.get(0), false));
+        assert(GrafreeD.clipboard.parent == null);
+        Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
+        GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
+        if (LA.isIdentity(GrafreeD.clipboard.toParent))
+            makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
         else
-            makeSomething(CloneObject(GraphreeD.clipboard, false));
-        GraphreeD.clipboard.get(0).parent = keepparent;
+            makeSomething(CloneObject(GrafreeD.clipboard, false));
+        GrafreeD.clipboard.get(0).parent = keepparent;
     }
     
     static Object3D CloneObject(Object3D obj, boolean supports)
@@ -118,7 +118,7 @@
         //               obj.support = null;
         if (!supports)
             obj.SaveSupports();
-        Object3D clone = (Object3D)GraphreeD.clone(obj);
+        Object3D clone = (Object3D)GrafreeD.clone(obj);
         obj.parent = parent;
         //               obj.support = support;
         //               clone.support = support; // aout 2013
@@ -225,10 +225,10 @@
 		oe.menuBar.add(menu = new Menu("Group"));
 		grabItem = menu.add(new MenuItem("Grab"));
 		grabItem.addActionListener(this);
-		frontItem = menu.add(new MenuItem("Front"));
-		frontItem.addActionListener(this);
 		backItem = menu.add(new MenuItem("Back"));
 		backItem.addActionListener(this);
+		frontItem = menu.add(new MenuItem("Front"));
+		frontItem.addActionListener(this);
 		compositeItem = menu.add(new MenuItem("Composite"));
 		compositeItem.addActionListener(this);
 		menu.add("-");
@@ -380,7 +380,7 @@
                 
                
                 oe.menuBar.add(menu = new Menu("Include"));
-		importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
+		importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
 		importGFDItem.addActionListener(this);
 		importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
 		importVRMLX3DItem.addActionListener(this);
@@ -1441,9 +1441,9 @@
     
     void Overwrite(int mask)
     {
-        if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
+        if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
         {
-            Object3D content = GraphreeD.clipboard.get(0);
+            Object3D content = GrafreeD.clipboard.get(0);
 
             if (content instanceof cGroup && ((cGroup)content).transientlink )
                 content = ((cGroup)content).get(0);
@@ -1778,7 +1778,7 @@
 		if (event.getSource() == invariantsItem)
 		{
                     System.out.println("Invariants:");
-                    GraphreeD.theApplet3D.universe.invariants();
+                    GrafreeD.theApplet3D.universe.invariants();
 		} else
 		if (event.getSource() == memoryItem)
 		{
@@ -1848,10 +1848,10 @@
 		} else
 		if (event.getSource() == duplicateItem)
 		{
-                    Object3D keep = GraphreeD.clipboard;
+                    Object3D keep = GrafreeD.clipboard;
 			loadClipboard(false);
 			paste(false);
-                    GraphreeD.clipboard = keep;
+                    GrafreeD.clipboard = keep;
 		} else
 		if (event.getSource() == cloneItem)
 		{
@@ -1895,8 +1895,9 @@
                 } else
 		if (event.getSource() == overwriteMatItem)
 		{
+                    /* july 2015
                     if ((dropAttributes & Object3D.TEXTURE) == 0)
-                        Overwrite(Object3D.MATERIAL);
+                        Overwrite(Object3D.MATERIAL | Object3D.COLOR);
                     else
                     {
                         if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
@@ -1908,13 +1909,16 @@
                             Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
                         }
                     }
+                    */
+                    
+                    Overwrite(dropAttributes);
                 }
 		if (event.getSource() == overwriteGeoItem)
 		{
                     Overwrite(Object3D.GEOMETRY);
-//                    if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
+//                    if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
 //                    {
-//                        Object3D content = GraphreeD.clipboard.get(0);
+//                        Object3D content = GrafreeD.clipboard.get(0);
 //                        
 //                        if (content instanceof cGroup && ((cGroup)content).transientlink )
 //                            content = ((cGroup)content).get(0);
@@ -2047,9 +2051,9 @@
 		} else
 		if (event.getSource() == linkverticesItem)
 		{
-//                    if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
+//                    if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
 //                    {
-//                        Object3D content = GraphreeD.clipboard.get(0);
+//                        Object3D content = GrafreeD.clipboard.get(0);
 //                        
 //                        if (content instanceof cGroup && ((cGroup)content).transientlink )
 //                            content = ((cGroup)content).get(0);
@@ -2058,9 +2062,9 @@
 //                        group.selection.get(0).setMasterThis(content); // should be identity
 //		refreshContents();
 //                    }
-                    if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
+                    if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
                     {
-                        Object3D content = GraphreeD.clipboard.get(0);
+                        Object3D content = GrafreeD.clipboard.get(0);
                         
                         if (content instanceof cGroup && ((cGroup)content).transientlink )
                             content = ((cGroup)content).get(0);
@@ -2101,9 +2105,9 @@
 		} else
 		if (event.getSource() == setMasterItem)
 		{
-                    if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
+                    if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
                     {
-                        Object3D content = GraphreeD.clipboard.get(0);
+                        Object3D content = GrafreeD.clipboard.get(0);
                         
                         if (content instanceof cGroup && ((cGroup)content).transientlink )
                             content = ((cGroup)content).get(0);
@@ -2116,9 +2120,9 @@
 		{
                     if (group.selection.size() == 1)
                     {
-                        if (GraphreeD.clipboard.size() == 1)
+                        if (GrafreeD.clipboard.size() == 1)
                         {
-                            Object3D content = GraphreeD.clipboard.get(0);
+                            Object3D content = GrafreeD.clipboard.get(0);
 
                             if (content instanceof cGroup && ((cGroup)content).transientlink )
                                 content = ((cGroup)content).get(0);
@@ -2806,7 +2810,7 @@
 		if (event.getSource() == unselectButton)
 		{
 			objEditor.jTree.clearSelection();
-             // ?? oct 2012           GraphreeD.clipboard.clear();
+             // ?? oct 2012           GrafreeD.clipboard.clear();
 			objEditor.ResetSliders();
                     refreshContents(true);
 		} else
@@ -3121,9 +3125,9 @@
                     obj = (Object3D)e.nextElement();
                     
                     System.out.println("Object is: " + obj);
-                    GraphreeD.AnalyzeObject(obj);
+                    GrafreeD.AnalyzeObject(obj);
                     System.out.println("Boundary rep: " + obj.bRep);
-                    GraphreeD.AnalyzeObject(obj.bRep);
+                    GrafreeD.AnalyzeObject(obj.bRep);
                     
 //                    System.err.println((size/1024) + " KB is the size of " + obj);
                 }
@@ -3250,7 +3254,7 @@
 //                    LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
 //                    LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
 //
-//                    g.add(GraphreeD.clipboard);
+//                    g.add(GrafreeD.clipboard);
 //
 //                    buffer.add(g);
 //        }
@@ -3269,8 +3273,8 @@
 //            nodes = new Object3D();
 //            vertices = new Vector<Vertex>();
 //            
-//            boolean epsequal = GraphreeD.epsequal;
-//            GraphreeD.epsequal = true;
+//            boolean epsequal = GrafreeD.epsequal;
+//            GrafreeD.epsequal = true;
 //            
 //            for (int i=0; i<group.selection.size(); i++)
 //            {
@@ -3311,7 +3315,7 @@
 //                    LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
 //                    LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
 //
-//                    g.add(GraphreeD.clipboard);
+//                    g.add(GrafreeD.clipboard);
 //
 //                    buffer.add(g);
 //                }
@@ -3319,7 +3323,7 @@
 //                makeSomething(buffer, i==group.selection.size()-1);
 //            }
 //            
-//            GraphreeD.epsequal = epsequal;
+//            GrafreeD.epsequal = epsequal;
 //            
 //            //buffer = null;
 //            temprep = null;
@@ -3330,8 +3334,8 @@
 	
 	void ParseVertices()
 	{
-            boolean epsequal = GraphreeD.epsequal;
-            GraphreeD.epsequal = true;
+            boolean epsequal = GrafreeD.epsequal;
+            GrafreeD.epsequal = true;
             
             for (int i=0; i<group.selection.size(); i++)
             {
@@ -3356,7 +3360,7 @@
                                 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
                                 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
 
-                                g.add(GraphreeD.clipboard);
+                                g.add(GrafreeD.clipboard);
 
                                 buffer.add(g);
                             }
@@ -3371,7 +3375,7 @@
                 makeSomething(buffer, i==group.selection.size()-1);
             }
             
-            GraphreeD.epsequal = epsequal;
+            GrafreeD.epsequal = epsequal;
             
             refreshContents();
 	}
@@ -3416,7 +3420,7 @@
                             scale /= 3;
                             
                             scale /= 0xFF;
-                            scale /= 4;
+                            // c'est quoi ca? scale /= 4;
                             
                             //v.AO = scale;
                             
@@ -3455,7 +3459,7 @@
 //            ref.SaveSupports();
 //            Object3D par = ref.parent;
 //            ref.parent = null;
-//            Object3D lowres = (Object3D) GraphreeD.clone(ref);
+//            Object3D lowres = (Object3D) GrafreeD.clone(ref);
 //            ref.parent = par;
 //            ref.RestoreSupports();
             
@@ -3485,7 +3489,7 @@
 //                lowres.SaveSupports();
 //                par = lowres.parent;
 //                lowres.parent = null;
-//                Object3D newlow = (Object3D) GraphreeD.clone(lowres);
+//                Object3D newlow = (Object3D) GrafreeD.clone(lowres);
                 Object3D newlow = CloneObject(lowres, false);
                 newlow.name = sn.switchobject.get(i).name;
             System.out.println("    pose#" + i + " = " + newlow);
@@ -3507,7 +3511,7 @@
                 return;
             
             Object3D poses = group.selection.get(0);
-            Object3D ref = GraphreeD.clipboard.get(0);
+            Object3D ref = GrafreeD.clipboard.get(0);
             
             Object3D newgroup = new Object3D("Po:" + poses.name);
             
@@ -3701,20 +3705,20 @@
 	
 	void ClipMesh()
 	{
-            if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
+            if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
             {
-                Object3D content = GraphreeD.clipboard.get(0);
+                Object3D content = GrafreeD.clipboard.get(0);
 
                 if (content instanceof cGroup && ((cGroup)content).transientlink )
                     content = ((cGroup)content).get(0);
 
 //                for (int i=0; i<group.selection.size(); i++)
 //                {
-//                    group.selection.get(i).ClipMesh(GraphreeD.clipboard);
+//                    group.selection.get(i).ClipMesh(GrafreeD.clipboard);
 //                }
-                  group.selection.ClipMesh(GraphreeD.clipboard);
+                  group.selection.ClipMesh(GrafreeD.clipboard);
             }
-//		group.selection.ClipMesh(GraphreeD.clipboard);
+//		group.selection.ClipMesh(GrafreeD.clipboard);
             System.out.println("DONE.");
             refreshContents();
 	}
@@ -4052,12 +4056,12 @@
 	{
 		if (group.selection.isEmpty())
 			return;
-		GraphreeD.clipboardIsTempGroup = false;
+		GrafreeD.clipboardIsTempGroup = false;
 		Composite tGroup = null;
 		if (group.selection.size() > 0) // 1)
 		{
 			tGroup = new cGroup();
-			GraphreeD.clipboardIsTempGroup = true;
+			GrafreeD.clipboardIsTempGroup = true;
 		}
                 
 		if (cut)
@@ -4097,16 +4101,16 @@
 		//System.out.println("cut " + child);
 		//System.out.println("parent = " + child.parent);
                 //                   tmp.addChild(child);
-                                    if (GraphreeD.clipboardIsTempGroup)
+                                    if (GrafreeD.clipboardIsTempGroup)
                                             tGroup.add/*Child*/(tmp);
                                     else
-                                            GraphreeD.clipboard = tmp;
+                                            GrafreeD.clipboard = tmp;
                                 }
                                 else
-                                    if (GraphreeD.clipboardIsTempGroup)
+                                    if (GrafreeD.clipboardIsTempGroup)
                                             tGroup.add/*Child*/(child);
                                     else
-                                            GraphreeD.clipboard = child;
+                                            GrafreeD.clipboard = child;
 			}
 			
 			//ResetModel();
@@ -4138,21 +4142,21 @@
 		//System.out.println("cut " + elem);
 		//System.out.println("parent = " + elem.parent);
                 //                    tmp.addChild(elem);
-                                    if (GraphreeD.clipboardIsTempGroup)
+                                    if (GrafreeD.clipboardIsTempGroup)
                                             tGroup.add/*Child*/(tmp);
                                     else
-                                            GraphreeD.clipboard = tmp;
+                                            GrafreeD.clipboard = tmp;
                                 }
                                 else
-                                    if (GraphreeD.clipboardIsTempGroup)
+                                    if (GrafreeD.clipboardIsTempGroup)
                                             tGroup.add/*Child*/(child);
                                     else
-                                            GraphreeD.clipboard = child;
+                                            GrafreeD.clipboard = child;
 			}
 			
 		}
-		if (GraphreeD.clipboardIsTempGroup)
-			GraphreeD.clipboard = tGroup;
+		if (GrafreeD.clipboardIsTempGroup)
+			GrafreeD.clipboard = tGroup;
 		if (cut)
                 {
                     ResetModel();
@@ -4162,11 +4166,11 @@
 	
 	void paste(boolean expand)
 	{
-	//	if (GraphreeD.clipboard == null)
+	//	if (GrafreeD.clipboard == null)
 	//		return;
 		boolean first = true;
 		
-		if (GraphreeD.clipboardIsTempGroup)
+		if (GrafreeD.clipboardIsTempGroup)
 		{
 			Composite temp;
 			
@@ -4177,7 +4181,7 @@
 				temp = (Composite)Applet3D.clipboard.deepCopy();
                          */
 			Object3D elem;
-			for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
+			for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
 			{
 				Object3D child = (Object3D)e.nextElement();
                                 
@@ -4191,7 +4195,7 @@
                         else
 				elem = child.deepCopy(); // ?
                         child.parent = keepparent;
-			//if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
+			//if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
                         //    elem = elem.get(0);
 				makeSomething(elem, true); // ?? first);
 				//group.addChild(elem);
@@ -4211,14 +4215,14 @@
 			//Object3D cb = Applet3D.clipboard;
 			//temp.addChild(cb);
 			//makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
-                    assert(GraphreeD.clipboard.parent == null);
-                        Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
-                        GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
-                        if (LA.isIdentity(GraphreeD.clipboard.toParent))
-                            makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
+                    assert(GrafreeD.clipboard.parent == null);
+                        Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
+                        GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
+                        if (LA.isIdentity(GrafreeD.clipboard.toParent))
+                            makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
                         else
-                            makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
-                        GraphreeD.clipboard.get(0).parent = keepparent;
+                            makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
+                        GrafreeD.clipboard.get(0).parent = keepparent;
 		}
 		
 		ResetModel();
@@ -4227,7 +4231,7 @@
 	
 	void pasteInto(boolean copyit)
 	{
-//		if (GraphreeD.clipboard == null)
+//		if (GrafreeD.clipboard == null)
 //			return;
 
 		if (group.selection.size() != 1)
@@ -4260,9 +4264,9 @@
 		{
 			boolean first = true;
 			
-			if (GraphreeD.clipboardIsTempGroup)
+			if (GrafreeD.clipboardIsTempGroup)
 			{
-				Composite temp = (Composite)GraphreeD.clipboard;
+				Composite temp = (Composite)GrafreeD.clipboard;
 				Object3D copy;
 				for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
 				{
@@ -4272,7 +4276,7 @@
 				}
 			} else
 			{
-				linkSomething(GraphreeD.clipboard); //.get(0));
+				linkSomething(GrafreeD.clipboard); //.get(0));
 			}
 		}
             }
@@ -4659,7 +4663,7 @@
 
         void ImportGFD()
         {
-            FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
+            FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
             browser.show();
             String filename = browser.getFile();
             if (filename != null && filename.length() > 0)
@@ -4697,7 +4701,7 @@
 
 	void ImportVRMLX3D()
 	{
-		if (GraphreeD.standAlone)
+		if (GrafreeD.standAlone)
 		{
                     /**/
 			FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
@@ -4714,7 +4718,7 @@
 				
 	String GetFile(String dialogName)
 	{
-		if (GraphreeD.standAlone)
+		if (GrafreeD.standAlone)
 		{
 			FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
 			browser.show();
diff --git a/ImplicitTiler.java b/ImplicitTiler.java
index b7a7fd2..393a52d 100644
--- a/ImplicitTiler.java
+++ b/ImplicitTiler.java
@@ -194,8 +194,8 @@
             {
                 // Merge normals: tolerance == 0 means use analytic,
                 //                tolerance == 10 means use generated normals
-                BoundaryRep analytic = (BoundaryRep) GraphreeD.clone(bRep);
-                BoundaryRep generated = (BoundaryRep) GraphreeD.clone(bRep);
+                BoundaryRep analytic = (BoundaryRep) GrafreeD.clone(bRep);
+                BoundaryRep generated = (BoundaryRep) GrafreeD.clone(bRep);
 
                 analytic.Trim(trim, false, false, stripify, true);
                 generated.Trim(trim, true, false, stripify, true);
diff --git a/LA.java b/LA.java
index 9b85a39..87bd7d8 100644
--- a/LA.java
+++ b/LA.java
@@ -615,7 +615,7 @@
     private static int indxc[] = new int[4];
     
     
-    static int SIZE = 65536*64;
+    static int SIZE = 0; // 65536*64;
     
     static double[] costable = new double[SIZE];
     static double[] sintable = new double[SIZE];
diff --git a/Merge.java b/Merge.java
index 57b88a3..1c276fb 100644
--- a/Merge.java
+++ b/Merge.java
@@ -192,7 +192,7 @@
         try
         {
             //font = FontRender.createFont("Dialog", 11, false, true);
-            font = new FontRender.GLFont(gl, GraphreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
+            font = new FontRender.GLFont(gl, GrafreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
         } catch (java.io.IOException e)
         {
             e.printStackTrace();
diff --git a/Mocap.java b/Mocap.java
index 88fa618..8af85a4 100644
--- a/Mocap.java
+++ b/Mocap.java
@@ -359,7 +359,7 @@
 //                    //GetFileRoot();
                   
                     // sept 2014: //
-                    GraphreeD.RENDERME = 3; // patch for Merge objects
+                    GrafreeD.RENDERME = 3; // patch for Merge objects
                     float[] thedata = bvh.animation.getBoneData(0);
                     
                     os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]);
@@ -938,6 +938,7 @@
                 
                 groundid = floorid;
                 
+                // green
                 CameraPane.debugpoint.toParent[3][0] = groundx;
                 CameraPane.debugpoint.toParent[3][1] = floor.y;
                 CameraPane.debugpoint.toParent[3][2] = groundz;
@@ -998,7 +999,7 @@
 
                         lastsoundtime = CameraPane.framecount;
                         
-                        GraphreeD.hassound = true;
+                        GrafreeD.hassound = true;
                     }
 //                    else
 //                        System.out.println("skipped");
@@ -1016,6 +1017,7 @@
 //            floor.z += posz;
             
        //     System.out.println("Allo " + sourcenode);
+            // purple
                 CameraPane.debugpoint2.toParent[3][0] = floor.x;// + posx;
                 CameraPane.debugpoint2.toParent[3][1] = ground; // floor.y;// + sourcenode.parent.toParent[3][1];
                 CameraPane.debugpoint2.toParent[3][2] = floor.z;// + posz;
@@ -1052,7 +1054,7 @@
         v0.z = groundz - floor.z;
 
         double distance = Math.sqrt(v0.dot(v0));
-        double maxdist = 0.004;
+        double maxdist = 0.04;
         
         if (distance > maxdist)
         {
@@ -1078,8 +1080,27 @@
                 sourcenode.toParent = LA.newMatrix();
                 sourcenode.fromParent = LA.newMatrix();
             }
+            
+            v0.x = v0.z = 0;
+            
+            this.get(0).TransformToWorld(v0);
+        
+        // cyan
+        CameraPane.debugpoint3.toParent[3][0] = v0.x;
+        CameraPane.debugpoint3.toParent[3][1] = ground;
+        CameraPane.debugpoint3.toParent[3][2] = v0.z;
+        
             LA.matConcat(sourcenode.toParent, transformnode.toParent, sourcenode.toParent);
             LA.matInvert(sourcenode.toParent, sourcenode.fromParent);
+            
+            v0.x = v0.z = 0;
+            
+            this.get(0).TransformToWorld(v0);
+            
+        // red
+        CameraPane.debugpoint4.toParent[3][0] = v0.x;
+        CameraPane.debugpoint4.toParent[3][1] = ground;
+        CameraPane.debugpoint4.toParent[3][2] = v0.z;
         }
     }
     
@@ -1835,7 +1856,7 @@
         {
             SetRotation(sourcenode, new cVector(floor), new cVector(centroid));
         }
-            
+        
         if (setposition)
         {
             if (floorobject != null)
diff --git a/MorphNode.java b/MorphNode.java
index 1818cdf..f11562e 100644
--- a/MorphNode.java
+++ b/MorphNode.java
@@ -19,7 +19,7 @@
         {
             CreateMaterial();
             morphobject.get(0).bRep.SaveSupports();
-            bRep = (BoundaryRep) GraphreeD.clone(morphobject.get(0).bRep);
+            bRep = (BoundaryRep) GrafreeD.clone(morphobject.get(0).bRep);
             morphobject.get(0).bRep.RestoreSupports();
         }
         
@@ -30,7 +30,7 @@
             duplicate.parent = null;
             Object3D sup = duplicate.support;
             duplicate.support = null;
-            addChild((Object3D)GraphreeD.clone(duplicate));
+            addChild((Object3D)GrafreeD.clone(duplicate));
             duplicate.parent = par;
             duplicate.support = sup;
         }
@@ -56,7 +56,7 @@
         
 //        if (bRep == null)
 //        {
-//            bRep = (BoundaryRep) GraphreeD.clone(morphobject.get(0).bRep);
+//            bRep = (BoundaryRep) GrafreeD.clone(morphobject.get(0).bRep);
 //        }
         
         if (CameraPane.SUPPORT && display.drawMode == display.SHADOW)
@@ -112,7 +112,7 @@
         super.deepCopySelf(other);
         MorphNode bp = (MorphNode)other;
         
-        bp.morphweights = (double[]) GraphreeD.clone(morphweights);
+        bp.morphweights = (double[]) GrafreeD.clone(morphweights);
     }
     
     void createEditWindow(GroupEditor callee, boolean newWindow)
diff --git a/ObjEditor.java b/ObjEditor.java
index 22fab98..228f57c 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -692,7 +692,7 @@
     protected static ImageIcon createImageIcon(String path,
             String description)
     {
-        java.net.URL imgURL = GraphreeD.class.getResource(path);
+        java.net.URL imgURL = GrafreeD.class.getResource(path);
         if (imgURL != null)
         {
             return new ImageIcon(imgURL, description);
@@ -1107,7 +1107,7 @@
         //frontScroll.setLabel("------------------------------ XZ (front) ---------------------------------------------------");
         //sideScroll.setLabel("------------------------------- YZ (side) ---------------------------------------------------");
 
-//            GridBagConstraints gbc = (GridBagConstraints) GraphreeD.clone(aConstraints);
+//            GridBagConstraints gbc = (GridBagConstraints) GrafreeD.clone(aConstraints);
         Camera cam = GetCamera(copy, 0);
 
         Composite cams = null;
@@ -1334,7 +1334,7 @@
         frame.getContentPane().add(/*"Center",*/framePanel);
         //frame.getContentPane().add(/*"Center",*/ worldPane);
 
-//            aConstraints = gbc; // (GridBagConstraints) GraphreeD.clone(gbc);
+//            aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
 
         frame.setSize(1024, 768);
         frame.show();
@@ -2345,7 +2345,7 @@
 
     void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
     {
-        if (GraphreeD.standAlone)
+        if (GrafreeD.standAlone)
         {
             /**/
             FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
@@ -3183,8 +3183,8 @@
 
                 CameraPane.ANIMATION ^= true;
 
-                GraphreeD.wav.cursor = 0;
-                GraphreeD.wav.loop = 0;
+                GrafreeD.wav.cursor = 0;
+                GrafreeD.wav.loop = 0;
             }
         } else
         {
@@ -4085,7 +4085,7 @@
 
     void load() // throws ClassNotFoundException
     {
-        if (GraphreeD.standAlone)
+        if (GrafreeD.standAlone)
         {
             FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
             browser.show();
@@ -4190,7 +4190,7 @@
 
     void saveAs()
     {
-        if (GraphreeD.standAlone)
+        if (GrafreeD.standAlone)
         {
             FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
             browser.setVisible(true);
@@ -4213,10 +4213,20 @@
 
         Object3D object = copy.selection.get(0);
         
+        FileObject fileobj = null;
+        
+        if (object instanceof FileObject)
+            fileobj = (FileObject)object;
+        
         if (object.fileparent != null)
         {
-            FileObject fileobj = (FileObject) object.fileparent;
+            assert(fileobj == null);
             
+            fileobj = (FileObject) object.fileparent;
+        }
+            
+        if (fileobj != null)
+        {
             System.out.println("WriteObject " + object + " : " + fileobj.name);
             WriteObject(object, fileobj.name);
         }
@@ -4259,7 +4269,7 @@
             }
         }
         else
-        //if (GraphreeD.standAlone)
+        //if (GrafreeD.standAlone)
         {
             FileDialog browser = new FileDialog(frame, "Export", FileDialog.SAVE);
             browser.setVisible(true);
@@ -4291,7 +4301,7 @@
             Object3D objectparent = obj.parent;
             obj.parent = null;
 
-            Object3D object = (Object3D) GraphreeD.clone(obj);
+            Object3D object = (Object3D) GrafreeD.clone(obj);
 
             obj.parent = objectparent;
 
@@ -4325,7 +4335,7 @@
         buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
         cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
         copy.generatePOV(buffer);
-        if (GraphreeD.standAlone)
+        if (GrafreeD.standAlone)
         {
             FileDialog browser = new FileDialog(frame, "Export POV", 1);
             browser.show();
diff --git a/Object3D.java b/Object3D.java
index 8f3990d..2a7a2a3 100644
--- a/Object3D.java
+++ b/Object3D.java
@@ -935,7 +935,7 @@
 
     public Object clone()
     {
-        return GraphreeD.clone(this);
+        return GrafreeD.clone(this);
     }
 
     Object3D copyExpand()
@@ -1701,7 +1701,7 @@
             Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
             o.bRep = transientrep;
             if (clone)
-                o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
+                o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
             o.CreateMaterial();
             o.SetAttributes(this, -1);
             //parent
@@ -1714,7 +1714,7 @@
             Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
             o.bRep = bRep;
             if (clone)
-                o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
+                o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
             o.CreateMaterial();
             //o.overwriteThis(this, -1);
             o.SetAttributes(this, -1);
@@ -1756,7 +1756,7 @@
 //        {
 //            assert(bRep == null);
 //            Object3D o = new Object3D("Geometry:" + this.name);
-//            o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
+//            o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
 //            o.CreateMaterial();
 //            parent.addChild(o);
 //        }
@@ -1765,7 +1765,7 @@
 //        {
 //            assert(transientrep == null);
 //            Object3D o = new Object3D("Geometry:" + this.name);
-//            o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
+//            o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
 //            o.CreateMaterial();
 //            parent.addChild(o);
 //        }
@@ -3153,7 +3153,7 @@
         
         BoundaryRep sup = bRep.support;
         bRep.support = null;
-        BoundaryRep temprep = (BoundaryRep) GraphreeD.clone(bRep);
+        BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
 //            bRep.SplitInTwo(onlyone); // thread...
             temprep.SplitInTwo(reduction34, onlyone);
             bRep = temprep;
@@ -3677,7 +3677,7 @@
             if (child == null)
                 continue;
             
-            if (GraphreeD.RENDERME > 0)
+            if (GrafreeD.RENDERME > 0)
             {
                 if (child instanceof Merge)
                     ((Merge)child).renderme();
@@ -3828,7 +3828,7 @@
                 if (child == null)
                     continue;
                 
-                if (GraphreeD.RENDERME > 0)
+                if (GrafreeD.RENDERME > 0)
                 {
                     if (child instanceof Merge)
                         ((Merge)child).renderme();
@@ -4023,7 +4023,7 @@
                 if (child == null)
                     continue;
                 
-                if (GraphreeD.RENDERME > 0)
+                if (GrafreeD.RENDERME > 0)
                 {
                     if (child instanceof Merge)
                         ((Merge)child).renderme();
@@ -5819,12 +5819,12 @@
             if (!child.HasTransparency())
             {
                 sel = root != null && root.selection != null && root.selection.indexOf(child) != -1;
-           //     GraphreeD.tracein("draw ", child);
+           //     GrafreeD.tracein("draw ", child);
                 boolean wasblocked = blockdraw;
                 blockdraw = true;
                 child.draw(display, root, selected || sel, wasblocked || blocked); //  || child.IsSelected());
                 blockdraw = false;
-           // GraphreeD.traceout("draw ", child);
+           // GrafreeD.traceout("draw ", child);
             }
 
             release(i);
@@ -8041,7 +8041,7 @@
         {
             assert(bRep != null);
             if (!(support instanceof GenericJoint)) // support.bRep != null)
-                GraphreeD.Assert(support.bRep == bRep.support);
+                GrafreeD.Assert(support.bRep == bRep.support);
         }
         else
         {
diff --git a/RandomNode.java b/RandomNode.java
index 34cf047..20dd4e6 100644
--- a/RandomNode.java
+++ b/RandomNode.java
@@ -95,7 +95,7 @@
         
             //(int)(Math.random()*super.size());
         //globalcount++;
-        gcount += GraphreeD.mix3(rnd+12345,firstchoice*12345,gcount);
+        gcount += GrafreeD.mix3(rnd+12345,firstchoice*12345,gcount);
         
         gcount &= 0x7fffffff;
         
diff --git a/SwitchNode.java b/SwitchNode.java
index 962a851..fc726c6 100644
--- a/SwitchNode.java
+++ b/SwitchNode.java
@@ -20,7 +20,7 @@
         {
             CreateMaterial();
             switchobject.get(0).bRep.SaveSupports();
-            bRep = (BoundaryRep) GraphreeD.clone(switchobject.get(0).bRep);
+            bRep = (BoundaryRep) GrafreeD.clone(switchobject.get(0).bRep);
             switchobject.get(0).bRep.RestoreSupports();
         }
         
@@ -30,7 +30,7 @@
             Object3D par = duplicate.parent;
             duplicate.parent = null;
             duplicate.SaveSupports();
-            addChild((Object3D)GraphreeD.clone(duplicate));
+            addChild((Object3D)GrafreeD.clone(duplicate));
             duplicate.parent = par;
             duplicate.RestoreSupports();
         }
@@ -97,7 +97,7 @@
         
         if (bRep == null)
         {
-            bRep = (BoundaryRep) GraphreeD.clone(switchobject.get(0).bRep);
+            bRep = (BoundaryRep) GrafreeD.clone(switchobject.get(0).bRep);
         }
         
         if (CameraPane.SUPPORT && display.drawMode == display.SHADOW)
diff --git a/Texture.java b/Texture.java
index cb0153c..8f0cc1d 100644
--- a/Texture.java
+++ b/Texture.java
@@ -10,8 +10,8 @@
 public class Texture extends Composite implements java.io.Serializable
 {
     // deprecated due to serial problems
-    static final long serialVersionUID = -5280151442948961597L; // new java
-                                         //   7695543694999681408L; // old java !!!
+    static final long serialVersionUID = // -5280151442948961597L; // new java
+                                         7695543694999681408L; // old java !!!
     
     // default = -8076744133104150348L
     
diff --git a/Vertex.java b/Vertex.java
index 87c5cac..af5fabf 100644
--- a/Vertex.java
+++ b/Vertex.java
@@ -132,9 +132,9 @@
 
         return Math.abs(/*pos.*/x - vert./*pos.*/x) +
                 Math.abs(/*pos.*/y - vert./*pos.*/y) +
-                Math.abs(/*pos.*/z - vert./*pos.*/z) < 0.00001 && // GraphreeD.epsvertex2 && // WARNING: USE 0.0001 for serial issues
-                (GraphreeD.linkUV || Math.abs(s - vert.s) + Math.abs(t - vert.t) < 0.00001)
-                ; // GraphreeD.epsvertex2;
+                Math.abs(/*pos.*/z - vert./*pos.*/z) < 0.00001 && // GrafreeD.epsvertex2 && // WARNING: USE 0.0001 for serial issues
+                (GrafreeD.linkUV || Math.abs(s - vert.s) + Math.abs(t - vert.t) < 0.00001)
+                ; // GrafreeD.epsvertex2;
     }
     /*
     public boolean isSame(Object o)
diff --git a/cMaterial.java b/cMaterial.java
index 26d3ebe..06f35ec 100644
--- a/cMaterial.java
+++ b/cMaterial.java
@@ -144,7 +144,7 @@
             
         cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
 
-        float[] colorV = GraphreeD.colorV;
+        float[] colorV = GrafreeD.colorV;
 
         /**/
         if (display.drawMode == display.DEFAULT) // && display.RENDERPROGRAM == 0)
diff --git a/cMesh.java b/cMesh.java
index 24ad433..af52c25 100644
--- a/cMesh.java
+++ b/cMesh.java
@@ -402,8 +402,8 @@
         if (ref == null)
             return;
         
-        GraphreeD.epsequal = IsEpsEqual();
-        GraphreeD.linkUV = IsLinkUV();
+        GrafreeD.epsequal = IsEpsEqual();
+        GrafreeD.linkUV = IsLinkUV();
         
 //        BoundaryRep oldrep = transientrep;
         
@@ -417,7 +417,7 @@
         Object3D obj = ref.GetObject();
         
         // may 2014: side-effect with UVs!!
-        obj = (Object3D) GraphreeD.clone(obj);
+        obj = (Object3D) GrafreeD.clone(obj);
         
         merge(obj);
 
@@ -427,7 +427,7 @@
         bRep.Trim(false, false,false,false,false);
             System.out.println("------> TRIM " + ref + "; #vertices = " + bRep.VertexCount() + "; #faces = " + bRep.FaceCount());
 
-        GraphreeD.epsequal = false;
+        GrafreeD.epsequal = false;
 
         if (transientrep != null && bRep.VertexCount() == transientrep.VertexCount())
         {
@@ -468,7 +468,7 @@
         }
         else
             // geometry is merged...
-            refcopy = (BoundaryRep) GraphreeD.clone(transientrep);
+            refcopy = (BoundaryRep) GrafreeD.clone(transientrep);
     }
     
     transient cVector minima = new cVector();
diff --git a/cRadio.java b/cRadio.java
index cc588cf..fdd8308 100644
--- a/cRadio.java
+++ b/cRadio.java
@@ -32,7 +32,7 @@
         if (link)
             camera = c;
         else
-            camera = (Camera)GraphreeD.clone(c);
+            camera = (Camera)GrafreeD.clone(c);
     }
     
     Object3D object;
diff --git a/cVector.java b/cVector.java
index bcf0987..3e59c06 100644
--- a/cVector.java
+++ b/cVector.java
@@ -266,7 +266,7 @@
         long ly = Double.doubleToRawLongBits(y);
         long lz = Double.doubleToRawLongBits(z);
 
-        if (GraphreeD.epsequal)
+        if (GrafreeD.epsequal)
         {
             return 0;
         } else

--
Gitblit v1.6.2