Skip to content

Commit f1a2696

Browse files
committed
Merge branch 'release/2.16.1'
2 parents 1c78670 + 4436492 commit f1a2696

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

README.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ Installation:
4949
Initial usage:
5050
------------------------------------------------------------------------------
5151

52-
- `stl2bin your_ascii_stl_file.stl new_binary_stl_file.stl`
53-
- `stl2ascii your_binary_stl_file.stl new_ascii_stl_file.stl`
54-
- `stl your_ascii_stl_file.stl new_binary_stl_file.stl`
52+
After installing the package, you should be able to run the following commands
53+
similar to how you can run `pip`.
54+
55+
.. code-block:: shell
56+
57+
$ stl2bin your_ascii_stl_file.stl new_binary_stl_file.stl
58+
$ stl2ascii your_binary_stl_file.stl new_ascii_stl_file.stl
59+
$ stl your_ascii_stl_file.stl new_binary_stl_file.stl
5560
5661
Contributing:
5762
------------------------------------------------------------------------------

stl/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__package_name__ = 'numpy-stl'
22
__import_name__ = 'stl'
3-
__version__ = '2.16.0'
3+
__version__ = '2.16.1'
44
__author__ = 'Rick van Hattem'
55
__author_email__ = '[email protected]'
66
__description__ = ' '.join('''

stl/stl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,16 @@ def save(self, filename, fh=None, mode=AUTOMATIC, update_normals=True):
279279
"File handles should be in binary mode - even when"
280280
" writing an ASCII STL.")
281281

282-
name = os.path.split(filename)[-1]
282+
name = self.name
283+
if not name:
284+
name = os.path.split(filename)[-1]
285+
283286
try:
284287
if fh:
285288
write(fh, name)
286289
else:
287290
with open(filename, 'wb') as fh:
288-
write(fh, filename)
291+
write(fh, name)
289292
except IOError: # pragma: no cover
290293
pass
291294

0 commit comments

Comments
 (0)