<div dir="ltr">That's a good point.  If the first segment and the last segment of the loop are in exactly the same direction, then the "ends" of the generated tube should coincide with each other exactly.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 19, 2016 at 7:46 AM, Andras Lasso <span dir="ltr"><<a href="mailto:lasso@queensu.ca" target="_blank">lasso@queensu.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">If start and end points of the tube are the same then
<a href="http://www.vtk.org/doc/nightly/html/classvtkCleanPolyData.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkCleanPolyData.html</a> will merge them.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Andras<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> vtkusers [mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>]
<b>On Behalf Of </b>Maximilian Wormser<br>
<b>Sent:</b> July 19, 2016 9:09<br>
<b>To:</b> 'David Gobbi' <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>><br>
<b>Cc:</b> 'VTK Users' <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<b>Subject:</b> Re: [vtkusers] vtkTubeFilter doesn't create a closed loop<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Oh what a shame :( do you know where the best place is to submit this as a feature request?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> David Gobbi [<a href="mailto:david.gobbi@gmail.com" target="_blank">mailto:david.gobbi@gmail.com</a>]
<br>
<b>Gesendet:</b> Dienstag, 19. Juli 2016 14:58<br>
<b>An:</b> Maximilian Wormser <<a href="mailto:max.wormser@gmx.de" target="_blank">max.wormser@gmx.de</a>><br>
<b>Cc:</b> VTK Users <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<b>Betreff:</b> Re: [vtkusers] vtkTubeFilter doesn't create a closed loop<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE">Hi Maximilian,<u></u><u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE">I did a quick read-through of the code for vtkTubeFilter, and it doesn't check to see if the first and last points are the same point.  So unless someone provides a fix, you might be out of luck.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE"> - David<u></u><u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="DE">On Tue, Jul 19, 2016 at 4:38 AM, Maximilian Wormser <<a href="mailto:max.wormser@gmx.de" target="_blank">max.wormser@gmx.de</a>> wrote:<u></u><u></u></span></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="margin-left:35.4pt">
<span style="font-size:11.0pt;color:#1f497d">Good idea, but SetCappingOff or SetCappingOn do not change the underlying problem.</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt">
<span style="font-size:11.0pt;color:#1f497d"> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<b><span lang="DE" style="font-size:11.0pt">Von:</span></b><span lang="DE" style="font-size:11.0pt"> lihouxing [mailto:<a href="mailto:lihouxing@yeah.net" target="_blank">lihouxing@yeah.net</a>]
<br>
<b>Gesendet:</b> Dienstag, 19. Juli 2016 11:02<br>
<b>An:</b> <a href="mailto:max.wormser@gmx.de" target="_blank">max.wormser@gmx.de</a>;
<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Betreff:</b> Re:[vtkusers] vtkTubeFilter doesn't create a closed loop</span><span lang="DE"><u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:70.8pt">
<span lang="DE"> <u></u><u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:70.8pt">
<span lang="DE">maybe you should set "capping off"<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:70.8pt">
<span lang="DE"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:70.8pt">
<span lang="DE"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:70.8pt">
<span lang="DE"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Microsoft JhengHei",sans-serif">发自我的小米手机</span><span lang="DE"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"MS Gothic"">在</span><span lang="DE"> Maximilian Wormser <<a href="mailto:max.wormser@gmx.de" target="_blank">max.wormser@gmx.de</a>></span><span style="font-family:"MS Gothic"">,</span><span lang="DE">2016</span><span style="font-family:"MS Gothic"">年</span><span lang="DE">7</span><span style="font-family:"MS Gothic"">月</span><span lang="DE">19</span><span style="font-family:"MS Gothic"">日</span>
<span style="font-family:"MS Gothic"">下午</span><span lang="DE">3:51</span><span style="font-family:"MS Gothic"">写道:</span><span lang="DE"><u></u><u></u></span></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-size:11.0pt">Hey all,</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-size:11.0pt"> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-size:11.0pt">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" target="_blank">
http://stackoverflow.com/questions/38266711/creating-a-closed-loop-with-vtktubefilter</a></span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-size:11.0pt"> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-size:11.0pt">Here’s a minimal working example to reproduce the behavior:</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-size:11.0pt"> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">import vtk</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">def rendering(mapper):</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    """Takes mapper and handles the rendering."""</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    actor = vtk.vtkActor()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    actor.SetMapper(mapper)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    # Create a renderer, render window, and interactor</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    </span><span lang="DE" style="font-family:"Courier New"">renderer = vtk.vtkRenderer()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span lang="DE" style="font-family:"Courier New"">    renderWindow = vtk.vtkRenderWindow()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span lang="DE" style="font-family:"Courier New"">    </span><span style="font-family:"Courier New"">renderWindow.AddRenderer(renderer)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    renderWindowInteractor = vtk.vtkRenderWindowInteractor()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    renderWindowInteractor.SetRenderWindow(renderWindow)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    # Add the actors to the scene</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    renderer.AddActor(actor)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    # Render and interact</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    renderWindow.Render()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    renderWindowInteractor.Start()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">    return</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">pts = vtk.vtkPoints()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">pts.SetNumberOfPoints(4)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">pts.SetPoint(0, 0.5, 0, 0)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">pts.SetPoint(1, 1, 0.5, 0)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span lang="DE" style="font-family:"Courier New"">pts.SetPoint(2, 0.5, 1, 0)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">pts.SetPoint(3, 0, 0.5, 0)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">lines = vtk.vtkCellArray()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">lines.InsertNextCell(5)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">lines.InsertCellPoint(0)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">lines.InsertCellPoint(1)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">lines.InsertCellPoint(2)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">lines.InsertCellPoint(3)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">lines.InsertCellPoint(0)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">poly = vtk.vtkPolyData()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">poly.SetPoints(pts)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">poly.SetLines(lines)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">tubes = vtk.vtkTubeFilter()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">tubes.SetInputData(poly)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">tubes.CappingOn()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">tubes.SidesShareVerticesOff()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">tubes.SetNumberOfSides(4)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">tubes.SetRadius(0.1)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">tubes.Update()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">mapper = vtk.vtkPolyDataMapper()</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">mapper.SetInputData(tubes.GetOutput())</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">rendering(mapper)</span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New""> </span><span lang="DE"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:70.8pt">
<span style="font-family:"Courier New"">Thanks in advance for any help!</span><span lang="DE"><u></u><u></u></span></p>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>