*ordered randomness*to my art and jewelry. And we'll design a new piece of generative jewelry!

Before that, let me share something else I've been working on. This June I gave myself a goal to share with the public each day one piece of jewelry I designed. Designing, refining, and posting took some effort, and I have completed my goal! In the process I designed some new jewelry that I really like, and I will be working over the coming months to develop them into coherent jewelry collections. I have been sharing on various social media accounts: @hanusadesign on instagram, facebook, twitter, and pinterest. Be sure to follow me to see my latest work!

Now on to the Mathematica tutorial. What do I mean by ordered randomness? Compare the following sets of 100 random points:

While the points seem rather "random" in both sets, you can see that the points on the left often land rather close to each other while the points on the right are pretty regularly spaced. This last observation should tell you that the points on the right are not actually "random"! Indeed, the points on the left are chosen randomly using Mathematica's RandomReal command. (Even though the numbers are generated by a deterministic process in a computer program and thus inherently not completely random, we will say that pseudorandom is close enough for our purposes.) The command

While[Length[ptlist] < 100,

newpt = RandomReal[{-1, 1}, 2];

If[Min[Map[Norm[newpt - #] &, ptlist]] > .1,

ptlist = Append[ptlist, newpt]]]

## Generative jewelry

Let's take this idea and turn it into a nice piece of generative jewelry, in that we don't actually know what it is going to look like before our program completes!My goal is to create a piece of jewelry that is a collection of overlapping rings. We'll first generate a set of points and then construct rings centered at those points. We will work to complete three tasks to improve the aesthetic appeal of the final product:

- The points should be lie in a circle instead of a square.
- The points should be generously spaced.
- The rings should be different sizes

ptlist = {RandomReal[{-1, 1}, 2]};

While[! RegionMember[shape, ptlist[[1]]],

ptlist = {RandomReal[{-1, 1}, 2]}]

While[Length[ptlist] < 50, newpt = RandomReal[{-1, 1}, 2];

If[Min[Map[Norm[newpt - #] &, ptlist]] > .21

&& RegionMember[shape, newpt],

ptlist = Append[ptlist, newpt]]]

Graphics[{

{Lighter[Blue, .8], Rectangle[{-1, -1}, {1, 1}]},

{EdgeForm[{Black, Thick}], White, shape},

{Purple, Point[ptlist]}

}]

Now we want to build a ring centered at each point. A basic torus that has an outer radius of .14 and tube radius of .03 looks like this:

ParametricPlot3D[{

( thickness + innerradius Cos[v]) Cos[u],

( thickness + innerradius Cos[v]) Sin[u],

innerradius Sin[v]} + Append[coords, 0],

{u, 0, 2 Pi}, {v, 0, 2 Pi}, Mesh -> None, PlotPoints -> 50]];

Now we need to attack Task 3, making the rings have different sizes. To do this we modify our torus function:

ParametricPlot3D[{

( thickness + innerradius Cos[v]) Cos[u],

( thickness + innerradius Cos[v]) Sin[u],

innerradius Sin[v]} + Append[coords, 0],

{u, 0, 2 Pi}, {v, 0, 2 Pi}, Mesh -> None, PlotPoints -> 50]];

Show[MapThread[torus, {ptlist, thicknesses}], PlotRange -> All]

So I modified the the outer radii to be between .09 and .17. I definitely re-ran the code multiple times until I was happy with the final product. Here you go:

Show[MapThread[torus, {ptlist, thicknesses}], PlotRange -> All]

**Pro Tip:**Re-running the code always gives you a new arrangement. When you get a random arrangement that you like, you need to

**save the data**that created it, so you can recreate it next time!

In essence, when working to create a piece of generative art, you impose randomness until you find something that you like, at which time you need to save this input so that this data will not change again — which seems to be the opposite of random! It was a revelation when I realized that adding randomness to my art involved saving the random data I generated.

## The Final Result

After exporting our final work to an STL, here is a rendering of our new piece of generative jewelry on Sketchfab:And Shapeways gives the following beautiful rendering of our pendant in Raw Bronze:

And now you have the tools to make your own! If you have suggestions for how to modify this in an interesting way or for something else I should tackle, let me know. Happy July everyone!

Purchase a copy of this and other 3D printed artwork

at Math Art Shop by Hanusa ≀ Design on Shapeways.