MantisBT - VTK
View Issue Details
0010854VTK(No Category)public2010-06-19 16:442015-10-21 11:54
David Doria 
Bill Lorensen 
normalminorhave not tried
closedfixed 
 
 
TBD
incorrect functionality
0010854: vtkSTLWriter should warn when input is not all written
vtkSTLWriter only writes the first 3 points of each polygon. If the input is a triangle strip, for example, only the first 3 points of the strip are written. I'd suggest that it throw an error (or at least a warning) indicating that the input is not what it is expecting. Maybe this could be done by checking the number of points that were written to the file against the number of input points?
No tags attached.
cxx Test.cxx (1,531) 2011-02-10 14:35
https://www.vtk.org/Bug/file/8690/Test.cxx
cxx vtkSTLWriter.cxx (7,954) 2011-02-22 01:33
https://www.vtk.org/Bug/file/8713/vtkSTLWriter.cxx
? vtkSTLWriter.h (1,850) 2011-02-22 01:34
https://www.vtk.org/Bug/file/8714/vtkSTLWriter.h
cxx vtkSTLWriter_ver_2.cxx (7,560) 2011-02-22 11:37
https://www.vtk.org/Bug/file/8716/vtkSTLWriter_ver_2.cxx
Issue History
2010-06-19 16:44David DoriaNew Issue
2011-02-10 14:30Glenn FakenNote Added: 0025384
2011-02-10 14:35David DoriaFile Added: Test.cxx
2011-02-10 14:35David DoriaNote Added: 0025385
2011-02-10 14:40Glenn FakenNote Added: 0025386
2011-02-21 23:14Glenn FakenNote Added: 0025529
2011-02-21 23:15Glenn FakenNote Edited: 0025529bug_revision_view_page.php?bugnote_id=25529#r211
2011-02-22 01:29Glenn FakenNote Edited: 0025529bug_revision_view_page.php?bugnote_id=25529#r212
2011-02-22 01:33Glenn FakenFile Added: vtkSTLWriter.cxx
2011-02-22 01:34Glenn FakenFile Added: vtkSTLWriter.h
2011-02-22 07:54David DoriaNote Added: 0025530
2011-02-22 11:35Glenn FakenNote Added: 0025531
2011-02-22 11:36Glenn FakenNote Edited: 0025531bug_revision_view_page.php?bugnote_id=25531#r214
2011-02-22 11:37Glenn FakenFile Added: vtkSTLWriter_ver_2.cxx
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-06-05 16:34Jean-Christophe Fillion-RobinNote Added: 0030924
2013-07-22 18:55Dave DeMarleNote Added: 0031201
2013-07-22 18:55Dave DeMarleStatusbacklog => expired
2013-07-22 18:55Dave DeMarleAssigned To => Dave DeMarle
2015-10-19 10:50Bill LorensenAssigned ToDave DeMarle => Bill Lorensen
2015-10-19 10:50Bill LorensenStatusexpired => backlog
2015-10-19 10:55Bill LorensenNote Added: 0035307
2015-10-19 10:55Bill LorensenStatusbacklog => gerrit review
2015-10-21 11:40Bill LorensenProject => TBD
2015-10-21 11:40Bill LorensenType => incorrect functionality
2015-10-21 11:40Bill LorensenResolutionopen => fixed
2015-10-21 11:54Bill LorensenNote Added: 0035332
2015-10-21 11:54Bill LorensenStatusgerrit review => closed

Notes
(0025384)
Glenn Faken   
2011-02-10 14:30   
Hi, I'm going to try and work on this bug and was wondering if you can post the code to your program that is using this function so that I can replicate the issue easily.
(0025385)
David Doria   
2011-02-10 14:35   
I just uploaded a file. It creates a triangle strip with 4 points, writes it to an stl, reads the stl, and declares that there is only 1 point!
(0025386)
Glenn Faken   
2011-02-10 14:40   
Thanks for the quick response.
(0025529)
Glenn Faken   
2011-02-21 23:14   
(edited on: 2011-02-22 01:29)
I've been trying to trace how the calls in the program work and I'm having trouble tracking down how it tells vtkSTLWriter to write. Also when running the test the output states that there is only 1 point is that correct? The stl file only contains "solid ascii endsolid" when it is created.

I was wondering if you had any quick pointers for me to try and follow?

Haha, I went back and reread your previous note and looks like your having the same problem :p

I will also attach a proposed solution.

(0025530)
David Doria   
2011-02-22 07:54   
If you look at
http://www.vtk.org/doc/nightly/html/classvtkSTLWriter.html [^]
you can see the inheritance diagram (it doesn't go all the way up the tree). Better is to click "List of all members". I would start by looking at the Write() function of vtkWriter and follow it down.

I never checked the actual contents of the file, all I did was see that GetNumberOfPoints() reported 1.
(0025531)
Glenn Faken   
2011-02-22 11:35   
(edited on: 2011-02-22 11:36)
Wow if only I had found that link earlier. I've been chasing the .h files and trying to see where the jumps would go.

I've updated the attached file for a little bit cleaner execution and I left it with the warning out side of the if statement to make it easier for maintaining.

I guess I can't delete files so I've renamed the second version.

(0030924)
Jean-Christophe Fillion-Robin   
2013-06-05 16:34   
Hi Glenn,

Does the problem still occur with VTK 5.10 ? VTK 6 ?

Would be great if you could submit a patch using Gerrit. This would make the review and integration easier. For more details see http://www.vtk.org/Wiki/VTK/Git/Develop [^]

Thanks
Jc
(0031201)
Dave DeMarle   
2013-07-22 18:55   
If this is still an issue in 6.0.0, please reopen this report.
(0035307)
Bill Lorensen   
2015-10-19 10:55   
This patch resolves the issue of writing triangle strips, https://gitlab.kitware.com/vtk/vtk/merge_requests/777 [^]

 The error regarding non-triangles was fixed by this gerrit patch: http://review.source.kitware.com/#/c/14558/ [^]
(0035332)
Bill Lorensen   
2015-10-21 11:54   
Fixed in vtk 7. Older versions should run triangle filter before running STLWriter