Data Types | |
type | mod_shape_surface_mesh::t_distance_list |
Distance list Store distances. Act as a z-buffer. More... | |
type | mod_shape_surface_mesh::t_shape_surface_mesh |
Surface mesh shape. More... | |
Functions/Subroutines | |
subroutine | mod_shape_surface_mesh::copy_shape_surface_mesh (shape, copy) |
Copy the surface mesh. More... | |
subroutine | mod_shape_surface_mesh::shape_surface_mesh_get_samples_inside (shape, i, j, k, n, n_samples, samples) |
Check if a given number of point lies in a surface mesh. More... | |
pure subroutine | mod_shape_surface_mesh::shape_surface_mesh_get_distance (shape, point, distance, direction) |
Compute the signed distance and the signed direction from a point to the surface mesh. More... | |
subroutine mod_shape_surface_mesh::copy_shape_surface_mesh | ( | class(t_shape_surface_mesh), intent(in) | shape, |
class(t_shape), allocatable | copy | ||
) |
[in] | shape | surface mesh shape |
[out] | copy | copied surface mesh shape |
pure subroutine mod_shape_surface_mesh::shape_surface_mesh_get_distance | ( | class(t_shape_surface_mesh), intent(in) | shape, |
double precision, dimension(3), intent(in) | point, | ||
double precision, intent(out) | distance, | ||
double precision, dimension(3), intent(out) | direction | ||
) |
If the point lies inside the surface mesh, the distance is negative and the direction points to the closest point on the surface mesh. If the point lies outiside the surface mesh, the distance is positive and the direction points in the opposite direction to the closest point on the surface mesh.
[in] | shape | surface mesh shape |
[in] | point | any point |
[out] | distance | signed closest distance from the point to the surface mesh |
[out] | direction | signed direction from the point to the closest point on the surface mesh |
subroutine mod_shape_surface_mesh::shape_surface_mesh_get_samples_inside | ( | class(t_shape_surface_mesh), intent(inout) | shape, |
integer, intent(in) | i, | ||
integer, intent(in) | j, | ||
integer, intent(in) | k, | ||
integer, intent(in) | n, | ||
integer, intent(in) | n_samples, | ||
integer, dimension(:,:,:), intent(inout) | samples | ||
) |
Sample a cell of coordinates (i
,j
,k
) with (2*n_samples+1)^d samples, where d denotes the dimension of the cell. Return a integer array samples
containing the value n
where the sample is inside the shape.
n_samples
is called the sampling level and can take its value in range [0,∞].
Example of sampling for various sampling level:
n_samples = 0 n_samples = 1 n_samples = 2 ┏━━━━━━━┓ ×━━━×━━━× ×━×━×━×━× ┃ ┃ ┃ ┃ × × × × × ┃ × ┃ × × × × × × × × ... ┃ ┃ ┃ ┃ × × × × × ┗━━━━━━━┛ ×━━━×━━━× ×━×━×━×━×
[in,out] | shape | surface mesh shape |
[in] | i,j,k | coordinates of the cell |
[in] | n | value to put where the sample is inside the surface mesh |
[in] | n_samples | sampling level (see description) |
[in,out] | samples | array of the (2*n_sammples+1)^d samples |