title: Dominoes game - bones path algorithm
body: <p>I'm trying to done a JS domino game and I'm running some issues draw the path of the bones.</p>
  
  <p>Basically, I use a tree system for the dominoes. But it's complex for me to arrive to rend correctly on the layout the path.</p>
  
  <p>If I just render the layout like on the tree, it's simple but when I reach an edge of the board I have to rotate the bone and continue.
  When I rotate, I apply the same rotation the all of the child of this bones (and the child of the child) etc...</p>
  
  <p>The issue is when I get a spinner (node) with several branches from it. Sometime, and after several rotation, one branch cross over another branch or even the same branch.</p>
  
  <p>I tried to find a solution like an algorithm to calculate all of the positions from a tree on a physical layout and I found something about semi-hamiltonian path but I'm not sure how to use it. </p>
  
  <p>If somebody have an idea about that, it would be awesome.</p>
  
  <p>Sorry for my english.</p>
  
  <p>(Edit)
  This is a screenshot of a typically issue that I get:  </p>
  
  <p><a href="https://i.stack.imgur.com/jpmmH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jpmmH.png" alt="bones paht"></a></p>
  
  <p>The goal is to find a way to calculate every bone positions from a tree and rend them on my canvas layout. I need to take care of the edge limitation and when a line/row cross over a bone.</p>