VTK Learning Thirty-five- clipping with surface

使用曲面进行切割

import pyvista as pv
import numpy as np

mesh = pv.ParametricRandomHills()
mesh.rotate_y(90)
surface= mesh.elevation()

# Create a grid around that surface
# 根据生成的mesh生成网格
grid = pv.create_grid(surface)

# Clip the grid using the surface
model = grid.clip_surface(surface)

# Compute height and display it
model.elevation().plot()

surface:surface.plot()
VTK Learning Thirty-five- clipping with surface_第1张图片
grid:grid.plot()
VTK Learning Thirty-five- clipping with surface_第2张图片
clip result:model.elevation().plot()
VTK Learning Thirty-five- clipping with surface_第3张图片

你可能感兴趣的:(VTK)