<div dir="ltr">maybe you should set "capping off"<br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div class="wps_signature">发自我的小米手机</div><div class="wps_quotion">在 Maximilian Wormser <max.wormser@gmx.de>,2016年7月19日 下午3:51写道:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p></p><html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang="DE" link="#0563C1" vlink="#954F72"><div class="WordSection1"><p class="MsoNormal"><span lang="EN-US">Hey all,</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">I want to create closed loops with vtkTubeFilter, but at the point where the first and the last point meet there is always a misconnection. vtkStripper and vtkCleanPolyData do not help in this case. I already posted my problem to stackoverflow, but without any solutions so far. Here is a link to my submission: <a href="http://stackoverflow.com/questions/38266711/creating-a-closed-loop-with-vtktubefilter">http://stackoverflow.com/questions/38266711/creating-a-closed-loop-with-vtktubefilter</a></span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">Here’s a minimal working example to reproduce the behavior:</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">import vtk</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">def rendering(mapper):</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> """Takes mapper and handles the rendering."""</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> actor = vtk.vtkActor()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> actor.SetMapper(mapper)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> # Create a renderer, render window, and interactor</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span><span style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">renderer = vtk.vtkRenderer()</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> renderWindow = vtk.vtkRenderWindow()</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">renderWindow.AddRenderer(renderer)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> renderWindowInteractor = vtk.vtkRenderWindowInteractor()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> renderWindowInteractor.SetRenderWindow(renderWindow)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> # Add the actors to the scene</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> renderer.AddActor(actor)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> # Render and interact</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> renderWindow.Render()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> renderWindowInteractor.Start()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> return</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">pts = vtk.vtkPoints()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">pts.SetNumberOfPoints(4)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">pts.SetPoint(0, 0.5, 0, 0)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">pts.SetPoint(1, 1, 0.5, 0)</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">pts.SetPoint(2, 0.5, 1, 0)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">pts.SetPoint(3, 0, 0.5, 0)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">lines = vtk.vtkCellArray()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">lines.InsertNextCell(5)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">lines.InsertCellPoint(0)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">lines.InsertCellPoint(1)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">lines.InsertCellPoint(2)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">lines.InsertCellPoint(3)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">lines.InsertCellPoint(0)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">poly = vtk.vtkPolyData()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">poly.SetPoints(pts)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">poly.SetLines(lines)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">tubes = vtk.vtkTubeFilter()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">tubes.SetInputData(poly)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">tubes.CappingOn()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">tubes.SidesShareVerticesOff()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">tubes.SetNumberOfSides(4)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">tubes.SetRadius(0.1)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">tubes.Update()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">mapper = vtk.vtkPolyDataMapper()</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">mapper.SetInputData(tubes.GetOutput())</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">rendering(mapper)</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:DE">Thanks in advance for any help!</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p></div></body></html>
</blockquote></div>