commit 1ce7e2f6cbdb1ace716ba155d9719ae72b1c54af
Author: leszek <leszek@koltunski.pl>
Date:   Tue Aug 1 23:38:46 2023 +0200

    change the way the coordinates of stickers are kept from float[2*N] to float[N][2]

diff --git a/src/main/java/org/distorted/library/mesh/MeshMultigon.java b/src/main/java/org/distorted/library/mesh/MeshMultigon.java
index a91a082..e974c8f 100644
--- a/src/main/java/org/distorted/library/mesh/MeshMultigon.java
+++ b/src/main/java/org/distorted/library/mesh/MeshMultigon.java
@@ -613,7 +613,7 @@ public class MeshMultigon extends MeshBase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public static float[][][] computeOuterVertices(float[][] vertices, int[][] edgesUp)
+  public static float[][][] computeOuterAndHoleVertices(float[][] vertices, int[][] edgesUp)
     {
     ArrayList<float[]> tmp = new ArrayList<>();
 
@@ -667,7 +667,7 @@ public class MeshMultigon extends MeshBase
     MeshBandedTriangle[] triangles = new MeshBandedTriangle[numTriangles];
 
     int[][] edgesUp = computeEdgesUp(vertices);
-    mOuterAndHoleVertices = computeOuterVertices(vertices,edgesUp);
+    mOuterAndHoleVertices = computeOuterAndHoleVertices(vertices,edgesUp);
 
     computeEdgeVectors(vertices,edgesUp);
 
diff --git a/src/main/java/org/distorted/library/mesh/MeshPolygon.java b/src/main/java/org/distorted/library/mesh/MeshPolygon.java
index 8bb7744..1eabdf0 100644
--- a/src/main/java/org/distorted/library/mesh/MeshPolygon.java
+++ b/src/main/java/org/distorted/library/mesh/MeshPolygon.java
@@ -34,7 +34,7 @@ public class MeshPolygon extends MeshBase
   {
   private static final int NUM_CACHE = 20;
 
-  private float[] mPolygonVertices;
+  private float[][] mPolygonVertices;
   private int mNumPolygonVertices;
   private float[] mPolygonBands;
   private int mNumPolygonBands;
@@ -184,10 +184,10 @@ public class MeshPolygon extends MeshBase
     {
     remainingVert--;
 
-    float Xfirst= mPolygonVertices[2*polyVertex  ];
-    float Yfirst= mPolygonVertices[2*polyVertex+1];
-    float Xlast = mPolygonVertices[2*polyEndVer  ];
-    float Ylast = mPolygonVertices[2*polyEndVer+1];
+    float Xfirst= mPolygonVertices[polyVertex][0];
+    float Yfirst= mPolygonVertices[polyVertex][1];
+    float Xlast = mPolygonVertices[polyEndVer][0];
+    float Ylast = mPolygonVertices[polyEndVer][1];
 
     float xEdge = Xfirst + quot*(Xlast-Xfirst);
     float yEdge = Yfirst + quot*(Ylast-Yfirst);
@@ -275,7 +275,7 @@ public class MeshPolygon extends MeshBase
  * Create a polygon of any shape and varying elevations from the edges towards the center.
  * Optionally make it more dense at the vertices.
  *
- * @param verticesXY 2N floats - packed description of polygon vertices. N pairs (x,y).
+ * @param verticesXY [N][2] floats - polygon vertices. N pairs (x,y).
  *                   Vertices HAVE TO be specified in a COUNTERCLOCKWISE order (starting from any).
  * @param bands      2K floats; K pairs of two floats each describing a single band.
  *                   From (1.0,Z[0]) (outer edge, its Z elevation) to (0.0,Z[K]) (the center,
@@ -290,13 +290,13 @@ public class MeshPolygon extends MeshBase
  *                   all bands go to.
  * @param centerY    Y coordinate of the center.
  */
-  public MeshPolygon(float[] verticesXY, float[] bands, int exBand, int exVertices, float centerX, float centerY)
+  public MeshPolygon(float[][] verticesXY, float[] bands, int exBand, int exVertices, float centerX, float centerY)
     {
     super();
 
     mPolygonVertices   = verticesXY;
     mPolygonBands      = bands;
-    mNumPolygonVertices= mPolygonVertices.length /2;
+    mNumPolygonVertices= mPolygonVertices.length;
     mNumPolygonBands   = mPolygonBands.length /2;
     extraBand          = exBand;
     extraVertices      = exVertices;
@@ -305,8 +305,8 @@ public class MeshPolygon extends MeshBase
       {
       for(int v=0; v<mNumPolygonVertices; v++)
         {
-        mPolygonVertices[2*v  ] -= centerX;
-        mPolygonVertices[2*v+1] -= centerY;
+        mPolygonVertices[v][0] -= centerX;
+        mPolygonVertices[v][1] -= centerY;
         }
       }
 
@@ -337,7 +337,7 @@ public class MeshPolygon extends MeshBase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public MeshPolygon(float[] verticesXY, float[] bands, int exIndex, int exVertices)
+  public MeshPolygon(float[][] verticesXY, float[] bands, int exIndex, int exVertices)
     {
     this(verticesXY,bands,exIndex,exVertices,0.0f,0.0f);
     }
@@ -347,7 +347,7 @@ public class MeshPolygon extends MeshBase
  * Create a polygon of any shape and varying elevations from the edges towards the center.
  * Equivalent of the previous with exIndex=0 or exVertices=0.
  */
-  public MeshPolygon(float[] verticesXY, float[] bands)
+  public MeshPolygon(float[][] verticesXY, float[] bands)
     {
     this(verticesXY,bands,0,0,0.0f,0.0f);
     }
