discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Real-time clock

M
MichaelAtOz
Mon, Nov 28, 2016 10:57 PM

You can use the  command line
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment
to incorporate external values.

Have a script place the time/date/whatever as a variable(s) into an include
<> file.

input.scad

date="20161129";
time="095525001";

main.scad

include <input.scad>
text(str(date, time));


Admin - PM 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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Real-time-clock-tp19391p19402.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

You can use the command line <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment> to incorporate external values. Have a script place the time/date/whatever as a variable(s) into an include <> file. input.scad ----- date="20161129"; time="095525001"; ----- main.scad ----- include <input.scad> text(str(date, time)); ----- ----- Admin - PM 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Real-time-clock-tp19391p19402.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TV
Tim V. Shaporev
Tue, Nov 29, 2016 11:26 AM

+1 for the command line.
In UNIX this is quite straightforward like -D date="date"

On 11/29/2016 1:57 AM, MichaelAtOz wrote:

You can use the  command line
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment
to incorporate external values.

Have a script place the time/date/whatever as a variable(s) into an include
<> file.

input.scad

date="20161129";
time="095525001";

main.scad

include <input.scad>
text(str(date, time));


Admin - PM 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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Real-time-clock-tp19391p19402.html
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

+1 for the command line. In UNIX this is quite straightforward like -D date=\"`date`\" On 11/29/2016 1:57 AM, MichaelAtOz wrote: > You can use the command line > <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment> > to incorporate external values. > > Have a script place the time/date/whatever as a variable(s) into an include > <> file. > > input.scad > ----- > date="20161129"; > time="095525001"; > ----- > > main.scad > ----- > include <input.scad> > text(str(date, time)); > ----- > > > > ----- > Admin - PM 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. > > The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! > -- > View this message in context: http://forum.openscad.org/Real-time-clock-tp19391p19402.html > 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 >
JD
Jerry Davis
Tue, Nov 29, 2016 1:38 PM

Rob Ward: I thought I installed OpenSCAD on my Rpi over a year ago.
$ sudo apt-get install openscad

It has been a while since I used it, though, since rendering was like
watching grass grow.

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

On Tue, Nov 29, 2016 at 4:26 AM, Tim V. Shaporev tim.shaporev@auriga.ru
wrote:

+1 for the command line.
In UNIX this is quite straightforward like -D date="date"

On 11/29/2016 1:57 AM, MichaelAtOz wrote:

You can use the  command line
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_
OpenSCAD_in_a_command_line_environment>
to incorporate external values.

Have a script place the time/date/whatever as a variable(s) into an
include
<> file.

input.scad

date="20161129";
time="095525001";

main.scad

include <input.scad>
text(str(date, time));


Admin - PM 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.

The TPP is no simple “trade agreement.”  Fight it!
http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Real
-time-clock-tp19391p19402.html
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

Rob Ward: I thought I installed OpenSCAD on my Rpi over a year ago. $ sudo apt-get install openscad It has been a while since I used it, though, since rendering was like watching grass grow. -- Extra Ham Operator: K7AZJ Registered Linux User: 275424 Raspberry Pi and Openscad developer *The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov On Tue, Nov 29, 2016 at 4:26 AM, Tim V. Shaporev <tim.shaporev@auriga.ru> wrote: > +1 for the command line. > In UNIX this is quite straightforward like -D date=\"`date`\" > > > On 11/29/2016 1:57 AM, MichaelAtOz wrote: > >> You can use the command line >> <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_ >> OpenSCAD_in_a_command_line_environment> >> to incorporate external values. >> >> Have a script place the time/date/whatever as a variable(s) into an >> include >> <> file. >> >> input.scad >> ----- >> date="20161129"; >> time="095525001"; >> ----- >> >> main.scad >> ----- >> include <input.scad> >> text(str(date, time)); >> ----- >> >> >> >> ----- >> Admin - PM 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. >> >> The TPP is no simple “trade agreement.” Fight it! >> http://www.ourfairdeal.org/ time is running out! >> -- >> View this message in context: http://forum.openscad.org/Real >> -time-clock-tp19391p19402.html >> 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 >> >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
RW
Rob Ward
Wed, Nov 30, 2016 12:19 AM

Ok I will give it a go.  I was thinking of using pretty basic drawing in
openSCAD, so maybe the rendering time would be ok (in my case it would
have to finish in under a minute to be useful). As ARM's strength is low
power, rather the grunt in processing power that '86 architectures
offer, I can understand why the rendering might be so slow.  I tried to
get openSCAD onto my server RPi but using the command you suggested it
says that package is not available.

