|  | 
| procedure | initialize (shape) | 
|  | Initialize the shape. 
 | 
|  | 
| procedure | copy (shape, copy) | 
|  | Copy the shape. 
 | 
|  | 
| procedure | is_inside (shape, point) | 
|  | Check if a point lies inside the shape. 
 | 
|  | 
| procedure | get_samples_inside (shape, i, j, k, n, n_samples, samples) | 
|  | Check if a given number of point lies in a shape. 
 | 
|  | 
| procedure | get_distance (shape, point, distance, direction) | 
|  | Compute the distance and the direction from a point to the shape. 
 | 
|  | 
| procedure | ray_trace (shape, ray, has_normal, intersection_list) | 
|  | Compute the intersection between the shape and a ray. 
 | 
|  | 
| procedure(abs_initialize_shape), deferred | initialize (shape) | 
|  | Initialize the shape. 
 | 
|  | 
| procedure(abs_copy_shape), deferred | copy (shape, copy) | 
|  | Copy the shape. 
 | 
|  | 
| procedure(abs_shape_is_inside), deferred | is_inside (shape, point) | 
|  | Check if a point lies inside the shape. 
 | 
|  | 
| procedure(abs_shape_get_samples_inside), deferred | get_samples_inside (shape, i, j, k, n, n_samples, samples) | 
|  | Check if a given number of point lies in a shape. 
 | 
|  | 
| procedure(abs_shape_get_distance), deferred | get_distance (shape, point, distance, direction) | 
|  | Compute the distance and the direction from a point to the shape. 
 | 
|  | 
| procedure(abs_shape_ray_trace), deferred | ray_trace (shape, ray, has_normal, intersection_list) | 
|  | Compute the intersection between the shape and a ray. 
 | 
|  | 
|  | 
| type(t_polyhedron) | mesh | 
|  | Surface mesh stored as a polyhedron. 
 | 
|  | 
| type(t_distance_list), dimension(:,:), allocatable | z_buffer | 
|  | List of z-buffers used for sampling. 
 | 
|  | 
| type(t_octree) | octree | 
|  | Octree of the mesh. 
 | 
|  | 
| double precision, dimension(3, 2) | bounding_box | 
|  | Aligned-axis bounding box. 
 | 
|  | 
| double precision, dimension(3) | thickness | 
|  | Thickness of the shape. 
 | 
|  | 
| integer | n_samples = -1 | 
|  | Backup of samples number used for the rasterization. 
 | 
|  | 
| integer | dimension = 2 | 
|  | Dimension of the shape. 
 | 
|  | 
| type(t_cg_transformation) | transformation | 
|  | Transformation matrix. 
 | 
|  | 
| logical | is_reversed = .false. | 
|  | Swap interior/exterior sides of the shape. 
 | 
|  | 
      
        
          | procedure mod_shape_surface_mesh::t_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 ) | 
      
 
Check if a given number of point lies in a shape. 
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
  !!      ┏━━━━━━━┓       ×━━━×━━━×       ×━×━×━×━×
  !!      ┃       ┃       ┃       ┃       × × × × ×
  !!      ┃   ×   ┃       ×   ×   ×       × × × × ×    ...
  !!      ┃       ┃       ┃       ┃       × × × × ×
  !!      ┗━━━━━━━┛       ×━━━×━━━×       ×━×━×━×━×
  !! 
- Parameters
- 
  
    | [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 |