A sphere
Structural features
\(R\) is the radius of the sphere
\(\rho\) is the density of scatters in scatters (points) per unit volume.
Schematic
The illustration of the uniform sphere
Structure Generation
We can generate a uniform sphere by sampling a uniform distribution in the box around it, then only including certain scatters.
Define the bounding box
We frequently use a cube surrounding the sphere. The cube is mathematically defined by the bounding box in range \(B = [-R, R]^3\)
Find the number of points
We first calculate the number of points that would correspond to the density in the cube volume: \((2R)^3 \rho = 8R^3\rho\). Since \(N\) must be an integer, we take the floor of this value to obtain \(N = \lfloor 8R^3\rho \rfloor\).
Generate the uniform points in the sphere
First, we generate a uniform distribution \(U_{box}\) of scatters within \(B\) with \(N\) points
Then we only include scatters that are inside the cube to \(U_{sphere}\). Each vector \(\mathbf{v} = (x, y, z)\) in the distribution must satisfy \(\Vert \mathbf{v} \Vert \le R\).
Example
Three examples of uniform spheres, with different densities and radii.
The example above showcases different parameters used to generate these spheres. The left image contains densely clustered scatters due to its high density, while the right image contains spread out scatters due to its lower density.
This structure is generated using the Ellipsoid class, with \(a = c\)