Class Tessellator

java.lang.Object
org.oscim.utils.Tessellator

public class Tessellator extends Object
  • Constructor Details

    • Tessellator

      public Tessellator()
  • Method Details

    • tessellate

      public static int tessellate(float[] points, int ppos, int numPoints, int[] index, int ipos, int numRings, int vertexOffset, VertexData outTris)
      Special version for ExtrusionLayer to match indices with vertex positions. Tessellates polygon in tris elements.
      Parameters:
      points - the GeometryBuffer.points
      ppos - the start point in GeometryBuffer.points (not needed)
      numPoints - the points array size GeometryBuffer.pointNextPos
      index - the GeometryBuffer.index
      ipos - the GeometryBuffer.indexCurrentPos
      numRings - the number of ring polygons
      vertexOffset - shift outTris index with offset
      outTris - the tessellated polygon as triangular VertexData
      Returns:
      number of indices of outTris
    • tessellate

      public static int tessellate(GeometryBuffer geom, GeometryBuffer outMesh)
      Tessellates a GeometryBuffer to a triangular/mesh GeometryBuffer. The points array remains the same.
      Parameters:
      geom - the input GeometryBuffer as POLY or LINE
      outMesh - the out GeometryBuffer as MESH, but has 2D point coordinates.
      Returns:
      number of indices of out3D (0 if tessellation failed)