src/gfx/render.js
function(traces, vertsPerSlice, splineDetail) {
  var numVerts = 0;
  for (var i = 0; i < traces.length; ++i) {
    var traceVerts = 
      ((traces[i].length() - 1) * splineDetail + 1) * vertsPerSlice;
    // in case there are more than 2^16 vertices for a single trace, we
    // need to manually split the trace in two and duplicate one of the
    // trace slices. Let's make room for some additional space...
    var splits = Math.ceil((traceVerts + 2)/65536);
    numVerts += traceVerts + (splits - 1) * vertsPerSlice;
    // triangles for capping the tube
    numVerts += 2;
  }
  return numVerts;
}
function(traces, vertsPerSlice, splineDetail) {
  var numVerts = 0;
  for (var i = 0; i < traces.length; ++i) {
    var traceVerts = 
      ((traces[i].length() - 1) * splineDetail + 1) * vertsPerSlice;
    // in case there are more than 2^16 vertices for a single trace, we
    // need to manually split the trace in two and duplicate one of the
    // trace slices. Let's make room for some additional space...
    var splits = Math.ceil((traceVerts + 2)/65536);
    numVerts += traceVerts + (splits - 1) * vertsPerSlice;
    // triangles for capping the tube
    numVerts += 2;
  }
  return numVerts;
}
function ( traces , vertsPerSlice , splineDetail ) { var numVerts = 0 ; for ( var i = 0 ; i < traces . length ; ++ i ) { var traceVerts = ( ( traces [ i ] . length ( ) - 1 ) * splineDetail + 1 ) * vertsPerSlice ; // in case there are more than 2^16 vertices for a single trace, we // need to manually split the trace in two and duplicate one of the // trace slices. Let's make room for some additional space... var splits = Math . ceil ( ( traceVerts + 2 ) / 65536 ) ; numVerts += traceVerts + ( splits - 1 ) * vertsPerSlice ; // triangles for capping the tube numVerts += 2 ; } return numVerts ; }
calculates the number of vertices required for the cartoon and tube render styles
calculates the number of vertices required for the cartoon and tube render styles