Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
VTK
VTK
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 582
    • Issues 582
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 159
    • Merge Requests 159
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #16815

Closed
Open
Opened Aug 15, 2016 by Max@mwormser

vtkTubeFilter is not able to produce closed loops; behaves unexpectedly if first and last point meet

I already pointed this out on stackoverflow. There somebody said I should probably submit this as a bug.

The issue: Imagine four points in space forming a square. Assign these points to a line that has 5 points, where the last point is the same as the first, thus creating a closed loop. Here is a python code snipped:

pts = vtk.vtkPoints()
pts.SetNumberOfPoints(4)
pts.SetPoint(0, 0.5, 0, 0)
pts.SetPoint(1, 1, 0.5, 0)
pts.SetPoint(2, 0.5, 1, 0)
pts.SetPoint(3, 0, 0.5, 0)

lines = vtk.vtkCellArray()
lines.InsertNextCell(5)
lines.InsertCellPoint(0)
lines.InsertCellPoint(1)
lines.InsertCellPoint(2)
lines.InsertCellPoint(3)
lines.InsertCellPoint(0)

poly = vtk.vtkPolyData()
poly.SetPoints(pts)
poly.SetLines(lines)

tubes = vtk.vtkTubeFilter()
tubes.SetInputData(poly)
tubes.CappingOn()
tubes.SidesShareVerticesOff()
tubes.SetNumberOfSides(4)
tubes.SetRadius(0.1)
tubes.Update()

Result. The tubes do not connect, CappingOn() does not change anything. The width of the tubes varies at the end points.

Even if the last and the first point meet on a straight line (by adding a 5th point that lies on one of the sides of the square) the width of the tube changes and it just doesn't look right.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: vtk/vtk#16815