View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008072ParaView(No Category)public2008-11-10 06:442009-05-13 13:45
Reporterdh 
Assigned ToUtkarsh Ayachit 
PrioritylowSeveritymajorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version3.6Fixed in Version 
Summary0008072: when reading STL files. points are not displayed, surfaces ignored
DescriptionIn Information:
Number of Cells: 0
Number fo Points: 7627
(points are not displayable, even when setting representation to points).
Shells/triangles do not appear at all.
TagsNo tags attached.
Project
Topic Name
Type
Attached Filesgz file icon Explorer.k.small.stl.gz [^] (658,251 bytes) 2008-11-10 06:44
cxx file icon vtkSTLReader.cxx [^] (10,956 bytes) 2008-11-17 11:50

 Relationships

  Notes
(0014107)
Francesco (reporter)
2008-11-14 04:12

I've noticed that if you remove all the lines containing the keyword "color" the file is correctly displayed.
I guess it should be enough to skip those lines when reading the ascii STL file to resolve the bug.

I.e.

-----------------8<-------------------------------
solid bw-a-pillar-bottom-LEFT
   color 0.98824 0.13333 0.49804
  facet normal 0.065777868 -0.994380057 0.0829555467
    outer loop
      vertex -1236.36243 709.844604 755.906372
      vertex -1235.98022 708.72937 742.235107
      vertex -1243.3512 708.230164 742.095825
    endloop
  endfacet
  facet normal 0.0584581681 -0.994519949 0.086676009
    outer loop
      vertex -1236.36243 709.844604 755.906372
      vertex -1243.3512 708.230164 742.095825
      vertex -1244.53064 709.432861 756.69104
    endloop
  endfacet
  [...]
-----------------8<-------------------------------

becomes:
-----------------8<-------------------------------
solid bw-a-pillar-bottom-LEFT
  facet normal 0.065777868 -0.994380057 0.0829555467
    outer loop
      vertex -1236.36243 709.844604 755.906372
      vertex -1235.98022 708.72937 742.235107
      vertex -1243.3512 708.230164 742.095825
    endloop
  endfacet
  facet normal 0.0584581681 -0.994519949 0.086676009
    outer loop
      vertex -1236.36243 709.844604 755.906372
      vertex -1243.3512 708.230164 742.095825
      vertex -1244.53064 709.432861 756.69104
    endloop
  endfacet
  [...]
-----------------8<-------------------------------

Hope this helps some developer to write a quick fix to this issue.
(0014126)
Francesco (reporter)
2008-11-17 11:48
edited on: 2008-11-17 11:51

I've written a quick fix to this problem.
Here it is the result from the diff command against the official 3.4.0 release:

-----------------8<-------------------------------
[ParaView-3.4.0]$ diff VTK/IO/vtkSTLReader.cxx ../ParaView-3.4.0-release/VTK/IO/
313,316d312
< if ((strcmp(line, "COLOR") == 0) || (strcmp(line, "color") == 0))
< {
< done = (fscanf(fp,"%s %*s %f %f %f\n", line, x, x+1, x+2)==EOF);
< }
361,365d356
< if ((strstr(line, "COLOR") == 0) || (strstr(line, "color") == 0))
< {
< done = (fscanf(fp,"%f %f %f\n", x,x+1,x+2)==EOF);
< done = (fscanf(fp,"%s", line)==EOF);
< }
-----------------8<-------------------------------

Basically, the only routine changed is vtkSTLReader::ReadASCIISTL, adding the check on a possible "color" line just after every time the parsing of a solid block starts.

The proposed modification can read STL ascii files with and without the "color" line.
The modified file is attached.

I hope this helps and the fix, or a better version, could be eventually included in the next release.

Francesco

(0015788)
Utkarsh Ayachit (administrator)
2009-03-24 12:09

Committing reporter's patch to handle stl ascii files containing "color" lines.

/cvsroot/ParaView3/ParaView3/VTK/IO/vtkSTLReader.cxx,v <-- VTK/IO/vtkSTLReader.cxx
new revision: 1.75; previous revision: 1.74
(0015821)
Alan Scott (manager)
2009-03-27 19:46

Looks fixed to me.
Tested local client, XP.

 Issue History
Date Modified Username Field Change
2008-11-10 06:44 dh New Issue
2008-11-10 06:44 dh File Added: Explorer.k.small.stl.gz
2008-11-14 04:12 Francesco Note Added: 0014107
2008-11-17 11:48 Francesco Note Added: 0014126
2008-11-17 11:50 Francesco File Added: vtkSTLReader.cxx
2008-11-17 11:51 Francesco Note Edited: 0014126
2009-02-17 14:57 Utkarsh Ayachit Status backlog => tabled
2009-02-17 14:57 Utkarsh Ayachit Assigned To => Utkarsh Ayachit
2009-02-17 14:57 Utkarsh Ayachit Priority normal => low
2009-02-17 14:57 Utkarsh Ayachit Category 3.4 => 3.6
2009-03-24 12:09 Utkarsh Ayachit Note Added: 0015788
2009-03-24 12:09 Utkarsh Ayachit Status tabled => @80@
2009-03-24 12:09 Utkarsh Ayachit Resolution open => fixed
2009-03-27 19:46 Alan Scott Note Added: 0015821
2009-03-27 19:46 Alan Scott Status @80@ => closed
2009-05-13 13:45 Utkarsh Ayachit Target Version => 3.6
2011-06-16 13:10 Zack Galbreath Category => (No Category)


Copyright © 2000 - 2018 MantisBT Team