However the thought of rendering a 3D compass needle, or a cockerel over
a quadrant, pointing to the wind direction is rather tantalising.

Writing a python program to write .scad files to be included in the
rendering program is worth a try.  However I will try to get my head
around the command line operation to run "non-GUI" rendering and image
writing before I go any further. Plus I will have to track down ARM
openSCAD as well.

For simpler applications than mine it would much more convenient to have
openSCAD just read the .json format Serial.in, parse it, and act on it.
Or just read direct pins, SPI, I2C etc from the GPIO.  Such is my
selfish outlook ;-)

Rob

PS was the RPi the original model or the latest 3?

On 30/11/16 00:38, Jerry Davis wrote:

Rob Ward: I thought I installed OpenSCAD on my Rpi over a year ago.
$ sudo apt-get install openscad

It has been a while since I used it, though, since rendering was like
watching grass grow.

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

/The most exciting phrase to hear in science - the one that heralds
new discoveries - is not "Eureka!" but "That's funny...".
/- Isaac. Asimov

On Tue, Nov 29, 2016 at 4:26 AM, Tim V. Shaporev
<tim.shaporev@auriga.ru mailto:tim.shaporev@auriga.ru> wrote:

 +1 for the command line.
 In UNIX this is quite straightforward like -D date=\"`date`\"


 On 11/29/2016 1:57 AM, MichaelAtOz wrote:

     You can use the  command line
     <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment
     <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment>>
     to incorporate external values.

     Have a script place the time/date/whatever as a variable(s)
     into an include
     <> file.

     input.scad
     -----
     date="20161129";
     time="095525001";
     -----

     main.scad
     -----
     include <input.scad>
     text(str(date, time));
     -----



     -----
Ok I will give it a go. I was thinking of using pretty basic drawing in openSCAD, so maybe the rendering time would be ok (in my case it would have to finish in under a minute to be useful). As ARM's strength is low power, rather the grunt in processing power that '86 architectures offer, I can understand why the rendering might be so slow. I tried to get openSCAD onto my server RPi but using the command you suggested it says that package is not available. However the thought of rendering a 3D compass needle, or a cockerel over a quadrant, pointing to the wind direction is rather tantalising. Writing a python program to write .scad files to be included in the rendering program is worth a try. However I will try to get my head around the command line operation to run "non-GUI" rendering and image writing before I go any further. Plus I will have to track down ARM openSCAD as well. For simpler applications than mine it would much more convenient to have openSCAD just read the .json format Serial.in, parse it, and act on it. Or just read direct pins, SPI, I2C etc from the GPIO. Such is my selfish outlook ;-) Rob PS was the RPi the original model or the latest 3? On 30/11/16 00:38, Jerry Davis wrote: > Rob Ward: I thought I installed OpenSCAD on my Rpi over a year ago. > $ sudo apt-get install openscad > > It has been a while since I used it, though, since rendering was like > watching grass grow. > > > > -- > Extra Ham Operator: K7AZJ > Registered Linux User: 275424 > Raspberry Pi and Openscad developer > > /The most exciting phrase to hear in science - the one that heralds > new discoveries - is not "Eureka!" but "That's funny...". > /- Isaac. Asimov > > > On Tue, Nov 29, 2016 at 4:26 AM, Tim V. Shaporev > <tim.shaporev@auriga.ru <mailto:tim.shaporev@auriga.ru>> wrote: > > +1 for the command line. > In UNIX this is quite straightforward like -D date=\"`date`\" > > > On 11/29/2016 1:57 AM, MichaelAtOz wrote: > > You can use the command line > <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment > <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment>> > to incorporate external values. > > Have a script place the time/date/whatever as a variable(s) > into an include > <> file. > > input.scad > ----- > date="20161129"; > time="095525001"; > ----- > > main.scad > ----- > include <input.scad> > text(str(date, time)); > ----- > > > > ----- >
JD
Jerry Davis
Wed, Nov 30, 2016 4:05 AM

It was on a 2, I don't know how it would be with the rpi3.
But I run fldigi on the rpi3 just fine ( and that is no slouch of a program
that needs resources).

Jerry

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

On Tue, Nov 29, 2016 at 5:19 PM, Rob Ward rl.ward@bigpond.com wrote:

