<p dir="ltr">I think the writer should handle triangle strips. I'll take a stab at adding that functionality.</p>
<div class="gmail_quote">On Oct 15, 2015 9:13 AM, "Ben Boeckel" <<a href="mailto:ben.boeckel@kitware.com">ben.boeckel@kitware.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Oct 14, 2015 at 22:34:25 -0400, David Cole via vtkusers wrote:<br>
> Shouldn't the STL writer detect that its input contains non-triangles, and<br>
> **automatically** insert a triangle filter to produce correct output? Or,<br>
> at the very least, spit out an error message saying "here, insert this code<br>
> before calling Update/Write, and it will work like you want it to" ... ?<br>
<br>
Well, it used to drop vertices past the third on the floor (silently),<br>
but now it should be erroring out about non-triangles at least:<br>
<br>
    commit 9a00db82900bd15442cc471143c4e5dd1ac09a2d<br>
    Author: Ben Boeckel <<a href="mailto:ben.boeckel@kitware.com">ben.boeckel@kitware.com</a>><br>
    Date:   Tue Feb 25 17:16:58 2014 -0500<br>
<br>
        STLWriter: Raise an error for non-triangles<br>
<br>
        The STL format only supports triangles and previously, it just<br>
        truncated polygons silently. Cause an error to occur when this<br>
        happens so that users know.<br>
<br>
        Change-Id: I9c2f96d887074943130a8442d6796cb0c2ce1bbf<br>
<br>
The commit is in VTK 6.2.0.<br>
<br>
> (Similarly for rendering crappy polydata using the polydata mapper: it<br>
> requires up-to-date normals to render with proper lighting and shading, and<br>
> seems like the perfect candidate for **automatically** inserting a polydata<br>
> normals filter. This might be harder to detect that the normals are not up<br>
> to date, but sure would have saved my team some time recently...)<br>
<br>
It should error out like the STL writer for bad input at the least.<br>
<br>
> Would these types of improvements be welcome additions to VTK, or am I<br>
> missing some case where you would NOT want this type of behavior?<br>
<br>
As long as it lets you know that your data is bad and that (and how) it<br>
is being fixed is warned about, I don't see any reason why such an<br>
auto-fixer filter couldn't exist (whether it is named vtkSTLWriter or<br>
something else is a different question I don't have enough feel too<br>
strongly about).<br>
<br>
--Ben<br>
_______________________________________________<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 <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_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=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/mailman/listinfo/vtkusers</a><br>
</blockquote></div>