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

 
 

bug #42040: TriSurface.write sometimes writes incorrect filetypes

Submitted by:  Tim Dezutter <tdezutter>
Submitted on:  Thu 03 Apr 2014 01:54:00 PM UTC  
 
Category: PluginsSeverity: 3 - Normal
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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.

Tim Dezutter <tdezutter>
Project Member
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>
Project AdministratorIn charge of this item.
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?

Tim Dezutter <tdezutter>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 07 Jul 2016 10:38:47 AM UTCbverhegStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Thu 03 Apr 2014 03:19:04 PM UTCbverhegStatusNone=>Ready For Test
      Assigned toNone=>bverheg

    Back to the top


    Powered by Savane 3.1-cleanup1