Rectangle/rectangular cuboid shape.
More...
|
| 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 rectangle 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.
|
| |
Rectangle/rectangular cuboid shape.
◆ copy()
| procedure mod_shape_basic::t_shape_rectangle::copy |
( |
class(t_shape_rectangle), intent(in) | shape, |
|
|
class(t_shape), allocatable | copy ) |
Copy the shape.
- Parameters
-
| [in] | shape | rectangle shape |
| [out] | copy | copied rectangle |
◆ get_distance()
| procedure mod_shape_basic::t_shape_rectangle::get_distance |
( |
class(t_shape_rectangle), intent(in) | shape, |
|
|
double precision, dimension(3), intent(in) | point, |
|
|
double precision, intent(out) | distance, |
|
|
double precision, dimension(3), intent(out) | direction ) |
Compute the distance and the direction from a point to the shape.
If the point lies inside the rectangle/rectangular cuboid, the distance is negative and the direction points to the closest point on the rectangle/rectangular cuboid. If the point lies outside the rectangle/rectangular cuboid, the distance is positive and the direction points in the opposite direction to the closest point on the rectangle/rectangular cuboid.
- Parameters
-
| [in] | shape | rectangle/rectangular cuboid shape |
| [in] | point | any point |
| [out] | distance | signed closest distance from the point to the rectangle/rectangular cuboid |
| [out] | direction | signed direction from the point to the closest point on the rectangle/rectangular cuboid |
◆ get_samples_inside()
| procedure mod_shape_basic::t_shape_rectangle::get_samples_inside |
( |
class(t_shape_rectangle), 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 | rectangle/rectangular cuboid shape |
| [in] | i,j,k | coordinates of the cell |
| [in] | n | value to put where the sample is inside the rectangle/rectangular cuboid |
| [in] | n_samples | sampling level (see description) |
| [in,out] | samples | array of the (2*n_samples+1)^d samples |
◆ initialize()
| procedure mod_shape_basic::t_shape_rectangle::initialize |
( |
class(t_shape_rectangle), intent(inout) | shape | ) |
|
Initialize the shape.
- Parameters
-
| [in,out] | shape | rectangle shape |
◆ is_inside()
| procedure mod_shape_basic::t_shape_rectangle::is_inside |
( |
class(t_shape_rectangle), intent(in) | shape, |
|
|
double precision, dimension(3), intent(in) | point ) |
Check if a point lies inside the shape.
- Parameters
-
| [in] | shape | rectangle/rectangular cuboid shape |
| [in] | point | any point |
◆ ray_trace()
| procedure mod_shape_basic::t_shape_rectangle::ray_trace |
( |
class(t_shape_rectangle), intent(in) | shape, |
|
|
type(t_ray), intent(in) | ray, |
|
|
logical, intent(in) | has_normal, |
|
|
type(t_intersection_list), intent(inout) | intersection_list ) |
Compute the intersection between the rectangle and a ray.
- Parameters
-
| [in] | shape | rectangle shape |
| [in] | ray | ray to intersect the rectangle |
| [in] | has_normal | list of intersections between the ray and the rectangle |
| [in,out] | intersection_list | list of intersections between the ray and the rectangle |
◆ corner_max
| double precision, dimension(3) mod_shape_basic::t_shape_rectangle::corner_max = 0d0 |
Maximal coordinates of the the rectangle shape.
◆ corner_min
| double precision, dimension(3) mod_shape_basic::t_shape_rectangle::corner_min = 0d0 |
Minimal coordinates of the the rectangle shape.
The documentation for this type was generated from the following file: