discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

Saving variable data and then reading it back in.

JW
Joe Weinpert
Mon, May 9, 2022 2:42 PM

Is there a way to do this in openSCAD?

Let's say a point matrix (array) is created

boundArray = [ for( i = pathArray ) pointlist_bounds( i ) ];

Is there a way to save the boundArray variable to a text file and then read
it back in?
Something maybe like:

saveValue( boundArray, <filename> );
boundArray = getValue( <filename> );

Is there a way to do this in openSCAD? Let's say a point matrix (array) is created boundArray = [ for( i = pathArray ) pointlist_bounds( i ) ]; Is there a way to save the boundArray variable to a text file and then read it back in? Something maybe like: saveValue( boundArray, <filename> ); boundArray = getValue( <filename> );
TP
Torsten Paul
Mon, May 9, 2022 3:53 PM

On 09.05.22 16:42, Joe Weinpert wrote:

Is there a way to save the boundArray variable to a text file

No.

 and then read it back in?

Yes, in the nightly builds you can read structures from JSON files.
Otherwise you can create OpenSCAD formatted files to include<>.

ciao,
Torsten.

On 09.05.22 16:42, Joe Weinpert wrote: > Is there a way to save the boundArray variable to a text file No. > and then read it back in? Yes, in the nightly builds you can read structures from JSON files. Otherwise you can create OpenSCAD formatted files to include<>. ciao, Torsten.
BC
Bob Carter
Mon, May 9, 2022 8:13 PM

If you just want to see the data and then manipulate it manually then use echo(boundArray);  to put the values out to the console.

The console content can be manually saved to a text file in the GUI version or redirected to a file if you use a command line - edit the output and then use one of Paul’s methods was saying to get it back in.

On 9 May 2022, at 15:42, Joe Weinpert joe.weinpert@gmail.com wrote:

Is there a way to do this in openSCAD?

Let's say a point matrix (array) is created
boundArray = [ for( i = pathArray ) pointlist_bounds( i ) ];

Is there a way to save the boundArray variable to a text file and then read it back in?
Something maybe like:
saveValue( boundArray, <filename> );
boundArray = getValue( <filename> );


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

If you just want to see the data and then manipulate it manually then use echo(boundArray); to put the values out to the console. The console content can be manually saved to a text file in the GUI version or redirected to a file if you use a command line - edit the output and then use one of Paul’s methods was saying to get it back in. > On 9 May 2022, at 15:42, Joe Weinpert <joe.weinpert@gmail.com> wrote: > > > Is there a way to do this in openSCAD? > > Let's say a point matrix (array) is created > boundArray = [ for( i = pathArray ) pointlist_bounds( i ) ]; > > Is there a way to save the boundArray variable to a text file and then read it back in? > Something maybe like: > saveValue( boundArray, <filename> ); > boundArray = getValue( <filename> ); > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JW
Joe Weinpert
Mon, May 9, 2022 8:32 PM

Your steps are pretty much what I've been doing.

Saves a ton of time when developing many path and vnf data matrices from
svg files to create objects.  I generate the arrays and then save them to
files.  Instead of recreating them each time when developing the object, I
simply load them from the file include <filename>. This saves a ton of
development time.

On Mon, May 9, 2022 at 4:13 PM Bob Carter caggius@gmail.com wrote:

If you just want to see the data and then manipulate it manually then use
echo(boundArray);  to put the values out to the console.

The console content can be manually saved to a text file in the GUI
version or redirected to a file if you use a command line - edit the output
and then use one of Paul’s methods was saying to get it back in.

On 9 May 2022, at 15:42, Joe Weinpert joe.weinpert@gmail.com wrote:

Is there a way to do this in openSCAD?

Let's say a point matrix (array) is created

boundArray = [ for( i = pathArray ) pointlist_bounds( i ) ];

Is there a way to save the boundArray variable to a text file and then
read it back in?
Something maybe like:

saveValue( boundArray, <filename> );
boundArray = getValue( <filename> );


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


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

Your steps are pretty much what I've been doing. Saves a ton of time when developing many path and vnf data matrices from svg files to create objects. I generate the arrays and then save them to files. Instead of recreating them each time when developing the object, I simply load them from the file *include <filename>.* This saves a ton of development time. On Mon, May 9, 2022 at 4:13 PM Bob Carter <caggius@gmail.com> wrote: > If you just want to see the data and then manipulate it manually then use > echo(boundArray); to put the values out to the console. > > The console content can be manually saved to a text file in the GUI > version or redirected to a file if you use a command line - edit the output > and then use one of Paul’s methods was saying to get it back in. > > On 9 May 2022, at 15:42, Joe Weinpert <joe.weinpert@gmail.com> wrote: > > > Is there a way to do this in openSCAD? > > Let's say a point matrix (array) is created > > boundArray = [ for( i = pathArray ) pointlist_bounds( i ) ]; > > > Is there a way to save the boundArray variable to a text file and then > read it back in? > Something maybe like: > > saveValue( boundArray, <filename> ); > boundArray = getValue( <filename> ); > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >