Geometries library

Geometries is a small module allowing to discretize primitives in small cubes that can be later used in the DDA. The two primitives that are proposed are a sphere and a cube. Note that the discretization of the sphere implements super sampling anti-aliasing (see Wikipedia page for anti-aliasing or the PS sphere example).

Functions Documentation

Main.CoupledElectricMagneticDipoles.Geometries.discretize_sphereFunction
discretize_sphere(a,N;N_sub=10)

Discretizes the volume of a sphere of radius a in small cubes of edge dx=2*a/N. N_sub is a parameter to set the super sampling anti-aliasing accuracy of the discretization. It is by default set to 10. Let $N_d$ be the obtained number of cubes, the output is a tuple with an $N_d \times 4$ array containing the 3D position of the centers of the cubes (first three entries) and their filling fraction (fourth entry), as well as the size of the edge of the cubes dx.

source
Main.CoupledElectricMagneticDipoles.Geometries.discretize_cubeMethod
discretize_cube(L,N)

Discretizes the volume of a cube of edge L in small cubes of edge dx=L/N. Let $N_d$ be the obtained number of cubes, the output is a tuple with an $N_d \times 4$ array containing the 3D position of the centers of the cubes (first three entries) and their filling fraction (fourth entry), as well as the size of the edge of the cubes dx.

source