discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

STL export file size - UI versus CLI

A
Adje
Fri, Apr 2, 2021 2:27 PM

I accidently found out STL files are much smaller when exported from the UI
than when created from the CLI.
Using Windows, OpenSCAD 2021.01
// sample code, lots of detail for bigger STL demo$fn=180;sphere(10);
From UI, I press F6, then F7.
From CLI, I use:
openscad.com -o from-cli.stl stl-test.scad
Results:
from-ui.stl = 1,619,884 bytes in STL file
Parsing design (AST generation)...Compiling design (CSG Tree
generation)...Rendering Polygon Mesh using CGAL...Geometries in cache:
1Geometry cache size in bytes: 2315672CGAL Polyhedrons in cache: 0CGAL cache
size in bytes: 0Total rendering time: 0:00:00.047  Top level object is a 3D
object:  Facets:      32042Rendering finished.
from-cli.stl = 6,594,615 bytes in STL file
Geometries in cache: 1Geometry cache size in bytes: 2315672CGAL Polyhedrons
in cache: 0CGAL cache size in bytes: 0Total rendering time: 0:00:00.015
Top level object is a 3D object:  Facets:      32042
From what I see, the UI STL file is great. So I have two questions.
Is the UI file really 'as good'?
I am a fan of the CLI, can I get the same version of the UI STL via CLI as
well? I you RTFM me, please add a deeplink ;-)

--
Sent from: http://forum.openscad.org/

I accidently found out STL files are much smaller when exported from the UI than when created from the CLI. Using Windows, OpenSCAD 2021.01 // sample code, lots of detail for bigger STL demo$fn=180;sphere(10); From UI, I press F6, then F7. From CLI, I use: openscad.com -o from-cli.stl stl-test.scad Results: from-ui.stl = 1,619,884 bytes in STL file Parsing design (AST generation)...Compiling design (CSG Tree generation)...Rendering Polygon Mesh using CGAL...Geometries in cache: 1Geometry cache size in bytes: 2315672CGAL Polyhedrons in cache: 0CGAL cache size in bytes: 0Total rendering time: 0:00:00.047 Top level object is a 3D object: Facets: 32042Rendering finished. from-cli.stl = 6,594,615 bytes in STL file Geometries in cache: 1Geometry cache size in bytes: 2315672CGAL Polyhedrons in cache: 0CGAL cache size in bytes: 0Total rendering time: 0:00:00.015 Top level object is a 3D object: Facets: 32042 From what I see, the UI STL file is great. So I have two questions. Is the UI file really 'as good'? I am a fan of the CLI, can I get the same version of the UI STL via CLI as well? I you RTFM me, please add a deeplink ;-) -- Sent from: http://forum.openscad.org/
RW
Ray West
Fri, Apr 2, 2021 2:55 PM

I accidently found out STL files are much smaller when exported from
the UI than when created from the CLI.

Using Windows, OpenSCAD 2021.01

// sample code, lots of detail for bigger STL demo
$fn=180;
sphere(10);

From UI, I press F6, then F7.
From CLI, I use:

openscad.com -o from-cli.stl stl-test.scad
Results:
from-ui.stl = 1,619,884 bytes in STL file
Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
Geometries in cache: 1
Geometry cache size in bytes: 2315672
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.047
Top level object is a 3D object:
Facets:      32042
Rendering finished.
from-cli.stl = 6,594,615 bytes in STL file
Geometries in cache: 1
Geometry cache size in bytes: 2315672
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.015
Top level object is a 3D object:
Facets:      32042

From what I see, the UI STL file is great. So I have two questions.

  1. Is the UI file really 'as good'?
  2. I am a fan of the CLI, can I get the same version of the UI STL
    via CLI as well? I you RTFM me, please add a deeplink ;-)

Sent from the OpenSCAD mailing list archive
http://forum.openscad.org/ at Nabble.com.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Maybe a clue here? https://*github.com*/*openscad*/*openscad*/issues/1555 <https://www.bing.com/search?q=stl+from+openscad%2C+ascii+or+binary&qs=n&form=QBRE&sp=-1&pq=stl+from+openscad%2C+ascii+or+binary&sc=0-34&sk=&cvid=B1E0CEA9F18846CE8F429B0AD59A62A3#> On 02/04/2021 15:27, Adje wrote: > I accidently found out STL files are much smaller when exported from > the UI than when created from the CLI. > > Using Windows, OpenSCAD 2021.01 > > // sample code, lots of detail for bigger STL demo > $fn=180; > sphere(10); > >From UI, I press F6, then F7. > >From CLI, I use: > openscad.com -o from-cli.stl stl-test.scad > Results: > from-ui.stl = 1,619,884 bytes in STL file > Parsing design (AST generation)... > Compiling design (CSG Tree generation)... > Rendering Polygon Mesh using CGAL... > Geometries in cache: 1 > Geometry cache size in bytes: 2315672 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 0:00:00.047 > Top level object is a 3D object: > Facets: 32042 > Rendering finished. > from-cli.stl = 6,594,615 bytes in STL file > Geometries in cache: 1 > Geometry cache size in bytes: 2315672 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 0:00:00.015 > Top level object is a 3D object: > Facets: 32042 > >From what I see, the UI STL file is great. So I have two questions. > > 1. Is the UI file really 'as good'? > 2. I am a fan of the CLI, can I get the same version of the UI STL > via CLI as well? I you RTFM me, please add a deeplink ;-) > > > ------------------------------------------------------------------------ > Sent from the OpenSCAD mailing list archive > <http://forum.openscad.org/> at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
A
arnholm@arnholm.org
Fri, Apr 2, 2021 3:00 PM

