0

I'd like to take multiple paths, and using pygmsh, convert them using their orientations to a mesh. I'm testing with these paths:

path1 = [[-2, 0], [-2, 2], [2, 2], [2, 0], [-2, 0]]
path2 = [[-1.5,0.5], [1.5,0.5], [1.5,1.5], [-1.5,1.5], [-1.5,0.5]]

with pygmsh.geo.Geometry() as meshgeom:
    meshgeom.add_polygon(path1, mesh_size=0.1)
    meshgeom.add_polygon(path2, mesh_size=0.1)
    mesh = meshgeom.generate_mesh()
    pygmsh.write("test.vtk")

These 2 paths form rectangles, with path1 going clockwise and path2 going counterclockwise. I would like the mesh to contain the area in between the 2 paths (a ring), but at the moment it's basically combining both into one large rectangle.

Right now, I'm using the add_polygon() function in pygmsh, but I'm not sure if this is the correct way nor can I find much information about it.

0 Answers0