[vtkusers] vtkTriangleStrip and empty vtkSTLWriter output

piers.barber at logicmonkey.co.uk piers.barber at logicmonkey.co.uk
Wed Oct 14 18:06:15 EDT 2015


 

 On 2015-10-14 18:10, Cory Quammen wrote: 

> Maybe try inserting a
vtkTriangleFilter in front of your STL writer?

Perfect - many many
thanks! 

It worked on the triangle mesh AND on the ruled surface. Both
STL files read into other apps just fine. The ruled surface output is
appreciably higher quality even than a very high poly count mesh. 

For
the record... 

// write out a STL file 
// run a triangle filter ruled
surface to create polys 
vtkSmartPointer<vtkTriangleFilter> 
tris =
vtkTriangleFilter::New();

tris->SetInputConnection(ruled->GetOutputPort());

vtkSmartPointer<vtkSTLWriter> 
stlWriter =
vtkSmartPointer<vtkSTLWriter>::New();

stlWriter->SetFileName("Ruled.stl");

stlWriter->SetInputConnection(tris->GetOutputPort());

stlWriter->Write(); 

And 

// write out a STL file
 // run a triangle
filter on the mesh to create polys
 vtkSmartPointer<vtkTriangleFilter>

tris = vtkTriangleFilter::New();

tris->SetInputConnection(ruled->GetOutputPort());


vtkSmartPointer<vtkSTLWriter> 

stlWriter =
vtkSmartPointer<vtkSTLWriter>::New();


stlWriter->SetFileName("Mesh.stl");

stlWriter->SetInputConnection(tris->GetOutputPort());

stlWriter->Write(); 

-- 

Piers Barber (-=:LogicMonkey:=-) 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151014/710e146b/attachment.html>


More information about the vtkusers mailing list