This page was generated from docs\source\examples/import_gmsh.ipynb.

Import from Gmsh#

[1]:
from sigmaepsilon.mesh import PolyData
from math import pi
import pygmsh


with pygmsh.geo.Geometry() as geom:
    poly = geom.add_polygon(
        [
            [0.0, 0.2, 0.0],
            [0.0, 1.2, 0.0],
            [0.0, 1.2, 1.0],
        ],
        mesh_size = 0.1,
    )
    geom.revolve(poly, [0.0, 0.0, 1.0], [0.0, 0.0, 0.0], 0.8 * pi)
    mesh = geom.generate_mesh()
    edict = mesh.cells_dict


polydata = PolyData.from_meshio(mesh)
polydata.plot(notebook=True, jupyter_backend="static", theme="document")
../_images/examples_import_gmsh_1_0.png