permaviss.sample_point_clouds.examples

Functions

ball(no_points, radius, dim) Take random points from a ball of a given dimension.
circle(no_points, radius) Take random points from a circle on the plane.
grid(hdiv, vdiv) Take the nodes from a hdiv x vdiv grid on 2D plane.
grid_tridimensional(hdiv, vdiv, ddiv) Take the nodes from a hdiv x vdiv x ddiv grid on 3D space.
random_circle(no_points, radius, epsilon[, …]) Take random points around a circle on the plane.
random_cube(no_points, dim) Take random points from a unit cube around the origin.
random_sphere(no_points, radius, dim) Take random points from a sphere of a given dimension.
take_sample(point_cloud, no_samples) Take a subsample from samples using a minmax algorithm.
torus(div, min_rad, max_rad) Take samples from a torus in 4D space.
torus3D(no_points[, min_rad, max_rad]) Take samples from a torus embedded in 3D space.
permaviss.sample_point_clouds.examples.ball(no_points, radius, dim)[source]

Take random points from a ball of a given dimension. This ball has centre (0, 0, 0).

Parameters:
  • no_points (int) – Number of points wanted.
  • radius (float) – Radius of the ball.
  • dim (int) – Dimension of the ball.
Returns:

Coordinates of sampled points from the ball.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.circle(no_points, radius)[source]

Take random points from a circle on the plane. This circle has centre (0, 0).

Parameters:
  • no_points (int) – Number of points wanted.
  • radius (float) – Radius of the circle.
Returns:

Coordinates of sampled points from the circle.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.grid(hdiv, vdiv)[source]

Take the nodes from a hdiv x vdiv grid on 2D plane.

Parameters:
  • hdiv (int) – Number of rows.
  • vdiv (int) – Number of columns.
Returns:

List of points.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.grid_tridimensional(hdiv, vdiv, ddiv)[source]

Take the nodes from a hdiv x vdiv x ddiv grid on 3D space.

Parameters:
  • hdiv (int) – Number of rows.
  • vdiv (int) – Number of columns.
  • ddiv (int) – Number of flats.
Returns:

List of points.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.random_circle(no_points, radius, epsilon, center=[0, 0])[source]

Take random points around a circle on the plane.

Parameters:
  • no_points (int) – Number of points wanted.
  • radius (float) – Radius of the circle.
  • epsilon (float) – Noise that we want to apply to each sampled point.
  • centre (list(float, float)) – Two entries specifying the position of the centre.
Returns:

Coordinates of sampled points from around the circle.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.random_cube(no_points, dim)[source]

Take random points from a unit cube around the origin. This cube can be of various dimensions.

Parameters:
  • no_points (int) – Number of points wanted.
  • dim (int) – Dimension of the cube.
Returns:

Coordinates of sampled points from the cube.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.random_sphere(no_points, radius, dim)[source]

Take random points from a sphere of a given dimension. This sphere has centre (0, 0, 0).

Parameters:
  • no_points (int) – Number of points wanted.
  • radius (float) – Radius of the sphere.
  • dim (int) – Dimension of the sphere.
Returns:

Coordinates of sampled points from the sphere.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.take_sample(point_cloud, no_samples)[source]

Take a subsample from samples using a minmax algorithm.

We start from a random point. Then choose the point further appart. Next, we take the point that is further appart from the taken points. Continuing we take all the samples from point_cloud.

Parameters:
  • point_cloud (Numpy Array) – List of points to take samples from.
  • np_samples (int) – Number of samples that we want to take. It has to be smaller than the dimension of point_cloud.
Returns:

Matrix storing the coordinates of the sampled points.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.torus(div, min_rad, max_rad)[source]

Take samples from a torus in 4D space.

Parameters:
  • no_points (int) – Number of points to be taken.
  • min_rad (float, default is 1) – Radius of circle on section of the torus.
  • max_rad (float, default is 3) – Distance from the torus centre to the centre of the section.
Returns:

List of points.

Return type:

Numpy Array

permaviss.sample_point_clouds.examples.torus3D(no_points, min_rad=1, max_rad=3)[source]

Take samples from a torus embedded in 3D space.

Parameters:
  • no_points (int) – Number of points to be taken.
  • min_rad (float, default is 1) – Radius of circle on section of the torus.
  • max_rad (float, default is 3) – Distance from the torus centre to the centre of the section.
Returns:

List of points.

Return type:

Numpy Array