title: Python: replicate Matlab's generateMesh function
body: <p>I am in the process of converting a codebase from Matlab to Python and noticed that <a href="https://it.mathworks.com/help/pde/ug/generate-mesh.html" rel="nofollow noreferrer"><code>generateMesh</code></a> gets called on some polygons before carrying out a finite element analysis.</p>
  <p>What I need to get as an output is a list of all the elements and nodes, with their respective coordinates. I don't need any GUI, just the output nodes and elements information.</p>
  <p>The best solution I came across is <a href="https://bthierry.pages.math.cnrs.fr/tutorial/gmsh/api_detail/" rel="nofollow noreferrer">something like this</a> done with gmsh. I know gmsh is a pretty big library and I am afraid it might be a little too much for my needs. Is there any other package you'd suggest?</p>
  <p>Triangular meshes are fine for the moment, but I would like the package to support tetrahedral meshes as well in case it's needed in the future.</p>
  <p>Thank you</p>
  <p><strong>edit</strong>: I forgot to mention that I am only dealing with 2D geometries, as the triangular and tetrahedral elements imply.</p>