Skip to content

Commit

Permalink
First upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathanaël Jourdane committed Jan 9, 2016
1 parent 0a15c6e commit 936a5a3
Show file tree
Hide file tree
Showing 16 changed files with 1,085 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
customizable_digital_sundial.scad
187 changes: 185 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,185 @@
# Customizable-Digital-Sundial
A sundial which displays whatever you want, whenever you want, with only a 3D-printed object.
# Customizable Digital Sundial
A sundial which displays whatever you want, whenever you want, with only a
3D-printed object.

![The sundial](https://raw.githubusercontent.com/roipoussiere/Customizable-Digital-Sundial/master/images/numbers_printed.jpg)

## About the original Digital Sundial

This work inspirated by the Mojoptix project ([website][mojo_website],
[Thingiverse](mojo_thingiverse)).

> It's a Sundial displaying the time inside its shadow, with actual digits !
> There is a tiny bit of magic inside...
>
> No batteries, no motor, no electronics... It's all just a really super-fancy
> shadow show. The shape of the sundial has been mathematically designed to
> only let through the right sunrays at the right time/angle. This allows to
> display the actual time with sunlit digits inside the sundial's shadow.
>
> The sundial displays time (with actual digits !!) from 10:00 until 16:00,
> updating every 20 minutes.
> You can precisely adjust the displayed time simply by rotating the gnomon
> (the magic box that displays time). So you can even adjust for Daylight
> Saving Time.
Its [video podcast](mojo_podcast) describes this sundial in details.

## Customizable Digital Sundial

Contrary to the Mojoptix sundial, this one allows you to display, instead of
the clock numbers, whatever and whenever you want. The displayed text can be as
long as you want, and can contain all usual characters. In addition, you can
customize a lot a others parameters, like the digits duration or the gnomon
shape.

See [the simulation](simulation) on Youtube for the [quick_fox.stl](quick_fox)
example.

The attached STL files are not required, it's just few items made with the
Customizer app to show you what you can do (see *Text* option bellow).

## Available customizable options

#### Main options

- **Text**: the text displayed on the shadow of the sundial, for each position,
separated by semi-colons. For example, if you want to display "Hello", then
"world" few minutes later, set this field to `Hello;world`. Try with these
ones:
- [quick_fox.stl](quick_fox):
`The;quick;brown;fox;jumps;over;the;lazy;dog.`
- [clock.stl](clock):
`10:00;10:20;10:40;11:00;11:20;11:40;12:00;12:20;12:40;13:00;`
`13:20;13:40;14:00;14:20;14:40;15:00;15:20;15:40;16:00`
- [numbers.stl](numbers):
`0;1;2;3;4;5;6;7;8;9`
- **Digits duration**: the duration of each text, according to the sun
rotation.
- **Hemisphere**: just select where you are;
- **basic shape** of the gnomon:
- a half-cylinder;
- a "boat", which is an optimized shape because each hole has the same
depth.
- **holder**: to print (or not) a holder which fixes the gnomon (with a screw).
The holder is Mojoptix-compatible.
- **rod**: print a pipe to hold several digits together with a rod. So you can
print a 1 meter long sundial, with your 12x12 printer. ;-)
- **font**: Font used to display the text, among 2 available fonts:
- numbers, with 4x6 digits: `0-9`, and `:`. If your text contains other
characters, an error will occurs.
- ASCII, with 5x7 digits: `0-9`, `a-z`, `A-Z`, and
` !\"#%$&'()*+,-./:;<=>?@[\]^_``{|}~¤`, where `~` and `¤` are respectively
a full black digit and a heart. Note that you can easily customize and / or
add fonts by editing the scad file.
- **transition delay**: during a transition, all pixels turns to black. With no
transition (0%), the piece contains less material (so it's faster to print),
but digits are sometimes not clear.

#### Advanced parameters

- **gnomon radius**
- **pixel width**
- **pixel height**
- **space between columns**
- **space between rows**
- **space between digits**
- **enlarge slots** : Enlarge the slots on the bottom on the gnomon. Big slots
should improve digits readability, but can also unintentionally turn some
pixels to white.
- **screw size** : the screw size used to hold the gnomon.

## Instructions

#### Step by step
- Customize your sundial with the *Makerbot Customizer* interface, then
download it;
- verify the item with a rendering software (OpenSCAD, Netfabb, Blender, ...),
and check the digits on each position (then eventually re-customize it). Prefer
an orthogonal view than a perspective view to watch the item;
- print it with the settings bellow;
- print the other pieces [from here](mojo_thingiverse);
- Put them together and enjoy;
- Please take a picture and share it on Thingiverse (by clicking on *I made
one*). I am always so happy to see what people make with my work! :-)

A bonus point to the first who prints a "sundial powered word clock", which
displays the time each 15 minutes, in its literal form. :-D

#### Other required parts
- an (empty !) jam jar;
- 3x M6 screws, flat head, length = 20 mm;
- 1x M6 screw, flat head, length = 50 mm;
- 4x M6 nuts;
- 4x M6 washer, outside diameter < 14mm;

#### Print settings
Tested on a Up! Plus.

