message: add brick and honeycomb layout
diff: @@ -40,4 +40,45 @@ namespace MakerJs.layout {
  return cloneToColumn(cloneToRow(itemToClone, xCount, margin), yCount, margin);
  }
  + function cloneToAlternate(itemToClone: IModel | IPath, xCount: number, yCount: number, margin: number, spacingFn: (modelToMeasure: IModel) => IPoint): IModel {
  + var modelToMeasure: IModel;
  + if (isModel(itemToClone)) {
  + modelToMeasure = itemToClone;
  + } else {
  + modelToMeasure = { paths: { "0": itemToClone as IPath } };
  + }
  +
  + var spacing = spacingFn(modelToMeasure);
  + var result: IModel = { models: {} };
  +
  + for (var i = 0; i < yCount; i++) {
  + var i2 = i % 2;
  + result.models[i] = model.move(cloneToRow(itemToClone, xCount + i2, margin), [i2 * spacing[0], i * spacing[1]]);
  + }
  +
  + return result;
  + }
  +
  + export function cloneToBrick(itemToClone: IModel | IPath, xCount: number, yCount: number, margin = 0): IModel {
  +
  + function spacing(modelToMeasure: IModel) {
  + var m = measure.modelExtents(modelToMeasure);
  + return [(m.width + margin) / -2, m.height + margin];
  + }
  +
  + return cloneToAlternate(itemToClone, xCount, yCount, margin, spacing);
  + }
  +
  + export function cloneToHoneycomb(itemToClone: IModel | IPath, xCount: number, yCount: number, margin = 0): IModel {
  +
  + function spacing(modelToMeasure: IModel) {
  + var hex = measure.boundingHexagon(modelToMeasure);
  + var width = 2 * solvers.equilateralAltitude(hex.radius);
  + var s = width + margin;
  + return [s / -2, solvers.equilateralAltitude(s)];
  + }
  +
  + return cloneToAlternate(itemToClone, xCount, yCount, margin, spacing);
  + }
  +
  }
  