This library requires a specifically formatted table to pull data from. This library uses my Wavefront Object Loader to parse an Object file into Lua. You can forego this step if you would prefer to create the initial data manually.

Create Object Via WE.new()

local we = require "winged-edge"

local obj = we.new("some_file.obj")

Create Object Via Manual Data

local we = require "winged-edge"

local data = {
    v = {
        { x=0, y=0, z=0 },
        { x=1, y=0, z=0 },
        { x=0, y=1, z=0 },
        { x=1, y=1, z=0 },
    },
    f = {
        { { v=1 }, { v=2 }, { v=3 } },
        { { v=2 }, { v=3 }, { v=4 } },
    },
}

local object = {}
we.parseVertices(data, object)
we.parseFaces(data, object)