Hi I am Paul, new to this forum. I use openSCAD for all my FDM 3D print
designs and as such iterate through designs rapidly with changing parameters
to get parts to fit just right.
For example: A shaft adapters external diameter needs to fit tightly in a
wheel housing and the inside diameter must fit tightly around a motor shaft.
Let's call the project "adapter.scad" with two parameters called od and an
id
I render the project with od = 8.25 and id = 5.13 then export the STL file.
The default STL filename is the project name followed by ".stl" like
"adapter.stl" and currently I manually rename it by adding the parameter
values to the filename. eg: "adapter_8.25_5.13.scad"
This helps me a lot to keep track of what files worked. We could have
arguments about version control and appropriate annotation but for my one
man operation version control get's in the way. I read the thread about the
proposed export() function and I understand the objections and risks.
What I think would be extremely helpful is the ability to define the
filename or a suffix to the file name in code while the actual export action
is only triggered by the UI as it is now. For example:
$suffix = str("_od", od, "_id", id);
Then, when I click on export STL the default filename will appear as
"adapter_8.25_5.13.scad". I so hope I haven't missed anything in the manual
that could be helpful for this but I am keen to hear how this can help.
--
Sent from: http://forum.openscad.org/
On 3/4/2021 8:25 PM, dinther wrote:
$suffix = str("_od", od, "_id", id);
Sounds reasonable to me.
Note that depending on your exact application, you may be able to
achieve the same goals by wrapping a script around a non-interactive
invocation of OpenSCAD. If you know that you need six different ID/OD
combinations, have a script invoke OpenSCAD six times, writing the
resulting STL to six different output files.
JordanBrown wrote
On 3/4/2021 8:25 PM, dinther wrote:
$suffix = str("_od", od, "_id", id);
Sounds reasonable to me.
If this is done, it should probably conceptually include a prefix.
Some additional information would be useful to construct a filename:
Possibly from a function, say system(), e.g.
fn = system("filename");
dt = system("now"); // date-time
combine both into something like
$filename = str("prefix",fn, "_", dt,"_suffix");
There a many issues on GitHub asking for 'system' type information, e.g.
https://github.com/openscad/openscad/issues/339 -
https://github.com/openscad/openscad/issues/380 - includes my raving late
night thoughts...
https://github.com/openscad/openscad/pull/2741 - proposed waiting for
'Objects'
https://github.com/openscad/openscad/issues/2755 - seem to be the continuing
issue
My request for a more detailed version()
https://github.com/openscad/openscad/issues/3593 , proposes a structured
vector as the result of a version_info() function.
Such could be part of a larger structure combining version details and
external info (date, time, etc).
But that is getting unwieldy, so maybe it returns subsets
v=system("version");
dt=system("date-time");
OK, I'll stop here.
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
On 3/5/2021 8:27 PM, MichaelAtOz wrote:
JordanBrown wrote
On 3/4/2021 8:25 PM, dinther wrote:
$suffix = str("_od", od, "_id", id);
Sounds reasonable to me.
If this is done, it should probably conceptually include a prefix.
Since it's only a suggestion, a default for a following "Export as",
perhaps it can be the entire suggested name. Probably less file type,
to be filled in by the selected "Export as". Probably not allowing
directories.
Some additional information would be useful to construct a filename:
Possibly from a function, say system(), e.g.
Well, we are using a programming language so I figure since the user still
initiates the export and confirms the file name, the feature might as well
allow full definition in code and not just a suffix. That keeps clutter to a
minimum and we can juggle what ever data we want into the file name.
--
Sent from: http://forum.openscad.org/
Agreed, and I'd like to see that logic extended to text files as well.
-----Original Message-----
From: dinther vandinther@gmail.com
To: discuss@lists.openscad.org
Sent: Tue, Mar 9, 2021 12:00 am
Subject: Re: [OpenSCAD] parameterized export file name
Well, we are using a programming language so I figure since the user still initiates the export and confirms the file name, the feature might as well allow full definition in code and not just a suffix. That keeps clutter to a minimum and we can juggle what ever data we want into the file name.
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 3/9/2021 7:21 PM, William F. Adams via Discuss wrote:
Agreed, and I'd like to see that logic extended to text files as well.
Text files don't have an "export" mechanism that the user invokes and
confirms.
In my earlier comments, I was thinking of the interactive "export"
operation. I don't know how this hypothetical feature would interact
with command-line usage, or if it should.