<html><body><div><br data-mce-bogus="1"></div><div>Here's some code that shows the issue I'm trying to resolve...</div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I have some sampled 3D points <span style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;" data-mce-style="color: #000000; font-family: SFNSText, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 22.5px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;">that are essentially a tube.</span> (I cut out a lot of data, show the example doesn't look like a tube, but this shows the issue) </div><div><br data-mce-bogus="1"></div><div>I can build the surface of the tube but, the two ends of the tube want to join together. In the program below, you can see the wide strips that go straight back from one end to the other.</div><div><br data-mce-bogus="1"></div><div>How do I disconnect the strips at the ends from each other?</div><div><br data-mce-bogus="1"></div><div>Thanks,</div><div><br data-mce-bogus="1"></div><div>Rick</div><div><br data-mce-bogus="1"></div><div>Code:</div><div><br data-mce-bogus="1"></div><div>#include <Windows.h><br>#include <vector><br>#include "vtkPointData.h"<br>#include "vtkProperty.h"<br>#include "vtkPolyLine.h"<br>#include "vtkSmartPointer.h"<br>#include "vtkTriangleStrip.h"<br>#include "vtkPolyData.h"<br>#include "vtkDataSetMapper.h"<br>#include "vtkCellArray.h"<br>#include "vtkActor.h"<br>#include "vtkRenderer.h"<br>#include "vtkRenderWindow.h"<br>#include "vtkRenderWindowInteractor.h"<br>#include "vtkInteractorStyleTrackballCamera.h"<br><br><br>double points[][3] = { {55.582, -190.774, 844.647},<br>{ 55.2271,-193.744,835.244 },<br>{ 52.7171,-199.737,819.319 },<br>{ 47.7865,-207.213,803.631 },<br>{ 39.795,-213.97,790.551 },<br>{ 30.0697,-218.514,778.441 },<br>{ 21.8655,-219.257,769.834 },<br>{ 12.5418,-219.67,757.889 },<br>{ 6.50188,-218.147,748.296 },<br>{ 2.99031,-218.521,736.832 },<br>{ 2.33774,-221.3,723.745 },<br>{ 1.34548,-224.755,709.287 },<br>{ -1.03045,-231.667,692.916 },<br>{ -5.04376,-237.586,678.402 },<br>{ -9.08177,-242.151,668.611 },<br>{ -11.5051,-247.929,656.06 },<br>{ -13.9007,-251.23,643.571 },<br>{ -15.0945,-252.57,634.539 },<br>{ -11.9482,-253.68,624.517 },<br>{ -7.25365,-253.349,612.844 },<br>{ -1.01116,-256.384,604.258 },<br>{ 6.21204,-254.857,588.511 },<br>{ 59.9477,-197.404,846.897 },<br>{ 59.9313,-199.564,839.104 },<br>{ 57.6438,-204.789,822.469 },<br>{ 52.0044,-212.025,805.899 },<br>{ 43.6559,-218.774,790.717 },<br>{ 32.9718,-224.02,776.905 },<br>{ 23.1723,-225.666,767.488 },<br>{ 14.773,-226.315,756.226 },<br>{ 9.02408,-225.264,745.333 },<br>{ 7.50066,-225.347,736.11 },<br>{ 6.98553,-227.96,725.841 },<br>{ 6.41854,-230.82,712.1 },<br>{ 4.55219,-236.488,696.478 },<br>{ -0.0278958,-242.796,679.726 },<br>{ -4.68599,-247.164,669.687 },<br>{ -7.1335,-252.351,658.019 },<br>{ -9.93603,-256.519,644.824 },<br>{ -10.8628,-258.134,635.523 },<br>{ -9.02904,-260.297,627.886 },<br>{ -5.39866,-261.661,617.874 },<br>{ 1.09968,-263.716,609.148 },<br>{ 9.97905,-262.779,591.124 },<br>{ 59.9345,-205.175,849.43 },<br>{ 59.8925,-206.997,843.841 },<br>{ 59.2423,-211.942,828.25 },<br>{ 54.2427,-218.078,810.932 },<br>{ 46.1204,-224.687,793.598 },<br>{ 34.072,-229.764,778.557 },<br>{ 23.1483,-231.134,767.532 },<br>{ 15.0776,-232.306,757.456 },<br>{ 9.19118,-232.253,744.755 },<br>{ 8.52304,-233.668,737.046 },<br>{ 6.99084,-235.889,728.858 },<br>{ 6.90973,-238.782,716.418 },<br>{ 5.37757,-243.673,703.468 },<br>{ 7.21037,-251.466,682.958 },<br>{ -3.4923,-253.845,673.482 },<br>{ -5.82057,-258.661,662.418 },<br>{ -9.181,-263.004,647.922 },<br>{ -10.9386,-265.091,637.243 },<br>{ -9.5132,-267.003,629.82 },<br>{ -6.4218,-268.871,620.346 },<br>{ 0.024518,-270.644,610.015 },<br>{ 10.0565,-271.125,592.232 },<br>{ 55.1264,-211.233,851.308 },<br>{ 55.1035,-212.784,847.383 },<br>{ 54.4377,-217.608,834.291 },<br>{ 51.8816,-224.065,819.034 },<br>{ 44.9272,-231.02,801.288 },<br>{ 33.487,-236.35,783.635 },<br>{ 21.6961,-237.217,770.259 },<br>{ 13.7675,-238.825,761.378 },<br>{ 5.61639,-238.367,747.816 },<br>{ 3.34256,-240.212,740.076 },<br>{ 2.66214,-242.742,731.875 },<br>{ 1.99014,-245.187,720.447 },<br>{ 1.05857,-249.728,710.252 },<br>{ -2.11927,-255.48,692.17 },<br>{ -7.14656,-259.549,678.762 },<br>{ -9.45814,-264.12,667.803 },<br>{ -12.7369,-268.44,652.29 },<br>{ -14.6491,-271.149,638.979 },<br>{ -13.126,-272.96,630.127 },<br>{ -10.7058,-274.801,619.895 },<br>{ -3.20754,-277.047,608.081 },<br>{ 5.14991,-278.048,591.133 },<br>{ 47.7996,-213.863,852.017 },<br>{ 47.847,-214.562,848.301 },<br>{ 47.1094,-219.045,837.31 },<br>{ 44.9596,-225.066,824.916 },<br>{ 39.0062,-233.221,810.519 },<br>{ 28.4987,-238.904,793.583 },<br>{ 16.9902,-242.235,778.82 },<br>{ 8.65652,-242.315,770.631 },<br>{ -0.706025,-241.288,753.856 },<br>{ -4.36561,-242.724,743.54 },<br>{ -5.30576,-244.801,733.411 },<br>{ -5.83709,-248.177,722.879 },<br><br>{ -3.74893,-287.198,689.906 },<br>{ -1.38069,-292.909,684.796 },<br>{ 0.480259,-296.168,679.003 },<br>{ -15.6413,-263.062,693.585 },<br>{ -14.6015,-267.124,693.203 },<br>{ -13.0928,-271.291,691.977 },<br> };<br><br><br>int main(int c, char **argv)<br>{<br><br> vtkSmartPointer<vtkPoints> trianglePoints = vtkSmartPointer<vtkPoints>::New();<br> vtkSmartPointer<vtkTriangleStrip> triangleStrips = vtkSmartPointer<vtkTriangleStrip>::New();<br> vtkSmartPointer<vtkCellArray> triangleCells = vtkSmartPointer<vtkCellArray>::New();<br> vtkSmartPointer<vtkPolyData> trianglePolyData = vtkSmartPointer<vtkPolyData>::New();<br> vtkSmartPointer<vtkDataSetMapper> triangleMapper = vtkSmartPointer<vtkDataSetMapper>::New();<br> vtkSmartPointer<vtkActor> triangleActors = vtkSmartPointer<vtkActor>::New();<br> vtkSmartPointer<vtkCellArray> triangleVertices = vtkSmartPointer<vtkCellArray>::New();<br><br><br><br> size_t count = sizeof(points) / (3 * sizeof(double));<br><br> for (auto i = 0; i < count; i++)<br> {<br> vtkIdType id = trianglePoints->InsertNextPoint(points[i]);<br> triangleVertices->InsertNextCell(VTK_VERTEX);<br> triangleVertices->InsertCellPoint(id);<br> }<br><br><br> triangleStrips->GetPointIds()->SetNumberOfIds(count);<br> trianglePolyData->SetVerts(triangleVertices);<br> trianglePolyData->SetPoints(trianglePoints);<br> for (auto ns = 0; ns < count; ns++)<br> {<br> triangleStrips->GetPointIds()->SetId(ns, ns);<br> }<br> triangleCells->InsertNextCell(triangleStrips);<br><br> trianglePolyData->SetStrips(triangleCells);<br><br><br><br> <br><br><br> triangleMapper->SetInputData(trianglePolyData);<br> triangleActors->SetMapper(triangleMapper);<br><br> triangleActors->GetProperty()->SetRepresentationToSurface();<br> triangleActors->GetProperty()->SetColor(1, 1, 0);<br> triangleActors->GetProperty()->SetSpecular(0.9);<br> triangleActors->GetProperty()->SetSpecularPower(1);<br> triangleActors->GetProperty()->SetAmbient(0.4);<br> <br> vtkSmartPointer<vtkRenderer> renderer =<br> vtkSmartPointer<vtkRenderer>::New();<br> <br> renderer->AddActor(triangleActors);<br><br> vtkSmartPointer<vtkRenderWindow> renderWindow =<br> vtkSmartPointer<vtkRenderWindow>::New();<br> renderWindow->AddRenderer(renderer);<br><br> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =<br> vtkSmartPointer<vtkRenderWindowInteractor>::New();<br> renderWindowInteractor->SetRenderWindow(renderWindow);<br><br> vtkSmartPointer<vtkInteractorStyleTrackballCamera> style =<br> vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New();<br> renderWindowInteractor->SetInteractorStyle(style);<br><br> renderWindowInteractor->Initialize();<br> renderWindowInteractor->Start();<br><br><br> return 0;<br>}</div></body></html>