- **Raft**: Yes
- **Supports**: No
- **Resolution**: 0.15mm
- **Infill**: 10%
- **Print quality**: fast
- **Print thin parts**: No

## GitHub repository

The entire code is documented and easy to read and modify.

See my [GitHub](github_repo) repository, it's easier to work from here and
there is additional useful files (like Python and Blender scripts).

#### OpenSCAD scripts
For more readability, the .scad script is splitted in 3 files:
*main*, *functions* and *fonts*.

The *functions* file uses a part of my [OpenSCAD library](TOUL) for string and
vectors operations. Take a look.

#### Python scripts
- **merge.py**: Prepare the .scad file to be uploaded on Thingiverse:
- replace the parameters by the default parameters;
- replace the `<include>` declarations by their contents (Customizer app
doesn't supports multiple .scad files.);
- remove lines containing `/*TODO` or `/*NOTE`.
- **compare.py**: Compare 2 .scad files representing a sundial. It slice the
3D-models in a given position, then generates a picture showing the 2
superposed slices.
- **decode_font.py**: Decode an array of numbers in hexadecimal notation
and print it as a decimal array, to you use it on OpenSCAD (which doesn't
support hexadecimal notation).
- **default_parameters**: a file containing default parameters, then you can
modify them when you code without to be worried about publishing the file
containing test parameters)

#### Blender script
This script allows you to simulate the sun shinning on the sundial.
Watch [the video](simulation) of a simulation, rendered with it.
Read [README](blender_readme) to know how to use it.

#### Known bugs
If you compile a sundial with a lots of digits, it may be that you get CGal
warnings. You can increase the value of parameters *Tun off rendering at* and
*cache size* in the OpenSCAD preference window.

Please send me issues and pull requests from GitHub!

## To come

- pixel-art display support, by editing images on a web interface;
- a video of the sundial in action (I am waiting for the sun);
- any suggested feature! ;-)

Please contact me for features or bug requests!

[mojo_website]: www.mojoptix.com
[mojo_thingiverse]: www.thingiverse.com/thing:1068443
[mojo_podcast]: www.mojoptix.com/2015/10/25/mojoptix-001-digital-sundial
[TOUL]: http://www.thingiverse.com/thing:202724
[simulation]: https://www.youtube.com/watch?v=YztbfwrANII&feature=youtu.be
[quick_fox]: http://www.thingiverse.com/download:1956136
[clock]: http://www.thingiverse.com/download:1956139
[numbers]: http://www.thingiverse.com/download:1956175
[github_repo]: https://github.com/roipoussiere/Customizable-Digital-Sundial
[blender_readme]: https://github.com/roipoussiere/Customizable-Digital-Sundial
3 changes: 3 additions & 0 deletions blender/Keyframes_parameters.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
STL x,STL y,STL z,STL rot x,STL rot y,STL rot z,Camera x,Camera y,Camera z,Camera rot x,Camera rot y,Camera rot z,latitude,longitude,UTC zone,year,day of year,time,DST,frame number
0,0,0,0,0,0,3,3,2,65,0,115,45,-120,8,2016,245,8,1,1
0,0,0,0,0,0,3,3,2,65,0,115,45,-120,8,2016,245,17,1,400
33 changes: 33 additions & 0 deletions blender/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# How to render sun simulations

## 1. Download Blender
[Here](https://www.blender.org/download/). You need a recent version (>= 2.76)

## 2. Install the addon
- Download the [Sun position addon](http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/Sun_Position);
- On Blender, go to *File*, *preferences*, *Addon* tab;
- Click on *install from file* on the bottom and select the addon ;
- Then check it on the addons list, save user settings and exit the window.

## 3. Enable and configure the addon
- On the right panel, select *world view* (small rounded icon);
- On the *Sun position* tab (on the bottom), click *Enable*;
- Then click on the calendar icon to display the days numbers;

## 4. Launching the script
- Select the *Text editor* editor type, by clicking on the small icon on the bottom-left corner;
- Click on the button *Text*, then *Open text block* then select the python script in the repository
(*Customizable-Digital-Sundial/blender/sundial_simulator.py*);
- Save your Blender scene where you want;
- Click on *Run script*
- You can eventually edit *Scene_parameters.txt* and *Keyframes_parameters.csv*
to place correctly the sundial and the camera, then run the script again.

## 5. Rendering
- On the right panel, select the *Render view* (camera icon);
- On the *Output* tab, chose a destination folder and the video encoding.
Select a low resolution first, to check the sundial and camera positions;
- On the *Render* tab, click on *Animation*;
- Edit eventually *Scene_parameters.txt* and *Keyframes_parameters.csv*
to place correctly the sundial and the camera, then run the script again;
- Choose a high resolution and render the scene again.
11 changes: 11 additions & 0 deletions blender/Scene_parameters.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Parameters]
STL_filename = sundial.stl
STL_scale_x = 0.01
STL_scale_y = 0.01
STL_scale_z = 0.01
STL_position_x = 0
STL_position_y = 0
STL_position_z = 0.1
STL_rotation_x = 0
STL_rotation_y = -45
STL_rotation_z = 90
Loading

0 comments on commit 936a5a3

Please sign in to comment.