Builds a vertex list adding barycentric coordinates to each vertex.

        Used to draw turtle borders efficiently, specialised to draw only the
        some edges. See below for references.

        http://stackoverflow.com/questions/18035719/drawing-a-border-on-a-2d-polygon-with-a-fragment-shader  # NOQA
        http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/  # NOQA
        http://strattonbrazil.blogspot.co.uk/2011/09/single-pass-wireframe-rendering_11.html  # NOQA

def calculate_edges(self, excludes):
        """Builds a vertex list adding barycentric coordinates to each vertex.

        Used to draw turtle borders efficiently, specialised to draw only the
        some edges. See below for references.

        http://stackoverflow.com/questions/18035719/drawing-a-border-on-a-2d-polygon-with-a-fragment-shader  # NOQA
        http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/  # NOQA
        http://strattonbrazil.blogspot.co.uk/2011/09/single-pass-wireframe-rendering_11.html  # NOQA
        """
        edges = []
        MEW = 100.0
        if excludes is None:
            excludes = [0] * len(self.indices) * 2
        for i in range(0, len(self.indices), 3):  # each triangle
            i0 = self.indices[i+0] * 4
            i1 = self.indices[i+1] * 4
            i2 = self.indices[i+2] * 4
            e0 = excludes[i+0]
            e1 = excludes[i+1]
            e2 = excludes[i+2]
            p0 = self.vertices[i0:i0+4]
            p1 = self.vertices[i1:i1+4]
            p2 = self.vertices[i2:i2+4]
            v0 = self.vec2minus(p2, p1)
            v1 = self.vec2minus(p2, p0)
            v2 = self.vec2minus(p1, p0)
            area = fabs(v1[0]*v2[1] - v1[1] * v2[0])
            c0 = (area/self.magnitude(v0), e1 * MEW, e2 * MEW)
            c1 = (e0 * MEW, area/self.magnitude(v1), e2 * MEW)
            c2 = (e0 * MEW, e1 * MEW, area/self.magnitude(v2))
            edges.extend(p0)
            edges.extend(c0)
            edges.extend(p1)
            edges.extend(c1)
            edges.extend(p2)
            edges.extend(c2)
        return create_vertex_buffer(edges)