STL export file size - UI versus CLI

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

STL export file size - UI versus CLI

Adje
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 at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: STL export file size - UI versus CLI

mondo

Maybe a clue here? https://github.com/openscad/openscad/issues/1555


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 at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: STL export file size - UI versus CLI

cacb
In reply to this post by Adje
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
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: STL export file size - UI versus CLI

Adje
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 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 the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
tp3
Reply | Threaded
Open this post in threaded view
|

Re: STL export file size - UI versus CLI

tp3
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.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: STL export file size - UI versus CLI

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

The manual page 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 the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]