Ok I will give it a go.  I was thinking of using pretty basic drawing in
openSCAD, so maybe the rendering time would be ok (in my case it would have
to finish in under a minute to be useful).  As ARM's strength is low power,
rather the grunt in processing power that '86 architectures offer, I can
understand why the rendering might be so slow.  I tried to get openSCAD
onto my server RPi but using the command you suggested it says that package
is not available.

However the thought of rendering a 3D compass needle, or a cockerel over a
quadrant, pointing to the wind direction is rather tantalising.

Writing a python program to write .scad files to be included in the
rendering program is worth a try.  However I will try to get my head around
the command line operation to run "non-GUI" rendering and image writing
before I go any further. Plus I will have to track down ARM openSCAD as
well.

For simpler applications than mine it would much more convenient to have
openSCAD just read the .json format Serial.in, parse it, and act on it.  Or
just read direct pins, SPI, I2C etc from the GPIO.  Such is my selfish
outlook ;-)

Rob
PS was the RPi the original model or the latest 3?

On 30/11/16 00:38, Jerry Davis wrote:

Rob Ward: I thought I installed OpenSCAD on my Rpi over a year ago.
$ sudo apt-get install openscad

It has been a while since I used it, though, since rendering was like
watching grass grow.

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

*The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...". *- Isaac. Asimov

On Tue, Nov 29, 2016 at 4:26 AM, Tim V. Shaporev tim.shaporev@auriga.ru
wrote:

+1 for the command line.
In UNIX this is quite straightforward like -D date="date"

On 11/29/2016 1:57 AM, MichaelAtOz wrote:

You can use the  command line
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_Op
enSCAD_in_a_command_line_environment>
to incorporate external values.

Have a script place the time/date/whatever as a variable(s) into an
include
<> file.

input.scad

date="20161129";
time="095525001";

main.scad

include <input.scad>
text(str(date, time));


It was on a 2, I don't know how it would be with the rpi3. But I run fldigi on the rpi3 just fine ( and that is no slouch of a program that needs resources). Jerry -- Extra Ham Operator: K7AZJ Registered Linux User: 275424 Raspberry Pi and Openscad developer *The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov On Tue, Nov 29, 2016 at 5:19 PM, Rob Ward <rl.ward@bigpond.com> wrote: > Ok I will give it a go. I was thinking of using pretty basic drawing in > openSCAD, so maybe the rendering time would be ok (in my case it would have > to finish in under a minute to be useful). As ARM's strength is low power, > rather the grunt in processing power that '86 architectures offer, I can > understand why the rendering might be so slow. I tried to get openSCAD > onto my server RPi but using the command you suggested it says that package > is not available. > > However the thought of rendering a 3D compass needle, or a cockerel over a > quadrant, pointing to the wind direction is rather tantalising. > > Writing a python program to write .scad files to be included in the > rendering program is worth a try. However I will try to get my head around > the command line operation to run "non-GUI" rendering and image writing > before I go any further. Plus I will have to track down ARM openSCAD as > well. > > For simpler applications than mine it would much more convenient to have > openSCAD just read the .json format Serial.in, parse it, and act on it. Or > just read direct pins, SPI, I2C etc from the GPIO. Such is my selfish > outlook ;-) > > Rob > PS was the RPi the original model or the latest 3? > > > On 30/11/16 00:38, Jerry Davis wrote: > > Rob Ward: I thought I installed OpenSCAD on my Rpi over a year ago. > $ sudo apt-get install openscad > > It has been a while since I used it, though, since rendering was like > watching grass grow. > > > > -- > Extra Ham Operator: K7AZJ > Registered Linux User: 275424 > Raspberry Pi and Openscad developer > > > *The most exciting phrase to hear in science - the one that heralds new > discoveries - is not "Eureka!" but "That's funny...". *- Isaac. Asimov > > On Tue, Nov 29, 2016 at 4:26 AM, Tim V. Shaporev <tim.shaporev@auriga.ru> > wrote: > >> +1 for the command line. >> In UNIX this is quite straightforward like -D date=\"`date`\" >> >> >> On 11/29/2016 1:57 AM, MichaelAtOz wrote: >> >>> You can use the command line >>> <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_Op >>> enSCAD_in_a_command_line_environment> >>> to incorporate external values. >>> >>> Have a script place the time/date/whatever as a variable(s) into an >>> include >>> <> file. >>> >>> input.scad >>> ----- >>> date="20161129"; >>> time="095525001"; >>> ----- >>> >>> main.scad >>> ----- >>> include <input.scad> >>> text(str(date, time)); >>> ----- >>> >>> >>> >>> ----- >>> >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >