We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Outputting multiple docs with PrintWriter
Page Index Toggle Pages: 1
Outputting multiple docs with PrintWriter (Read 1022 times)
Outputting multiple docs with PrintWriter
Mar 29th, 2009, 8:08pm
 
I am working with a sketch derived from the super-rad kokkugia folks.
their sketch linked here > http://www.kokkugia.com/wiki/index.php5?title=KAgent_example_3d_export.

basically what they have done is implement the printWriter object to export the position of the vectors in 3D space to a txt. file that can then be imported to a 3D modeling environment (Rhino, in this case).

Ok this works well and good for capturing one frame of the action for export. I am interested in capturing multiple frames to show the development / movement of the vector.

I am familiar with the beginRecord function, but I cannot get it to work with the 3D vector sketch linked to above.

Anyone got any good ideas


Re: Outputting multiple docs with PrintWriter
Reply #1 - Mar 30th, 2009, 12:26am
 
right. sorry. If you want to run the sketch I linked to you will need this (kGeom library)>http://code.google.com/p/kgeom/downloads/list.

To clarify: I am not trying to reinvent the wheel. I am just wondering if there is a way to modify this sketch>http://www.kokkugia.com/wiki/index.php5?title=KAgent_example_3d_export

to export a series of txt files as opposed to writing over the same txt repeatedly with each mouse click.

Thanks again Processing Universe.
Re: Outputting multiple docs with PrintWriter
Reply #2 - Mar 30th, 2009, 3:19am
 
Quote:
void exportToTxt() {  
 output = createWriter("PointExport.txt");

becomes something like:
Code:
void exportToTxt() {  
output = createWriter("PointExport-" + ++exportNb + ".txt");

with an int exportNb; declaration on top of the sketch.
You can add some padding initial zeroes to the number, too.
Page Index Toggle Pages: 1