示例#1
0
def applyTubeFilter(polyData, radius, numberOfSides=24):
    tube = vtk.vtkTubeFilter()
    tube.SetRadius(radius)
    tube.SetNumberOfSides(numberOfSides)
    tube.CappingOn()
    tube.SetInputData(polyData)
    tube.Update()
    return tube.GetOutput()
示例#2
0
def applyTubeFilter(polyData, radius, numberOfSides=24):
    tube = vtk.vtkTubeFilter()
    tube.SetRadius(radius)
    tube.SetNumberOfSides(numberOfSides)
    tube.CappingOn()
    tube.SetInputData(polyData)
    tube.Update()
    return tube.GetOutput()
示例#3
0
def createAxesPolyData(scale, useTube, tubeWidth=0.002):
    axes = vtk.vtkAxes()
    axes.SetComputeNormals(0)
    axes.SetScaleFactor(scale)
    axes.Update()

    if useTube:
        tube = vtk.vtkTubeFilter()
        tube.SetInputConnection(axes.GetOutputPort())
        tube.SetRadius(tubeWidth)
        tube.SetNumberOfSides(12)
        tube.Update()
        axes = tube

    return shallowCopy(axes.GetOutput())
    def _createAxes(self, scale, useTube):
        axes = vtk.vtkAxes()
        axes.SetComputeNormals(0)
        axes.SetScaleFactor(scale)
        axes.Update()

        if useTube:
            tube = vtk.vtkTubeFilter()
            tube.SetInput(axes.GetOutput())
            tube.SetRadius(0.002)
            tube.SetNumberOfSides(12)
            tube.Update()
            axes = tube

        return shallowCopy(axes.GetOutput())
示例#5
0
    def _createAxes(self, scale, useTube):
        axes = vtk.vtkAxes()
        axes.SetComputeNormals(0)
        axes.SetScaleFactor(scale)
        axes.Update()

        if useTube:
            tube = vtk.vtkTubeFilter()
            tube.SetInput(axes.GetOutput())
            tube.SetRadius(0.002)
            tube.SetNumberOfSides(12)
            tube.Update()
            axes = tube

        return shallowCopy(axes.GetOutput())
示例#6
0
def createAxesPolyData(scale, useTube, tubeWidth=0.002):
    axes = vtk.vtkAxes()
    axes.SetComputeNormals(0)
    axes.SetScaleFactor(scale)
    axes.Update()

    if useTube:
        tube = vtk.vtkTubeFilter()
        tube.SetInputConnection(axes.GetOutputPort())
        tube.SetRadius(tubeWidth)
        tube.SetNumberOfSides(12)
        tube.Update()
        axes = tube

    return shallowCopy(axes.GetOutput())
示例#7
0
文件: debugVis.py 项目: rxdu/director
    def addLine(self, p1, p2, radius=0.0, color=[1,1,1]):

        line = vtk.vtkLineSource()
        line.SetPoint1(p1)
        line.SetPoint2(p2)
        line.Update()

        if radius == 0.0:
            self.addPolyData(line.GetOutput(), color)
        else:
            tube = vtk.vtkTubeFilter()
            tube.SetRadius(radius)
            tube.SetNumberOfSides(24)
            tube.CappingOn()
            tube.SetInputConnection(line.GetOutputPort())
            tube.Update()
            self.addPolyData(tube.GetOutput(), color)
示例#8
0
    def addLine(self, p1, p2, radius=0.0, color=[1, 1, 1]):

        line = vtk.vtkLineSource()
        line.SetPoint1(p1)
        line.SetPoint2(p2)
        line.Update()

        if radius == 0.0:
            self.addPolyData(line.GetOutput(), color)
        else:
            tube = vtk.vtkTubeFilter()
            tube.SetRadius(radius)
            tube.SetNumberOfSides(24)
            tube.CappingOn()
            tube.SetInputConnection(line.GetOutputPort())
            tube.Update()
            self.addPolyData(tube.GetOutput(), color)