LuaCrumbs is currently in ALPHA - some work on the core still to be made before opening BETA. Status and downloads at: http://www.nodepond.com/luacrumbs
The e-mail service is up and running. People can register now! (Notice: Sometimes the mail-delivery is delayed for some minutes..)
New LuaCrumbs (Core-)architecture for BETA-release
  • Here is a first preview of the style you will code after my rewrite of the core-engine of luacrumbs.
    local lc = require ("luacrumbs")
    require("Pde")
    require("Hpgl")
     
    local pde = Pde.new()
    local hpgl = Hpgl.new()
     
    lc.addFormat(pde)
    lc.addFormat(hpgl)
    lc.init("hello core")
     
    pde:inspect() -- print Pde-format-infos to console
     
    lc.moveTo(10,10)
    lc.setSpeed(100)
    lc.pause(2)
    lc.moveToZ(2)
    lc.pencilUp()
    lc.pencilUp()
    lc.pencilDown()
    lc.pencilDown()
     
    lc.close()


    Every format, that should be generated is encapsuled in a Class. You call that class and add it as a "format" to the luacrumbs engine. Then you call your moveTo, pencilUp, etc.. statements as usual. All implementation-details of each single format will be hidden in the format-Classes while "LuaCrumbs" itself does a little adminstrating-work like keeping up with x,y,z-positions. The big plus is an extremely clean codebase, while the possible formats that Lua Crumbs can generate is extremely easily extendable by just anyone who can write a little code (I will add an example for the class-architecture a little bit later).
  • And here is a "complete" implementation of a formatClass definition. In this case the html-file does not implement motion, but maybe you get the idea. Quite just *some* methods to implement.
    -----------------------------------------------------------------------------
    -- LuaCrumbs - Html3D- to use with processing js implementation
    -- http://luacrumbs.nodepond.com
    --
    -- License: MIT/X
    --
    -- (c) 2012 Nodepond.com / Martin Wisniowski (hello@nodepond.com)
    --
    -- Work started on this file on 11. June 2012
    -- First version 17. November 2012
    -----------------------------------------------------------------------------
     
    -- simple class constructor
    Html3D = {}
    Html3D.__index = Html3D
     
    function Html3D.new()
    local html3d = {}
    setmetatable(html3d,Html3D)
    return html3d
    end
     
    function Html3D:init(_projectname)
    self.projectname = _projectname
    end
     
    function Html3D:inspect()
    print("Html3D nothing to inspect")
    end
     
    function Html3D:moveTo(_x, _y)
    -- nothing to do
    end
     
    function Html3D:moveToZ(_z)
    -- nothing to do
    end
     
    function Html3D:setSpeed(_speed)
    -- nothing to do
    end
     
    function Html3D:pause(_seconds)
    -- nothing to do
    end
     
    function Html3D:pencilUp(_isPencilUpAlreadyUp)
    -- nothing to do
    end
     
    function Html3D:pencilDown(_isPencilUpAlreadyDown)
    -- nothing to do
    end
     
    function Html3D:close()
     
    print("\nStarting to write html 3d-file.")
    local output_file = self.projectname.."-3d.html"
    file = io.open(output_file, "w+")
    print("Opened file: "..output_file)
     
    file:write(self:getHeader())
    file:write(self:getBody())
    file:write(self:getFooter())
     
    print("Writing of "..output_file.." complete.\n")
    end
     
     
    function Html3D:getHeader()
    self.header = "<html>\n"
    self.header = self.header.."<head>\n"
    self.header = self.header.."<title>"..self.projectname.." - Made with LuaCrumbs - luacrumbs.org</title>\n"
    self.header = self.header.."<style>body { font-family: helvetica, arial, sans-serif;\nfont-size: 11px;\nline-height: 18px; } a, a:hover, a:link, a:active { color:#339933; }</style>\n"
    self.header = self.header.."</head>\n"
    self.header = self.header.."<body>\n"
    self.header = self.header.."<script src=\"./3rdparty/processing-1.3.6.min.js\"></script>\n"
    self.header = self.header.."<div><canvas data-processing-sources=\""..self.projectname..".pde\"></canvas></div>\n"
    self.header = self.header.."<div>move mouse to rotate, drag mouse to move focus point<br />\n"
    self.header = self.header.."<br />\n"
    self.header = self.header.."r - toggle automatic rotation<br />\n"
    self.header = self.header.."x, y, z - toggle autorotate x, y, z-axis<br />\n"
    self.header = self.header.."c - alternate colorscheme<br />\n"
    self.header = self.header.."<br />\n"
    self.header = self.header.."generated with <a href=\"http://www.luacrumbs.org/\">LuaCrumbs</a> a project from <a href=\"http://www.nodepond.com\">Nodepond</a><br />\n"
    self.header = self.header.."</div>\n"
     
    return self.header
    end
    function Html3D:getBody()
    self.body = "\n"
    return self.body
    end
    function Html3D:getFooter()
    self.footer = ""
    self.footer = self.footer.."</body>\n"
    self.footer = self.footer.."</html>\n"
    return self.footer
    end
     
    return Html3D
  • Ok, just notice. Details are about to change.. ^^
  • Freshed up the visualizer as well with "pencilUp"-color
    Bildschirmfoto 2012-11-18 um 00.43.01.png
    1108 x 576 - 102K

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Tagged