Excellent, thank you Amy. I also found <a class="el" href="http://www.vtk.org/doc/nightly/html/vtkAppendPolyData_8h-source.html">vtkAppendPolyData.h</a><br>to attach them together. For anyone else interested:<br><br>void TwoCubes(const string &OutputFilename)<br>
{<br> vtkSmartPointer<vtkCubeSource> Cube1 = vtkSmartPointer<vtkCubeSource>::New();<br> Cube1->SetCenter(0.0, 0.0, 0.0);<br> Cube1->SetXLength(.5);<br> Cube1->SetYLength(.5);<br> Cube1->SetZLength(.5);<br>
<br> vtkSmartPointer<vtkCubeSource> Cube2 = vtkSmartPointer<vtkCubeSource>::New();<br> Cube2->SetCenter(5.0, 0.0, 0.0);<br> Cube2->SetXLength(.5);<br> Cube2->SetYLength(.5);<br> Cube2->SetZLength(.5);<br>
<br> vtkSmartPointer<vtkPolyData> polydata1 = Cube1->GetOutput();<br> vtkSmartPointer<vtkPolyData> polydata2 = Cube2->GetOutput();<br> <br> vtkSmartPointer<vtkAppendPolyData> CombinedData = vtkSmartPointer<vtkAppendPolyData>::New();;<br>
CombinedData->AddInput(polydata1);<br> CombinedData->AddInput(polydata2);<br> <br> //write the file<br> vtkSmartPointer<vtkXMLPolyDataWriter> writer = vtkSmartPointer<vtkXMLPolyDataWriter>::New();<br>
writer->SetInput(CombinedData->GetOutput());<br><br> writer->SetFileName(OutputFilename.c_str());<br> writer->Write();<br><br>}<br><br clear="all">Thanks,<br><br>David<br>
<br><br><div class="gmail_quote">On Fri, Mar 13, 2009 at 10:08 PM, Amy Squillacote <span dir="ltr"><<a href="mailto:amylists@gmail.com">amylists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi David,<br><br>.vtp files are for storing polygonal data sets. For your plane, you could store the output of vtkPlaneSource in a .vtp file. Similarly, for a sphere, you can store the output of a vtkSphereSource in a .vtp file.<br>
<br>- Amy<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Mar 13, 2009 at 5:35 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
Is there a way to store a sphere in a vtp file?<br><br clear="all">Thanks,<br><font color="#888888"><br>David</font><div><div></div><div><br>
<br><br><div class="gmail_quote">On Fri, Mar 6, 2009 at 8:26 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is there a way to store a plane in a vtp file? I have a point and a normal, and I want to see what that plane looks like. I could clearly get two random vectors on the plane that go through the point and make a giant triangle, but that seems very hacky.<br>
<br clear="all">Thanks,<br><font color="#888888"><br>David<br>
</font></blockquote></div><br>
</div></div><br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>
</blockquote></div><br>