当前位置: 首页>>代码示例>>Python>>正文


Python vtk.vtkTriangleFilter方法代码示例

本文整理汇总了Python中vtk.vtkTriangleFilter方法的典型用法代码示例。如果您正苦于以下问题:Python vtk.vtkTriangleFilter方法的具体用法?Python vtk.vtkTriangleFilter怎么用?Python vtk.vtkTriangleFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vtk的用法示例。


在下文中一共展示了vtk.vtkTriangleFilter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: volume_vtk

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkTriangleFilter [as 别名]
def volume_vtk(self):
        if self.VTK_installed is False:
            raise VTK_Exception('VTK must be installed to access the volume_vtk property')

        if self._volume_vtk is None:
            tri_converter = vtk.vtkTriangleFilter()
            tri_converter.SetInputDataObject(self.vtp_mesh)
            tri_converter.Update()
            tri_mesh = tri_converter.GetOutput()
            mass_props = vtk.vtkMassProperties()
            mass_props.SetInputDataObject(tri_mesh)
            self._volume_vtk = mass_props.GetVolume()

            print 'Calculated mesh volume using VTK library'

        return self._volume_vtk 
开发者ID:NREL,项目名称:OpenWARP,代码行数:18,代码来源:mesh.py

示例2: triangulate

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkTriangleFilter [as 别名]
def triangulate(poly_data, inplace=False):
        """Return an all triangle mesh.

        More complex polygons will be broken down into tetrahedrals.

        Parameters
        ----------
        inplace : bool, optional
            Updates mesh in-place while returning nothing.

        Return
        ------
        mesh : pyvista.PolyData
            Mesh containing only triangles.  None when inplace=True

        """
        trifilter = vtk.vtkTriangleFilter()
        trifilter.SetInputData(poly_data)
        trifilter.PassVertsOff()
        trifilter.PassLinesOff()
        trifilter.Update()

        mesh = _get_output(trifilter)
        if inplace:
            poly_data.overwrite(mesh)
        else:
            return mesh 
开发者ID:pyvista,项目名称:pyvista,代码行数:29,代码来源:filters.py

示例3: update

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkTriangleFilter [as 别名]
def update(self):
        delaunay = vtkDelaunay3D()
        delaunay.SetInput(self.input_)
        delaunay.SetTolerance(self.tolerance)
        delaunay.SetAlpha(self.alpha)
        delaunay.Update()

        geom = vtkGeometryFilter()
        geom.SetInputConnection(delaunay.GetOutputPort() )

        triangle = vtkTriangleFilter()
        triangle.SetInputConnection(geom.GetOutputPort())
        triangle.Update()
        self.output_ = triangle.GetOutput() 
开发者ID:mmolero,项目名称:pcloudpy,代码行数:16,代码来源:Delaunay3D.py

示例4: Text3D

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkTriangleFilter [as 别名]
def Text3D(string, depth=0.5):
    """Create 3D text from a string."""
    vec_text = vtk.vtkVectorText()
    vec_text.SetText(string)

    extrude = vtk.vtkLinearExtrusionFilter()
    extrude.SetInputConnection(vec_text.GetOutputPort())
    extrude.SetExtrusionTypeToNormalExtrusion()
    extrude.SetVector(0, 0, 1)
    extrude.SetScaleFactor(depth)

    tri_filter = vtk.vtkTriangleFilter()
    tri_filter.SetInputConnection(extrude.GetOutputPort())
    tri_filter.Update()
    return pyvista.wrap(tri_filter.GetOutput()) 
开发者ID:pyvista,项目名称:pyvista,代码行数:17,代码来源:geometric_objects.py

示例5: surface_area_vtk

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkTriangleFilter [as 别名]
def surface_area_vtk(self):
        if self.VTK_installed is False:
            raise VTK_Exception('VTK must be installed to access the surface_area_vtk property')
        if self._surface_area_vtk is None:
            tri_converter = vtk.vtkTriangleFilter()
            tri_converter.SetInputDataObject(self.vtp_mesh)
            tri_converter.Update()
            tri_mesh = tri_converter.GetOutput()
            mass_props = vtk.vtkMassProperties()
            mass_props.SetInputDataObject(tri_mesh)
            self._surface_area_vtk = mass_props.GetSurfaceArea()

            print 'Calculated mesh surface area using VTK Python bindings'

        return self._surface_area_vtk 
开发者ID:NREL,项目名称:OpenWARP,代码行数:17,代码来源:mesh.py


注:本文中的vtk.vtkTriangleFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。