bugpyFormex - Bugs: bug #42040, TriSurface.write sometimes writes...

 
 

bug #42040: TriSurface.write sometimes writes incorrect filetypes

Submitter:  - <_90458>
Submitted:  Thu 03 Apr 2014 01:54:00 PM UTC
   
 
Category:  Plugins Severity:  3 - Normal
Item Group:  Functionality error Status:  Fixed
Privacy:  Public Assigned to:  bverheg
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 04 Apr 2014 09:10:40 AM UTC, comment #2: 

After fixing a small error that was introduced in TriSurface.write everything seems to be working fine for me now.

- <_90458>
Thu 03 Apr 2014 03:19:04 PM UTC, comment #1: 

The automatic file type and compression type setting is a convenience for the user, who just has to specify a proper file name to specify the file type and optional compression.
 
Unfortunately, a file type like stl has both ascii and binary versions. The best way to handle such files is using specific file extensions: stla, stlb, or e.g. stla.gz for compressed files.

In commit a43bd48 the overriding of the default filetype has been restored in both TriSurface read and write, allowing you to handle other file naming conventions. Untested, so please test and report back.

And remember, stl is a very bad file format. Unless you are forced to use it, you might opt for another format.

Benedict Verhegghe <bverheg>
Group administrator
Thu 03 Apr 2014 01:54:00 PM UTC, original submission:  

TriSurface.write sometimes writes files of the incorrect type. The problem is probably situated in line 616:

    ftype,compr = utils.fileTypeComprFromExt(fname)

This sets ftype to the filename extension found in fname, effectively overwriting the ftype that was passed to the function.

A few examples:

TriSurface.write('fn_object.stl', ftype='stlb') writes an ascii STL instead of a binary STL. This is because line 616 sets ftype to 'stl', as found in the given fname.

TriSurface.write('fn_object', ftype=doesntmatter) always writes an OFF file. This is because line 616 sets ftype to '', since there is no filename extension given in fname. Then a few lines further in the code this defaults to 'off'.

Perhaps this can be fixed by simply changing 'ftype' in line 616 to something else?

- <_90458>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bverheg (Posted a comment)
  • -email is unavailable- added by _90458 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-07 bverheg StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2014-04-03 bverheg StatusNone Ready For Test
        Assigned toNone bverheg

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code