Cylinder geometry example

Cylinder geometry example#

Cylinder geometry example.

from __future__ import annotations

import pyvista as pv

import skgmsh as sg

edge_source = pv.Cylinder(resolution=16)
edge_source.merge(pv.PolyData(edge_source.points), merge_points=True, inplace=True)
edge_source.plot(show_edges=True, color="white", line_width=2)
cylinder

Generate the mesh.

alg = sg.Delaunay3D(edge_source)
mesh = alg.mesh
mesh.plot(show_edges=True)
cylinder

Output the information of the mesh.

print(mesh)
UnstructuredGrid (0x7e580a181120)
  N Cells:    68
  N Points:   36
  X Bounds:   -5.000e-01, 5.000e-01
  Y Bounds:   -5.000e-01, 5.000e-01
  Z Bounds:   -5.000e-01, 5.000e-01
  N Arrays:   0

Change the cell size of the mesh.

alg.cell_size = 0.2
alg.mesh.plot(show_edges=True, color="white", line_width=2)
cylinder

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

Gallery generated by Sphinx-Gallery