Polygon with hole geometry example

Polygon with hole geometry example#

Polygon with hole geometry example.

from __future__ import annotations

import skgmsh as sg

shell = [(0, 0, 0), (0, 10, 0), (10, 10, 0), (10, 0, 0), (0, 0, 0)]
holes = [[(2, 2, 0), (2, 4, 0), (4, 4, 0), (4, 2, 0), (2, 2, 0)]]
alg = sg.Delaunay2D(shell=shell, holes=holes)

Generate the mesh.

alg.mesh.plot(show_edges=True, cpos="xy", color="white", line_width=2)
polygon with hole

Change the cell size of the mesh.

alg.cell_size = 2.0
alg.mesh.plot(show_edges=True, cpos="xy", color="white", line_width=2)
polygon with hole

Enable recombine.

alg.enable_recombine()
alg.mesh.plot(show_edges=True, cpos="xy", color="white", line_width=2)
polygon with hole

Total running time of the script: (0 minutes 0.872 seconds)

Gallery generated by Sphinx-Gallery