<div dir="ltr">Hi <span style="font-size:12.8px">Yoshimi,</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">That was it! Switching to </span><span style="font-size:12.8px">vtkAppendPolyData and now both are in STL!</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thanks for your help,</span></div><div><br></div><div><span style="font-size:12.8px">Sean</span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 29, 2016 at 5:33 PM, kenichiro yoshimi <span dir="ltr"><<a href="mailto:rccm.kyoshimi@gmail.com" target="_blank">rccm.kyoshimi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Sean,<br>
<br>
You need to convert an unstructured grid to a polydata which is<br>
required by vtkSTLWriter.<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/GeometryFilter" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/PolyData/<wbr>GeometryFilter</a><br>
Or you can use the vtkAppendPolyData instead of the vtkAppendData.<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/CombinePolyData" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/Filtering/<wbr>CombinePolyData</a><br>
<br>
Thanks,<br>
Yoshimi<br>
<div><div class="h5"><br>
2016-12-30 6:59 GMT+09:00 sean Harre <<a href="mailto:seanharre@gmail.com">seanharre@gmail.com</a>>:<br>
> Hi,<br>
><br>
> I have a simple example to show a problem I need help resolving. I'm very<br>
> new to VTK and have copied the TubesFromSplines example C++ code to almost<br>
> what I need, but one issue remains to be solved.<br>
><br>
> The intent is to have a program where I can add multiple splines/tubes and<br>
> then output the combined form to an STL file.<br>
><br>
> The example program I have attached generates the correct model in the<br>
> render window, and I get one spline in the output STL.<br>
><br>
> But I would like all programmed splines to be merged and output to the STL<br>
> file. I need to merge them before calling the STLWriter. This is where I am<br>
> unclear.<br>
><br>
> The example code shows a working example, and what I thought would work but<br>
> is failing and marked 'BROKEN',<br>
><br>
> {code}<br>
> //----------------------------<wbr>-----------<br>
> // stlWriter->SetInputConnection(<wbr>appendFilter->GetOutputPort())<wbr>; //<br>
> BROKEN<br>
> //<br>
> // ERROR: In<br>
> /Users/ali/code/VTK-7.1.0/<wbr>Common/ExecutionModel/<wbr>vtkDemandDrivenPipeline.cxx,<br>
> line 810<br>
> // vtkCompositeDataPipeline (0x7f987670c630): Input for connection index<br>
> 0 on input port index 0 for<br>
> // algorithm vtkSTLWriter(0x7f9876709f40) is of type<br>
> vtkUnstructuredGrid, but a vtkPolyData is required.<br>
><br>
> stlWriter->SetInputConnection(<wbr>triangleFilter->GetOutputPort(<wbr>)); // WORKS<br>
> //----------------------------<wbr>-----------<br>
> {/code}<br>
><br>
><br>
> I suspect there is something easy I'm missing, and would appreciate any<br>
> help.<br>
><br>
> I've also attached some screenshots showing how the render window and STL<br>
> output look.<br>
><br>
> And yes the code is ugly and repeats itself, but I'm just trying to<br>
> understand the basic concept first then can add a function for adding each<br>
> spline, etc...<br>
><br>
> Thanks!<br>
><br>
> Sean<br>
><br>
><br>
><br>
> --<br>
> Sean Harre<br>
> <a href="mailto:seanharre@gmail.com">seanharre@gmail.com</a><br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div>Sean Harre</div><div><a href="mailto:seanharre@gmail.com" target="_blank">seanharre@gmail.com</a></div><div><br></div></div>
</div>