index.js
function Chain(opts) {

  if (!(this instanceof Chain)) {
    return new Chain(opts);
  }

  if (opts.constructor) {
    this.devices = new opts.constructor(opts.actuators);
  } else {
    this.devices = opts.actuators;
  }

  this.chainType = opts.chainType;

  this.links = opts.links;

  this.origin = opts.origin || [0, 0, 0];
  this.position = opts.startAt || [0, 0, 0];

  this.require = opts.require || true;

}
function Chain(opts) {

  if (!(this instanceof Chain)) {
    return new Chain(opts);
  }

  if (opts.constructor) {
    this.devices = new opts.constructor(opts.actuators);
  } else {
    this.devices = opts.actuators;
  }

  this.chainType = opts.chainType;

  this.links = opts.links;

  this.origin = opts.origin || [0, 0, 0];
  this.position = opts.startAt || [0, 0, 0];

  this.require = opts.require || true;

}
function Chain ( opts ) { if ( ! ( this instanceof Chain ) ) { return new Chain ( opts ) ; } if ( opts . constructor ) { this . devices = new opts . constructor ( opts . actuators ) ; } else { this . devices = opts . actuators ; } this . chainType = opts . chainType ; this . links = opts . links ; this . origin = opts . origin || [ 0 , 0 , 0 ] ; this . position = opts . startAt || [ 0 , 0 , 0 ] ; this . require = opts . require || true ; }
Wrap our servos object so that we have all the info and methods we need to define and solve our the kinematic system  @param {Object} opts Options: {actuators, systemType, origin, bones } - opts.actuators {Servos}: The Servos() object that contains the chain's actuators - opts.chainType {String}: One of the pre-defined chain types. Don't see your system type? Open an issue, or better yet a Pull Request! - opts.origin {Array}: A three-tuple representing the x, y and z offset of the chain's origin point from the robot's origin point. - opts.links {Object}: An array with the link lengths for our system The names vary with the systemType  returns this chain
Wrap our servos object so that we have all the info and methods we need to define and solve our the kinematic system