Bug#877392: admesh doesn't parse binary STLs correctly on big-endian architectures

Chow Loong Jin hyperair at debian.org
Sun Oct 1 10:44:41 UTC 2017


Package: admesh
Version: 0.98.2-3
Severity: important
Tags: upstream patch
Forwarded: https://github.com/admesh/admesh/pull/26

Dear Maintainer,

Reading binary STLs is broken on big-endian architectures due to the incorrect
little-endian assumption in admesh's STL reading code.

Here's the output from admesh block-binary.stl on partch.debian.org (ppc):
hyperair at partch ~/admesh-0.98.3
 % /usr/bin/admesh block-binary.stl
ADMesh version 0.98.3, Copyright (C) 1995, 1996 Anthony D. Martin
ADMesh comes with NO WARRANTY.  This is free software, and you are welcome to
redistribute it under certain conditions.  See the file COPYING for details.
Opening block-binary.stl
Warning: File size doesn't match number of facets in the header
Checking exact...
All facets connected.  No nearby check necessary.
No unconnected need to be removed.
No holes need to be filled.
Checking normal directions...
Checking normal values...
Calculating volume...
Verifying neighbors...

================= Results produced by ADMesh version 0.98.3 ================
Input file         : block-binary.stl
File type          : Binary STL file
Header             : Processed by ADMesh version 0.98.3
============== Size ==============
Min X = -613977118228749856000863895552.000000, Max X =
-613972282525471397484165070848.000000
Min Y = -613977118228749856000863895552.000000, Max Y =
-613972282525471397484165070848.000000
Min Z = -613977118228749856000863895552.000000, Max Z =
-613972282525471397484165070848.000000
========= Facet Status ========== Original ============ Final ====
Number of facets                 :    12                  12
Facets with 1 disconnected edge  :     0                   0
Facets with 2 disconnected edges :     0                   0
Facets with 3 disconnected edges :     0                   0
Total disconnected facets        :     0                   0
=== Processing Statistics ===     ===== Other Statistics =====
Number of parts       :     1        Volume   :  nan
Degenerate facets     :     0
Edges fixed           :     0
Facets removed        :     0
Facets added          :     0
Facets reversed       :     0
Backwards edges       :     0
Normals fixed         :    12


And the output of admesh with the fix:

hyperair at partch ~/admesh-0.98.3
 % ./admesh block-binary.stl
ADMesh version 0.98.3, Copyright (C) 1995, 1996 Anthony D. Martin
ADMesh comes with NO WARRANTY.  This is free software, and you are welcome to
redistribute it under certain conditions.  See the file COPYING for details.
Opening block-binary.stl
Checking exact...
All facets connected.  No nearby check necessary.
No unconnected need to be removed.
No holes need to be filled.
Checking normal directions...
Checking normal values...
Calculating volume...
Verifying neighbors...

================= Results produced by ADMesh version 0.98.3 ================
Input file         : block-binary.stl
File type          : Binary STL file
Header             : Processed by ADMesh version 0.98.3
============== Size ==============
Min X = -1.968504, Max X =  1.968504
Min Y = -1.968504, Max Y =  1.968504
Min Z = -1.968504, Max Z =  1.968504
========= Facet Status ========== Original ============ Final ====
Number of facets                 :    12                  12
Facets with 1 disconnected edge  :     0                   0
Facets with 2 disconnected edges :     0                   0
Facets with 3 disconnected edges :     0                   0
Total disconnected facets        :     0                   0
=== Processing Statistics ===     ===== Other Statistics =====
Number of parts       :     1        Volume   :  61.023746
Degenerate facets     :     0
Edges fixed           :     0
Facets removed        :     0
Facets added          :     0
Facets reversed       :     0
Backwards edges       :     0
Normals fixed         :     0


I've filed a pull request at https://github.com/admesh/admesh/pull/26 already,
but it might be worth fixing on the Debian side as well.

-- 
Kind regards,
Loong Jin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-reading-of-binary-STLs-in-BE-architectures.patch
Type: text/x-diff
Size: 3191 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-science-maintainers/attachments/20171001/d6b8b2a8/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-science-maintainers/attachments/20171001/d6b8b2a8/attachment-0001.sig>


More information about the debian-science-maintainers mailing list