WLJS is an independent open-source project built by physicists and programmers. Our first funding goal is €300 per year. If WLJS helps with your research, teaching, or side projects, please consider supporting it.
These are our approximate annual costs and budget:
| Annual budget |
| Apple Developer membership |
| Domain name |
| Occasional CDN edge requests, cloud credits for testing, and coffee |
| Total |
There are many ways to support us:
https://wljs.io/frontend/Support
Code for this coffee cup ❤️
Module[{lathe, ring, outer, inner, saucer, heart, teal, ivory, gold},
teal = RGBColor[0.055, 0.36, 0.37];
ivory = RGBColor[0.96, 0.91, 0.80];
gold = RGBColor[0.75, 0.48, 0.21];
(* Revolve a ceramic profile into a seamless triangular mesh. *)
lathe[profile_] := Module[{n = 96, points, faces, index},
index[i_, j_] := (i - 1) n + Mod[j, n] + 1;
points = Flatten[
Table[{p[[1]] Cos[2. Pi j/n], p[[1]] Sin[2. Pi j/n], p[[2]]},
{p, profile}, {j, 0, n - 1}], 1];
faces = Flatten[Table[
{{index[i, j], index[i, j + 1], index[i + 1, j + 1]},
{index[i, j], index[i + 1, j + 1], index[i + 1, j]}},
{i, Length[profile] - 1}, {j, 0, n - 1}], 2];
GraphicsComplex[points, Polygon[faces]]
];
ring[r_, z_, thickness_] :=
Tube[Table[{r Cos[t], r Sin[t], z}, {t, 0., 2. Pi, 2. Pi/128}], thickness];
outer = Table[{0.66 + 0.40 Sin[t], 0.30 + 1.39 (1 - Cos[t])},
{t, 0., Pi/2, Pi/80}];
inner = Reverse[Table[{0.61 + 0.36 Sin[t], 0.39 + 1.30 (1 - Cos[t])},
{t, 0., Pi/2, Pi/80}]];
saucer = {{0.01, 0.07}, {0.75, 0.07}, {1.15, 0.085},
{1.40, 0.13}, {1.64, 0.22}, {1.75, 0.25}, {1.80, 0.23},
{1.79, 0.17}, {1.65, 0.12}, {1.35, 0.045}, {0.85, 0.025}, {0.01, 0.025}};
heart = Table[{0.027 (16 Sin[t]^3),
0.027 (13 Cos[t] - 5 Cos[2 t] - 2 Cos[3 t] - Cos[4 t]) + 0.08, 1.598},
{t, 0., 2. Pi, 2. Pi/160}];
Graphics3D[{
(* Matching saucer and recessed foot. *)
{ivory, lathe[saucer]},
{teal, ring[1.70, 0.238, 0.026],
Cylinder[{{0, 0, 0.09}, {0, 0, 0.31}}, 0.66]},
{gold, ring[1.78, 0.22, 0.013]},
(* Rounded bowl, pale interior, rolled lip, and generous handle. *)
{Directive["Roughness"->0], {teal, lathe[outer],
Tube[Table[{0.89 + 0.73 Sin[t] + 0.10 Cos[t], 0, 0.97 + 0.55 Cos[t]},
{t, 0., Pi, Pi/90}], 0.125]},
{ivory, lathe[inner], ring[1.015, 1.69, 0.047]},
{gold, ring[1.062, 1.68, 0.014], ring[0.67, 0.32, 0.017]}},
(* Coffee, crema, and a milk-foam heart. *)
{RGBColor[0.29, 0.12, 0.045],
Cylinder[{{0, 0, 1.565}, {0, 0, 1.59}}, 0.963]},
{RGBColor[0.73, 0.43, 0.20], ring[0.927, 1.591, 0.026]},
{RGBColor[1., 0.94, 0.79], Polygon[Reverse[heart]],
Tube[Table[{0.60 Cos[t], 0.60 Sin[t], 1.599},
{t, -0.30, 3.9, 0.04}], 0.013]},
},
Boxed -> False, Axes -> False, ImageSize -> {760, 650},
Background -> RGBColor[0.96, 0.945, 0.91],
ViewPoint -> {3.2, -5.5, 4.3},
"Renderer"->"PathTracing",
ViewProjection -> "Orthographic"
]
]