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


Python vtk.vtkDiskSource方法代码示例

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


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

示例1: Disc

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkDiskSource [as 别名]
def Disc(center=(0.,0.,0.), inner=0.25, outer=0.5, normal=(0,0,1), r_res=1,
         c_res=6):
    """Create a polygonal disk with a hole in the center.

    The disk has zero height. The user can specify the inner and outer radius
    of the disk, and the radial and circumferential resolution of the polygonal
    representation.

    Parameters
    ----------
    center : np.ndarray or list
        Center in [x, y, z]. middle of the axis of the disc.

    inner : float
        The inner radius

    outer : float
        The outer radius

    normal : np.ndarray or list
        direction vector in [x, y, z]. orientation vector of the cone.

    r_res: int
        number of points in radius direction.

    r_res: int
        number of points in circumferential direction.

    """
    src = vtk.vtkDiskSource()
    src.SetInnerRadius(inner)
    src.SetOuterRadius(outer)
    src.SetRadialResolution(r_res)
    src.SetCircumferentialResolution(c_res)
    src.Update()
    return pyvista.wrap(src.GetOutput()) 
开发者ID:pyvista,项目名称:pyvista,代码行数:38,代码来源:geometric_objects.py

示例2: getActorCircle

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkDiskSource [as 别名]
def getActorCircle(radius_inner=100, radius_outer=99, color=(1,0,0)):
    """"""
    # create source
    source = vtk.vtkDiskSource()
    source.SetInnerRadius(radius_inner)
    source.SetOuterRadius(radius_outer)
    source.SetRadialResolution(100)
    source.SetCircumferentialResolution(100)

    # Transformer
    transform = vtk.vtkTransform()
    transform.RotateWXYZ(90, 1, 0, 0)
    transformFilter = vtk.vtkTransformPolyDataFilter()
    transformFilter.SetTransform(transform)
    transformFilter.SetInputConnection(source.GetOutputPort())
    transformFilter.Update()

    # mapper
    mapper = vtk.vtkPolyDataMapper()
    mapper.SetInputConnection(transformFilter.GetOutputPort())

    # actor
    actor = vtk.vtkActor()
    actor.GetProperty().SetColor(color)
    actor.SetMapper(mapper)

    return actor 
开发者ID:VisualComputingInstitute,项目名称:3d-semantic-segmentation,代码行数:29,代码来源:viz.py

示例3: applyDiskGlyphs

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkDiskSource [as 别名]
def applyDiskGlyphs(polyData, computeNormals=True):

    voxelGridLeafSize = 0.03
    normalEstimationSearchRadius = 0.05
    diskRadius = 0.015
    diskResolution = 12

    if computeNormals:
        scanInput = polyData

        pd = applyVoxelGrid(scanInput, leafSize=voxelGridLeafSize)

        pd = labelOutliers(pd, searchRadius=normalEstimationSearchRadius, neighborsInSearchRadius=3)
        pd = thresholdPoints(pd, 'is_outlier', [0, 0])

        pd = normalEstimation(pd, searchRadius=normalEstimationSearchRadius, searchCloud=scanInput)
    else:
        pd = polyData

    assert polyData.GetPointData().GetNormals()

    disk = vtk.vtkDiskSource()
    disk.SetOuterRadius(diskRadius)
    disk.SetInnerRadius(0.0)
    disk.SetRadialResolution(0)
    disk.SetCircumferentialResolution(diskResolution)
    disk.Update()

    t = vtk.vtkTransform()
    t.RotateY(90)
    disk = transformPolyData(disk.GetOutput(), t)

    glyph = vtk.vtkGlyph3D()
    glyph.ScalingOff()
    glyph.OrientOn()
    glyph.SetSourceData(disk)
    glyph.SetInputData(pd)
    glyph.SetVectorModeToUseNormal()
    glyph.Update()

    return shallowCopy(glyph.GetOutput()) 
开发者ID:RobotLocomotion,项目名称:director,代码行数:43,代码来源:segmentation.py

示例4: getActorCircle

# 需要导入模块: import vtk [as 别名]
# 或者: from vtk import vtkDiskSource [as 别名]
def getActorCircle(radius_inner=100, radius_outer=99, color=(1, 0, 0)):
    """"""
    # create source
    source = vtk.vtkDiskSource()
    source.SetInnerRadius(radius_inner)
    source.SetOuterRadius(radius_outer)
    source.SetRadialResolution(100)
    source.SetCircumferentialResolution(100)

    # Transformer
    transform = vtk.vtkTransform()
    transform.RotateWXYZ(90, 1, 0, 0)
    transformFilter = vtk.vtkTransformPolyDataFilter()
    transformFilter.SetTransform(transform)
    transformFilter.SetInputConnection(source.GetOutputPort())
    transformFilter.Update()

    # mapper
    mapper = vtk.vtkPolyDataMapper()
    mapper.SetInputConnection(transformFilter.GetOutputPort())

    # actor
    actor = vtk.vtkActor()
    actor.GetProperty().SetColor(color)
    actor.SetMapper(mapper)

    return actor 
开发者ID:lightaime,项目名称:deep_gcns_torch,代码行数:29,代码来源:pc_viz.py


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