src/module.js
/**
   * render creates an SVGGroupElement containing the rendered region paths
   * @param {Boolean} [unify] merges region paths with a union operation, removing overlaps. Expensive so defaults to false.
   * @returns {Object} the group element
   */
render creates an SVGGroupElement containing the rendered region paths
@param {Boolean} [unify] merges region paths with a union operation, removing overlaps. Expensive so defaults to false.
@returns {Object} the group element
render creates an SVGGroupElement containing the rendered region paths @param { Boolean } [ unify ] merges region paths with a union operation removing overlaps . Expensive so defaults to false . @returns { Object } the group element
function render(unify = false) {
    let wordmarkGroup = createSVGElement('g');
    wordmarkGroup.setAttribute('class', 'bowlcut-' + wordmark.uniqueId);
    wordmark.regions.forEach((region) => {
      wordmarkGroup.appendChild(region.renderRegion());
    });
    if (unify) {
      wordmarkGroup = papercut(wordmarkGroup);
    }
    if (wordmark.debug) {
      wordmark.regions.forEach((region) => {
        region.topPath.setAttribute('stroke', 'red');
        region.bottomPath.setAttribute('stroke', 'red');
        region.topPath.setAttribute('fill', 'none');
        region.bottomPath.setAttribute('fill', 'none');
        wordmarkGroup.appendChild(region.topPath);
        wordmarkGroup.appendChild(region.bottomPath);
        for (let debugPtIndex in region.debugPoints) {
          let ptData = region.debugPoints[debugPtIndex];
          let upPt = createSVGElement('circle');
          upPt.setAttribute('cx',ptData.x);
          upPt.setAttribute('cy',ptData.y);
          upPt.setAttribute('r',2);
          upPt.setAttribute('fill','#00ff00');
          wordmarkGroup.appendChild(upPt);
        }
      });
    }
    return wordmarkGroup;
  }
function render ( unify = false ) { let wordmarkGroup = createSVGElement ( 'g' ) ; wordmarkGroup . setAttribute ( 'class' , 'bowlcut-' + wordmark . uniqueId ) ; wordmark . regions . forEach ( ( region ) => { wordmarkGroup . appendChild ( region . renderRegion ( ) ) ; } ) ; if ( unify ) { wordmarkGroup = papercut ( wordmarkGroup ) ; } if ( wordmark . debug ) { wordmark . regions . forEach ( ( region ) => { region . topPath . setAttribute ( 'stroke' , 'red' ) ; region . bottomPath . setAttribute ( 'stroke' , 'red' ) ; region . topPath . setAttribute ( 'fill' , 'none' ) ; region . bottomPath . setAttribute ( 'fill' , 'none' ) ; wordmarkGroup . appendChild ( region . topPath ) ; wordmarkGroup . appendChild ( region . bottomPath ) ; for ( let debugPtIndex in region . debugPoints ) { let ptData = region . debugPoints [ debugPtIndex ] ; let upPt = createSVGElement ( 'circle' ) ; upPt . setAttribute ( 'cx' , ptData . x ) ; upPt . setAttribute ( 'cy' , ptData . y ) ; upPt . setAttribute ( 'r' , 2 ) ; upPt . setAttribute ( 'fill' , '#00ff00' ) ; wordmarkGroup . appendChild ( upPt ) ; } } ) ; } return wordmarkGroup ; }
render creates an SVGGroupElement containing the rendered region paths
 @param {Boolean} [unify] merges region paths with a union operation, removing overlaps.
render creates an SVGGroupElement containing the rendered region paths @param { Boolean } [ unify ] merges region paths with a union operation removing overlaps .