An onion

This structure is generated using the Onion class

Structural features

  1. \(\mathbf{T}\) is an vector which contains the thickness (\(r_\text{outer}- r_\text{inner}\)) of each shell, starting from the core. The core’s thickness is its radius (see schematic below).

  2. \(\mathbf{d}\) is an vector which contains each shell’s density of scatters. Each density is represented in scatters (points) per unit volume.

Schematic (Cross section)

_images/onion_schematic.png

The design of a uniform onion’s cross section

Generation

We use a similar method employed with the uniform sphere, but rather for each shell.

For each \(t_i \in \mathbf{T}\), the inner radius is \(r_{\text{inner}, i} = \sum_{n=0}^{i} t_n\) (the sum of all previous thicknesses) while the outer radius is \(r_{\text{outer}, i} = r_{\text{inner}, i} + t_i\). The inner radius of the core is \(0\), which is why the thickness is just the radius of the core.

Now, generate a uniform box \(U_{box, i}\) inside the bounded box surrounding the current shell \(i\), \([-r_{\text{outer}, i}, r_{\text{outer}, i}]^3\), with density \(d_i \in \mathbf{d}\). Similar to the sphere, \(N = t_i d_i\)

Instead of keeping each point \(\mathbf{v} \in \mathbb{R}^3\) inside \(U_{box, i}\) with the previous method, only keep the points if each vector \(\mathbf{v}\) satisfies \(r_{inner, i} \le \Vert \mathbf{v} \Vert \le r_{outer, i}\).

Essentially, we are only keeping points within the given shell (outer and inner radius). This allows for multiple thicknesses and densities.

Example

_images/onion_example.png

Cross-section of three onions with a varying amount of thickness, densities, and shells

These images demonstrate how certain onions will look like based on their shell count. The cross section showcases their densities, which is similar to that of the sphere

Code

Generate an onion