Skip to content

mattsouth/woodentrack

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
etc
 
 
lib
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Woodentrack is a coffeescript library for designing and testing toy train track layouts.

It has a few dependencies for running tests, as shown in package.json. run "npm install" to set them up.

Notes

This project is an exercise in getting to grips with SVG that may also allow a developer to play with the idea of:

  1. creating a single track from a set number of pieces that a train can fully traverse
  2. automatically designing aesthetically pleasing tracks
  3. touch interfaces

woodentrack.coffee defines an API for building and manipulating the model of a track. svg "painters" are defined that use both d3js and raphaeljs svg libraries. woodentrack.random.coffee provides some functions for randomly generating a track.

Demos

To see demos in /etc locally, use superstatic or similar.

  1. demo.html: simple page with empty canvas. open console. start building track.
  2. d3.html / raphael.html: random track builders

Potential demos

  1. easy to use track drawing application - use interact.js?
  2. take existing track and click button to morph track into another layout with the same pieces and the same number of loose ends

TODO:

  • documentation of trigonometry with litcoffee / coffeedoc.info
  • pan / zoom for raphael painter
  • make pan / zoom optional for d3 painter
  • optimisation for random demo that slows up as n increases
  • removeAndJoin method (rename of existing remove method and a new remove added that doesnt change the rest of the track)
  • move method (move a section / part section / piece)
  • add directions (IN/OUT) on connections that need to be matched - i.e. IN+OUT makes a connection

About

A javascript library for constructing toy wooden train track designs in SVG

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published