<< Prev Next >>


Polylines Nets

Polylines Nets are a simple extension of 3D Meshes used in Computer Graphics.

From Meshes to Polylines Nets

In order to understand Polylines Nets, you need first to understand 3D Meshes as Lines Nets.

A Mesh is indeed a set of vertices (each one with a set of properties like normals or uv coordinates). Vertices are connected together with faces, usually triangles or quads.


      o Cube
      v 1.000000 -1.000000 -1.000000
      v 1.000000 -1.000000 1.000000
      v -1.000000 -1.000000 1.000000
      v -1.000000 -1.000000 -1.000000
      v 1.000000 1.000000 -0.999999
      v 0.999999 1.000000 1.000001
      v -1.000000 1.000000 1.000000
      v -1.000000 1.000000 -1.000000
      s 1
      f 1 2 3 4
      f 5 8 7 6
      f 1 5 6 2
      f 2 6 7 3
      f 3 7 8 4
      f 5 1 4 8
      

Fig. 1 A simple 3D Mesh written in OBJ File format. Each vertex has a v (position). f means face, and its represented as the indexed list of vertices to be used. Data here are exported with Blender.

Let's Take the first and third faces in the example (Fig. 1). They both cotaints vertex/normal pairs 1//1 and 2//2. This means that the two faces will connect through a Linear Edge connecting 1//1 and 2//2.

So: we could say a mesh is a set of vertices connected with simple lines and that lines join to shape a face. Lines don't need to be explicitely present in file and data formats because they are intrinsicly derived from faces. An Obj File with explicit lines would look like this (Fig. 2):


    o Cube
    v 1.000000 -1.000000 -1.000000
    v 1.000000 -1.000000 1.000000
    v -1.000000 -1.000000 1.000000
    v -1.000000 -1.000000 -1.000000
    v 1.000000 1.000000 -0.999999
    v 0.999999 1.000000 1.000001
    v -1.000000 1.000000 1.000000
    v -1.000000 1.000000 -1.000000
    s 1
    l 1 2
    l 2 3
    l 3 4
    l 4 1
    l 5 6
    l 6 7
    l 7 8
    l 8 5
    l 1 5
    l 2 6
    l 3 7
    l 4 8
    f 1 2 3 4
    f 5 8 7 6
    f 1 5 6 2
    f 2 6 7 3
    f 3 7 8 4
    f 5 1 4 8
        

Fig. 2 A simple 3D Mesh written in OBJ File format using lines. Here we use l to explicitly show lines between couple of vertices, even if its not part of the Obj File format.

Now: what does it happen if we try to make the model more complex by replacing simple lines with something a bit more complex?

Polylines Nets

A Polylines Net is a Mesh whose vertices are connected with polylines instead of simple lines. The Faces of a Polylines Net have more complex edges than the ones of a standard Mesh.

In order to understand what this means we should start with something more simple. Since modern GPUs are extremely optimized to render triangles, every face of a Mesh must be tessellated into triangles first. This is what already happens to Quads Meshes (Fig.3):

Fig. 3 A (very simple) Quads Meshes and its tessellation into triangles, required for rendering processing happening in modern graphics hardware.

For Quads Meshes, an algorithm is applied to cut each quad into two triangles. For Polylines Net the approach is the same, and we need an Algorithm to Fill the internal part of each face (surrounded with polylines) with a correct amount of triangles (Fig.4) :

Fig. 4 A simple example of Tessellation of polylines nets. The first polylines net has 1 face with 4 vertices and 4 polylines, with every polyline made of 2 segments. Similarly, the first polylines net has 1 face with 4 vertices and 4 polylines, but every polyline is made of 4 segments. It should be clear after this example that using polylines nets dramatically reduce the amount of data required to describe a model, since most of the vertices and faces of the final triangles mesh are computed during tessellation.

We may call this algorithm either the Tessellation Algorithm (because it tessellates the net), the Interpolation Algorithm (because it must interpolate the shape of the polylines into a complex surface) or the Filling Algorithm (because it fills the inner part of the face with triangles).

Filling Algorithms: Data Compression and Decompression

A Filling Algorithm generates a (Triangles) Mesh from a Polylines Net. This process can be seen as a decompression process, since the number of vertices of the Mesh will be higher than those of the starting Polyline Net.

For this reason, the Polyline Net is a much more suitable Model for transfering mesh data across the Web.

Conceptually, we could even think about an algorithm trying to revert the process, being capable to convert a mesh into a Polylines Net. That algorithm would work as a compression algorithm. The conversion of a mesh into a Polygons Net is still not part of the Shadow Framework, but its an hot research theme at Mushrooms Labs




<< Prev Next >>