Real-time clock

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

Real-time clock

Maurice van Peursem
Is it possible to use the real time in a script? That would be useful
to animate a clock for instance.

Maurice

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

RobWLakes
And pls take input from the IoT systems to model real time control functions or sensory inputs (eg a barometer, or a weather house, or a cuckoo clock Spring to mind as really basic ideas). My thoughts are racing.... A tide clock, moon phases, solar panel capture .....

On 29 November 2016 7:01:09 am AEDT, Maurice van Peursem <[hidden email]> wrote:
Is it possible to use the real time in a script? That would be useful 
to animate a clock for instance.

Maurice



OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

Maurice van Peursem
OK, automatically incorporate the date of design into the object
then, is that a more realistic scenario? But from your cynical
reaction I conclude the real time is not available. Pity.

Maurice


>And pls take input from the IoT systems to model real time control
>functions or sensory inputs (eg a barometer, or a weather house, or
>a cuckoo clock Spring to mind as really basic ideas). My thoughts
>are racing.... A tide clock, moon phases, solar panel capture .....
>
>On 29 November 2016 7:01:09 am AEDT, Maurice van Peursem
><[hidden email]> wrote:
>
>Is it possible to use the real time in a script? That would be useful
>to animate a clock for instance.
>
>Maurice

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

RobWLakes
In reply to this post by RobWLakes

No exactly the opposite, my skills with enthusiasm and good humor often seem to backfire on me.  I think the possibilities of visualising "external" situations could be very powerful.  I apologise Maurice if I offended you, but the Raspberry pi has been a breath of fresh air to me.  As Apple slides down the path of "hands off my I/O" that it and MS began in the late 80's  they lose me more and more (they seem to be taking minimalist I/O to extremes with only one "C" usb on their phones (and laptops?)).  While we don't have an ARM-RPi openSCAD just yet, animating or recording events with openSCAD's drawing set would be awesome.  I use  an Apache II based web server, USB/Serially interfaced to an Arduino that intercepts and decodes my 433MHz weather sensors (rain, wind speed, wind direction, temperature, humidity and air pressure) the data gets collected every minute and  the Python3 Cairo library draws my graphs.  All of this is on a Raspberry Pi3 running Ubuntu-Mate.

Extending that to create .stl files that viewers could zoom, spin etc to inspect would be really fantastic.  My set up above is largely constrained by the fact it was developed on an Intel Atom first and hence the use of USB/Serial interface.  However the R-Pi GPIO (General Purpose Input Output) offers up so much more scope for other IoT ideas.

I am probably daydreaming, but I am happy to be proved wrong.

Rob


On 29/11/16 08:41, Maurice van Peursem wrote:
OK, automatically incorporate the date of design into the object then, is that a more realistic scenario? But from your cynical reaction I conclude the real time is not available. Pity.

Maurice


And pls take input from the IoT systems to model real time control functions or sensory inputs (eg a barometer, or a weather house, or a cuckoo clock Spring to mind as really basic ideas). My thoughts are racing.... A tide clock, moon phases, solar panel capture .....

On 29 November 2016 7:01:09 am AEDT, Maurice van Peursem [hidden email] wrote:

Is it possible to use the real time in a script? That would be useful
to animate a clock for instance.

Maurice

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--

Rob Ward
Lake Tyers Beach, 3909
Lake Tyers Beach Website
XP to XUbuntu


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

MichaelAtOz
Administrator
In reply to this post by Maurice van Peursem
You can use the command line 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 - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

Neon22
In reply to this post by RobWLakes
its possible that vpython is what you want. (OpenGL-python in a realtime wrapper).
Obviously it's not remotely openscad like - I just indicate it in case it is what you're really looking for...

- http://vpython.org/
- examples/youtube etc.. http://vpython.org/contents/doc.html
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

RobWLakes
That is very interesting, Neon22, I could probably use vpython myself
straight away for some things internally, however I was thinking more of
exporting .stl files onto the website and having a Thingiverse style
interface that the browsers could invoke to view it. I am probably
overly ambitious here at this stage. As an openSCAD fan, I would be
happiest seeing my App choice extended according to my wishes (aren't we
all?), however I am just giving the concept(s) some support to see what
the people who really know what openSCAD can do think of the potential.  
I have no wish to encourage forks of the code, and also respect that
these things may require enormous amounts of perspiration and
inspiration to realise (far beyond my abilities).

There has been generations of students whose experience of computers has
been constrained by the MS/Apple view of what hardware and software
could do.  (USB even saw the Gameport and Printer Port disappear!)  The
Raspberry Pi takes me back to the world of the Kim-1 and Sym-1, where we
did not need a super clever mobile Phone with an App running, talking
WiFi or Bluetooth to a network stack to drive a REST implementation in
an Arduino to make an LED begin flashing.  The possibilities with these
SBC and SOC architectures (RPi & ARM) has revitalised how we see
software directly interacting with the outside world.  Tapping into this
with openSCAD (with all its inherent rendering power) just seemed a
powerful idea.

Rob

On 29/11/16 10:06, Neon22 wrote:

> its possible that vpython is what you want. (OpenGL-python in a realtime
> wrapper).
> Obviously it's not remotely openscad like - I just indicate it in case it is
> what you're really looking for...
>
> - http://vpython.org/
> - examples/youtube etc.. http://vpython.org/contents/doc.html
>
>
>
> --
> View this message in context: http://forum.openscad.org/Real-time-clock-tp19391p19403.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

Tim V. Shaporev
In reply to this post by MichaelAtOz
+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
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

jdawgaz
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 <[hidden email]> 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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

RobWLakes

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 <[hidden email]> 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));
-----



-----


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

jdawgaz
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 <[hidden email]> 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 <[hidden email]> 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));
-----



-----


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Real-time clock

Maurice van Peursem
In reply to this post by Neon22
Thanks Neon22, that was indeed a useful hint. I've looked at vPython
before, but because it is not actively developed anymore I rejected
it. But for the project I wanted to make it was ideal, also because I
can share it immediately. Glowscript also doesn't support the time
function, but you can use the javascript version. A simple clock
showing local time can then easily be made:

http://www.glowscript.org/#/user/varalflip/folder/Public/program/Clock

I'm now so used to OpenSCAD that it would have taken me less time to
write it in OpenSCAD, but Glowscript resembles the functionality
enough to make it a fairly easy job.

Rob, obviously no offence taken as your remark was meant seriously! I
should have read your post more carefully.

Maurice

>its possible that vpython is what you want. (OpenGL-python in a realtime
>wrapper).
>Obviously it's not remotely openscad like - I just indicate it in case it is
>what you're really looking for...
>
>- http://vpython.org/
>- examples/youtube etc.. http://vpython.org/contents/doc.html
>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org