     if @lastChunkZ < 0
       console.log "last chunk is at #{@lastChunkZ}, Cerating new chunk..."
       chunk = @makeChunk()
-      chunkLen = @chunkSize * @stepZ
+      chunkLen = @tubing.chunkLen()
       @lastChunkZ += chunkLen
       chunk.position.setZ @lastChunkZ
       @chunks.push chunk
       @group.add chunk
-      console.log "Created, addded at #{@lastChunkZ} chunk of len #{chunkLen}"
+      console.log "Created, added at #{@lastChunkZ} chunk of len #{chunkLen}"
     return
       
       

    #Offset to put pattern to the center
    cx = ((simulator.width - patW)/2) & ~1
    cy = ((simulator.height - patH)/2) & ~1
    console.log "Putting pattern at #{cx}, #{cy}"
    simulator.put pattern, cx, cy #pattern roughly at the center
    
    order = 3

    
    tube.addAttribute 'position', new THREE.BufferAttribute(vs, 3)
    tube.addAttribute 'index', new THREE.BufferAttribute(ixs, 1)
    tube.computeBoundingSphere()
    return  tube
    