On 2021-04-02 16:27, Adje wrote:

I accidently found out STL files are much smaller when exported from
the UI than when created from the CLI.

There are 2 kinds of STL files: Binary and ASCII. Binary is smaller and
better, but the ASCII variant will be ok in most cases.

I am guessing you get ASCII STL with CLI (but I have not checked).

Carsten Arnholm

On 2021-04-02 16:27, Adje wrote: > I accidently found out STL files are much smaller when exported from > the UI than when created from the CLI. There are 2 kinds of STL files: Binary and ASCII. Binary is smaller and better, but the ASCII variant will be ok in most cases. I am guessing you get ASCII STL with CLI (but I have not checked). Carsten Arnholm
A
Adje
Fri, Apr 2, 2021 3:24 PM

cacb wrote

There are 2 kinds of STL files: Binary and ASCII. Binary is smaller and
better, but the ASCII variant will be ok in most cases.

I am guessing you get ASCII STL with CLI (but I have not checked).

Carsten Arnholm

Ah, indeed ASCII vs binary. After attempting to read a STL file a long time
ago, I assumed they would all be binary.

So I'll fiddle around with  admesh
https://admesh.readthedocs.io/en/latest/cli.html  as per the hint from
mondo.

mondo wrote

And there are already open issues considering this point, so no need to add
more.

Thanks Carsten and mondo!

--
Sent from: http://forum.openscad.org/

cacb wrote > There are 2 kinds of STL files: Binary and ASCII. Binary is smaller and > better, but the ASCII variant will be ok in most cases. > > I am guessing you get ASCII STL with CLI (but I have not checked). > > Carsten Arnholm Ah, indeed ASCII vs binary. After attempting to read a STL file a long time ago, I assumed they would all be binary. So I'll fiddle around with admesh <https://admesh.readthedocs.io/en/latest/cli.html> as per the hint from mondo. mondo wrote > Maybe a clue here? https://github.com/openscad/openscad/issues/1555 And there are already open issues considering this point, so no need to add more. Thanks Carsten and mondo! -- Sent from: http://forum.openscad.org/
TP
Torsten Paul
Fri, Apr 2, 2021 4:02 PM

On 02.04.21 17:24, Adje wrote:

And there are already open issues considering this point, so
no need to add more.

There is nothing to consider, both GUI and command line allow
to export both now.

For compatibility the command line export continues defaulting
to ASCII so not to break peoples automations that might rely
on that fact.

GUI defaults to binary now as we considered this should have
a minimal risk of breaking things, you can still revert to
ASCII via Preferences if you need to.

Command line --export-format supports "stl" = using the default
which is ASCII or force a specific format using either "binstl"
or "asciistl". Just run openscad --help as a reminder of allowed
values.

ciao,
Torsten.

On 02.04.21 17:24, Adje wrote: > And there are already open issues considering this point, so > no need to add more. There is nothing to consider, both GUI and command line allow to export both now. For compatibility the command line export continues defaulting to ASCII so not to break peoples automations that might rely on that fact. GUI defaults to binary now as we considered this should have a minimal risk of breaking things, you can still revert to ASCII via Preferences if you need to. Command line --export-format supports "stl" = using the default which is ASCII or force a specific format using either "binstl" or "asciistl". Just run openscad --help as a reminder of allowed values. ciao, Torsten.
A
Adje
Fri, Apr 2, 2021 6:51 PM

Thank you Torsten for the additional pointers. Issue 1555 was some time ago,
so great that it's addressed.

The  manual page
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment
still has the old openscad --help output, so that threw me off there.

And those preferences... Once somebody tells you where to look, you can find
it. As you saw from my original question, I had no idea that was what I was
looking for.

tp3 wrote

On 02.04.21 17:24, Adje wrote:

And there are already open issues considering this point, so
no need to add more.

There is nothing to consider, both GUI and command line allow
to export both now.

For compatibility the command line export continues defaulting
to ASCII so not to break peoples automations that might rely
on that fact.

GUI defaults to binary now as we considered this should have
a minimal risk of breaking things, you can still revert to
ASCII via Preferences if you need to.

Command line --export-format supports "stl" = using the default
which is ASCII or force a specific format using either "binstl"
or "asciistl". Just run openscad --help as a reminder of allowed
values.

Thank you Torsten for the additional pointers. Issue 1555 was some time ago, so great that it's addressed. The manual page <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment> still has the old openscad --help output, so that threw me off there. And those preferences... Once somebody tells you where to look, you can find it. As you saw from my original question, I had no idea that was what I was looking for. tp3 wrote > On 02.04.21 17:24, Adje wrote: >> And there are already open issues considering this point, so >> no need to add more. > > There is nothing to consider, both GUI and command line allow > to export both now. > > For compatibility the command line export continues defaulting > to ASCII so not to break peoples automations that might rely > on that fact. > > GUI defaults to binary now as we considered this should have > a minimal risk of breaking things, you can still revert to > ASCII via Preferences if you need to. > > Command line --export-format supports "stl" = using the default > which is ASCII or force a specific format using either "binstl" > or "asciistl". Just run openscad --help as a reminder of allowed > values. -- Sent from: http://forum.openscad.org/