Contents
Tags
License
Liked By View All
Give a Shout Out
If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.
Print Thing TagSummary
UPDATE 11/8/15: Customiser's script rendering time limits of around 5 seconds are greatly inhibiting mould and fractal generation. As a result I have uploaded sample STLs instead of running through Customiser and I therefore recommend running the .scad file locally with openSCAD.
Simply download openSCAD (http://www.openscad.org/downloads.html), load the .scad file and press F6 to render models with any variables you like.
FractACastle is a completely customizable generator of sandcastle moulds described by 2D and 3D Julia set fractal patterns. It has never been easer to amaze onlookers with the beauty of mathematics.
The Idea
Fractals are perhaps one of the most strikingly beautiful areas of mathematics. Julia set fractal patterns like those in FractACastle may be generated from quadratic iterations. These iterations, such as z → z^2 + c, describe a process: take a complex number, square it, and add a constant complex number c. Repeating this process iteratively reveals a patterns known as Julia set, consisting of the set of all z on the complex plane such that z → z^2 + c does not diverge exponentially.
Through varying both the real and imaginary component of c, many different beautiful Julia set fractal patterns can be generated. I also conceived of generating 3D Julia set fractals, called capstones, each vertical level of which would be obtained from a higher number of quadratic iterations. The capstones would reveal visually how fractal patterns emerge, and are a great way to teach others about the beauty of complex dynamics.
Implementation
After a little tinkering around, I was eventually able to implement a Julia set fractal generator in openSCAD. This was quite challenging, especially with my fairly limited coding experience. I had to learn how to program at a functional as opposed to objective manner, and work with with the compiletime variables of openSCAD instead of the runtime variables of MATLAB and C. My final generator was achieved through a combination of recursion and pseudocomplex number representation.
The next step was building the fundamental basic designs we all associate with castles: walls, towers and battlements. I also incorporated a text mould generator to enable one to decorate or label their own fractals with text and Unicode characters.
Finally, I reworked and eliminated some of the more troublesome features of my designs for increased printability and easeofuse with wet sand. The towers, for instance, were originally designed with customizable overhang angles, but it was very difficult to incorporate this feature with a sandcastle mould, which must be vertically convex to enable separation of sand from mould.
Result
FractACastle is the ultimate tool for demonstrating mathematical prowess at the beach. One can use large 2D fractal moulds like cookie cutters, leaving rows of fractal patterns in the sand. Threedimensional capstones can be generated, enabling onlookers to better understand the emergence of fractal patterns over successive iterations. Finally, one can combine these fractals with a fully parametric classic castle design to add a new mathematical twist to the timeless art of sandcastles.
Instructions
**Generating fractals and minkowski moulds in openSCAD is quite computationally exhaustive. For this reason, the resolution of fractal and capstone moulds defaults to low values to allow for preliminary rendering. I recommend identifying pretty Julia set pattern seeds with the help of the following website: http://www.easyfractalgenerator.com/juliasetgenerator.aspx. After then getting the fractal sizing right, one can increase fractal resolution for final rendering and STL export.
If a pattern appears on the website but not on the Customizer app, try increasing the “modulus_threshold” variable under the “Fractals” tab.
Final mould renderings may take a few minutes, especially at higher resolutions. If lag on the Thingiverse is becoming unbearable, simply download the .SCAD file and generate models from the desktop.
Very high resolution fractals and capstones may not be generated watertight. This arises from the difficulty in correctly rendering both high and lowresolution fractals in one program. While this may not affect slicing, any nonwatertight models can be repaired freely at https://netfabb.azurewebsites.net/, https://makeprintable.com/, or through desktop programs such as Meshlab or Netfabb**
Castle instructions
 Experiment with different castle heights, top square scales, tower wall thicknesses and battlement cutaway values to generate a castle body.
Note that if one desires to impress fractal patterns on the sides of the castle walls in a completely freestanding manner as shown in the preview, one should try to minimise the slope of these walls. This is most easily achieved through decreasing the height of the castle itself to a value below 7. Don't worry about the positioning of the fractal or text patterns, merely their size, as they will be printed separately.

Change the “I_WantTo” variable to Generate a castle body mould. Actual mould generation may take a minute or two due to the reliance upon minkowski function mould generation. Processing time can be decreased by lowering $fs or running the .scad file locally.

Scale the resultant moulds by a factor of 10 as openSCAD units are in millimetres.
 The moulds can be printed at fairly low resolution, e.g. 0.4mm. With very low bridging speeds and a high number of vertical shells, one may be able to print the model without support. Alternatively, one can try inverting the model and generating support structures for the tops of the nonbattlement sections of the towers. No support will therefore be generated in the mould interior which will not disrupt any sand moulding.
My sandcastles were printed in PLA, with no infill.
 For thick mould walls and airtight prints, one should drill holes at the tops of the towers and through the battlements to enable the sand to easily be separated from the mould.
Fractal instructions

Identify good Julia set fractal seeds using the following website: http://www.easyfractalgenerator.com/juliasetgenerator.aspx.

Under the “Generate a castle body mould” tab, vary fractal_scale_x and fractal_scale_y until the relative sizing of the fractal with respect to the rest of the mould and text is satisfactory. Remember to leave a clearance of 2*mould_width for the mould walls between the towers and the fractal Ignore if printing big fractal moulds for use independent of a castle.

Increase the resolution of whichever fractal is desired, a good value is 80. Change the “I_Want_To” variable to Generate a fractal mould and go make a cup of coffee, as mould generation may now take a minute or two.

If printing big fractals for use independent of a castle, one can now scale the entire model to nearly fill a build plate. One may have to decrease mould_width and rerender the design a few times to get the scaling right.
 Print the fractal. Layer heights of up to and including 0.4mm produced beautiful fractals. I don't recommend any infill for the moulds as they should merely be the walls themselves.
Capstone instructions

Identify good Julia set fractal seeds using the following website: http://www.easyfractalgenerator.com/juliasetgenerator.aspx.

Change the “I_WantTo” variable to Preview a capstone. Enter the fractal seeds identified in step 1 and ensure that the pattern is appearing. Don't worry that the pattern appears extremely pixelated for the moment. Once again, If a pattern appears on the website but not on the Customizer app, try increasing the modulus_threshold variable under the “Fractals” tab.

Change the “capstone_scale_x/y”, “capstone height” and “slices” variables until one is satisfied with the dimensions and overall emergence of the final capstone pattern.

Increase the resolution of the capstone (one good value is 30) and change the “I_Want_To” variable to Generate a capstone mould. Go and make one or even two cups of coffee.
 Print the capstone. Infills of 30% can be used quite freely here. No support should be required. Layer heights are really dependent upon the value of “slices” and size of the capstone, though for large capstones, 0.4mm will do quite nicely.