mpacts.geometrygenerators. pointgenerators

In order to be able to use this module import it like this:

import mpacts.geometrygenerators.pointgenerators
#or assign it to a shorter name
import mpacts.geometrygenerators.pointgenerators as poi
mpacts.geometrygenerators.pointgenerators.Check_safety_margins_set_Nadjusted(Vol, rpshere, N)
mpacts.geometrygenerators.pointgenerators.create_evenly_spaced_in_box(boxsize, resolution, x0, randomness=0, shell=False)
mpacts.geometrygenerators.pointgenerators.find_closest_partners(nodes_in, nodes_ex=None, N=6, N_nodes_ex=0)

Finds the ‘N’ closest connections between all 3D points including connections to potential ‘external’ or ‘cortex’ points. parameters: nodes_in numpy array of points to connect nodes_ex potential numpy array of additional external nodes N number of connections per node N_nodes_ex (fixed) number of connection between nodes from nodes_in and nodes_ex

returns:
numpy array with indices referring to (a concatenation of external and) the points to connect.
mpacts.geometrygenerators.pointgenerators.find_closest_partners_old(nodes_in, nodes_ex=None, N=6)

Finds the ‘N’ closest connections between all 3D points including connections to potential ‘external’ or ‘cortex’ points. parameters: nodes_in numpy array of points to connect nodes_ex potential numpy array of additional external nodes N number of connections per node

returns:
numpy array with indices referring to (a concatenation of external and) the points to connect.
mpacts.geometrygenerators.pointgenerators.find_closest_partners_spatial(nodes_in, nodes_ex=None, N=6, N_nodes_ex=0)

Finds the ‘N’ closest connections between all 3D points including connections to potential ‘external’ or ‘cortex’ points. parameters: nodes_in numpy array of points to connect nodes_ex potential numpy array of additional external nodes N number of connections per node N_nodes_ex (fixed) number of connection between nodes from nodes_in and nodes_ex

returns:
numpy array with indices referring to (a concatenation of external and) the points to connect.
mpacts.geometrygenerators.pointgenerators.find_closest_trio(nodes_in, nodes_ex=None, N=6)

Finds the ‘N’ closest connections between all 3D points including connections to potential ‘external’ or ‘cortex’ points. parameters: nodes_in numpy array of points to connect nodes_ex potential numpy array of additional external nodes N number of connections per node

returns:
numpy array with indices referring to (a concatenation of external and) the points to connect.
mpacts.geometrygenerators.pointgenerators.find_from_distance(nodes, N=6, minimum_distance=0, maximum_distance=2, exclude=None)

Finds the ‘N’ closest connections between all 3D points including connections to potential ‘external’ or ‘cortex’ points. parameters: nodes_in numpy array of points to connect nodes_ex potential numpy array of additional external nodes N number of connections per node

returns:
numpy array with indices referring to (a concatenation of external and) the points to connect.
mpacts.geometrygenerators.pointgenerators.find_random_partners(nodes_in, nodes_ex=None, N=50)
mpacts.geometrygenerators.pointgenerators.hexagonal_lattice(distance, n)

generates one layer in a hexagonal lattice distance = distance between two points n = number of points in one direction

mpacts.geometrygenerators.pointgenerators.hexagonal_lattice_in_rectangle(distance, N, crop_xtop=False)

generates a perfect hexagonal lattice in a rectangle. N is a tuple (Nx,Nz) with the number of points in the lattice. Note: the number of rows in x will be: Nx

the number of rows in z will be: 2*Nz - 1 (!!!) Hence, the total number of points will be: Nx * (2*Nz-1) the x length of the lattice will be: (Nx-1) * distance the z length of the lattice will be: sqrt(3) * (Nz-1) * distance ~ 1.73 * (Nz-1) * distance

The reason we do not provide the option to specify the dimensions as an input parameter is that we could then not guarentee both the dimensions and the undisturbed hexagonal structure with equilateral triangles.

mpacts.geometrygenerators.pointgenerators.norm_sq(a)

squared norm of a vector a (assumed to be a numpy array)

mpacts.geometrygenerators.pointgenerators.pick_point_on_unit_sphere()

Correct sphere-point-picking...

mpacts.geometrygenerators.pointgenerators.random_points_beam(xmin, xmax, N)
mpacts.geometrygenerators.pointgenerators.random_points_sphere(x, r, N)
mpacts.geometrygenerators.pointgenerators.safe_radius_volume_fill(Vol, N, safety_factor=0.05)

calculates a safe radius for N spheres which should fit into volume Vol with our standard safety-factor

mpacts.geometrygenerators.pointgenerators.spheres_in_cone(N, rsphere, rbase, hcone, rtip=0.0, center=(0, 0, 0), maxiter=1000.0, write_vtp=False, verbose=False, max_fit_time=-1)
mpacts.geometrygenerators.pointgenerators.spheres_in_cone_HighNumber(N, rsphere, rbase, hcone, rtip=0.0, center=(0, 0, 0), verbose=False)
mpacts.geometrygenerators.pointgenerators.spheres_in_cube(N=10, X=1, Y=None, Z=None, r=0.1, return_max_found=False)

Randomly fill a beam (‘cube’) with spheres. parameters: N number of spheres A, B, C dimensions of the ‘cube’ (if only A is given, it will be a cube!) r radius of spheres return_max_found if True, will not return N but the maximal number that could be found in the cube

mpacts.geometrygenerators.pointgenerators.spheres_in_cube_HighNumber(N=10.0, X=1.0, Y=None, Z=None, rsphere=0.1, verbose=False, return_max_found=False)

Randomly fill a beam (‘cube’) with spheres. parameters: N number of spheres A, B, C dimensions of the ‘cube’ (if only A is given, it will be a cube!) r radius of spheres return_max_found if True, will not return N but the maximal number that could be found in the cube Good for High number of N whilst low packing (big difference in volume)

mpacts.geometrygenerators.pointgenerators.spheres_in_cylinder(N, rsphere, rcyl, hcyl, base=(0, 0, 0), rstd=0.0, maxiter=1000.0, verbose=False, quadraticDensity=False, rel_batch_size=0.4, safety_margin=1.001, verify=False, write_vtp=False)
mpacts.geometrygenerators.pointgenerators.spheres_in_cylinder_HighNumber(N, rsphere, rcyl, hcyl, center=(0, 0, 0), verbose=False)
mpacts.geometrygenerators.pointgenerators.spheres_in_disk(N, rsphere, rdisk, center=(0, 0, 0), maxiter=1000.0, write_vtp=False, verbose=False, max_fit_time=-1)
mpacts.geometrygenerators.pointgenerators.spheres_in_ring(R, N, center, axis)
mpacts.geometrygenerators.pointgenerators.spheres_in_sphere(N=10, R=1, r=0.1, r_in=0, pos_in=array([0, 0, 0]))

Randomly draws spheres which fit within a bigger sphere (or on its surface!) Parameters: N number of spheres R radius big sphere r radius small spheres r_in possible internal excluded sphere pos_in possible position of internal excluded sphere

mpacts.geometrygenerators.pointgenerators.spheres_on_sphere(N, R, r)