title: Convert line to "rectangle snake". Canvas. JavaScript
body: <p>May be someone know good <strong>JavaScript</strong> library or framework for canvas drawing.</p>
  
  <p>I have following issue:</p>
  
  <p><em>1)</em> draw some line via free-hand (like Paint/Photoshop pencil)</p>
  
  <p><em>2)</em> need convert line into "rectangle snake" (build a line using rectangles with fixed width)</p>
  
  <p>look at screenshot
  <a href="https://i.stack.imgur.com/bATJH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bATJH.png" alt="enter image description here"></a></p>
  
  <p>What kind of library will be better to use for this issue? 
  May be some kind of library alredy has this functionality?</p>
  
  <p>I mean need following functionality:</p>
  
  <ul>
  <li><p>line approximation</p></li>
  <li><p>spline separation</p></li>
  <li><p>converting line to polygons/shapes/objects</p></li>
  </ul>
  
  <p>Will be great if someone will help me. Thanks!</p>