title: How to use an SVG image in Matter.js?
body: <p>What I'm trying to do:
  Use a Font Awesome SVG - <a href="https://fontawesome.com/icons/sleigh" rel="nofollow noreferrer">sleigh</a> -  in matter.js.</p>
  <p>I've tried this:</p>
  <pre class="lang-js prettyprint-override"><code>Matter.Bodies.fromVertices(500, 50 , Matter.Svg.pathToVertices(&quot;sleigh.svg&quot;))
  </code></pre>
  <pre><code>
  &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 640 512&quot;&gt;&lt;path d=&quot;M612.7 350.7l-9.3-7.4c-6.9-5.5-17-4.4-22.5 2.5l-10 12.5c-5.5 6.9-4.4 17 2.5 22.5l9.3 7.4c5.9 4.7 9.2 11.7 9.2 19.2 0 13.6-11 24.6-24.6 24.6H48c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h516c39 0 73.7-29.3 75.9-68.3 1.4-23.8-8.7-46.3-27.2-61zM32 224c0 59.6 40.9 109.2 96 123.5V400h64v-48h192v48h64v-48c53 0 96-43 96-96v-96c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96v64c0 35.3-28.7 64-64 64h-20.7c-65.8 0-125.9-37.2-155.3-96-29.4-58.8-89.6-96-155.3-96H32C14.3 32 0 46.3 0 64s14.3 32 32 32v128z&quot;/&gt;&lt;/svg&gt;
  </code></pre>
  <p>But got:</p>
  <pre><code>matter.js:4624 matter-js: Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.
  
  matter.js:7554 Uncaught TypeError: Cannot read property 'numberOfItems' of undefined
  </code></pre>
  <p>What am I doing wrong?</p>
  <p>(P. S: I'm pretty new to matter.js, so sorry if this is a silly question…)</p>