[英]Find an intersection line between 2 meshes
我正在寻找 python 中 2 个网格之间的交线(段)我试过这个:
import pyvista as pv
import vtk
def get_mesh_intersection(mesh1, mesh2):
'''
Find the intersection volume between mesh vtk objects
and return the volume of intersection
'''
alg = vtk.vtkBooleanOperationPolyDataFilter()
alg.SetInputData(0, mesh2)
alg.SetInputData(1, mesh1)
alg.SetOperationToIntersection()
alg.Update()
intersection = pv.wrap(alg.GetOutput())
return intersection
intersection = get_mesh_intersection(grid1, grid2)
我可以从intersection
提取线吗? 如何? 我看到我可以得到intersection.volume
intersection.area
intersection.points
是intersection.points
是我要找的吗?
我认为您应该使用vtkIntersectionPolyDataFilter
而不是 boolean 操作过滤器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.