version 0.6.0
Loading...
Searching...
No Matches

Sparse octree More...

Data Types

type  mod_cg3_octree::t_octree_node
 Definition of an octree node. More...
 
type  mod_cg3_octree::t_octree
 Definition of a sparse octree. More...
 

Functions/Subroutines

pure subroutine, public mod_cg3_octree::cg3_create_octree_from_polyhedron (octree, polyhedron)
 Create an octree from a polyhedron.
 
logical pure function, public mod_cg3_octree::cg3_is_point_inside_octree (octree, point)
 Determine if a point lies inside the octree.
 
pure subroutine, public mod_cg3_octree::cg3_octree_direction_intersection (octree, origin, direction, nb_objects, object_list)
 Intersection of an octree with a directional ray.
 
pure subroutine, public mod_cg3_octree::cg3_octree_ray_intersection (octree, ray, nb_objects, object_list)
 Intersection of an octree with a ray.
 
pure subroutine, public mod_cg3_octree::cg3_octree_get_closest_objects (octree, point, nb_objects, object_list)
 Find the closest objects to a given point.
 
subroutine, public mod_cg3_octree::cg3_octree_write_vtk_file (octree, filename)
 Write the sparse octree to a VTK file.
 

Detailed Description

Sparse octree

Example of a valid sparse octree:

!!     ┌───────┬───┬───┐
!!     │       │   │   │     ┌┐
!!     │       ├───┼─┬─┤     ││: full nodes
!!     │       │   ├─┼─┤     └┘
!!     ├───────╆━━━┷━┷━┪     ┏┓
!!     │       ┃       ┃     ┃┃: empty nodes
!!     │       ┡━┳━┳━━━┩     ┗┛
!!     │       ┢━┛ ┃   │
!!     └───────┺━━━┹───┘
!! 

Empty leaves are pruned from the tree

Function/Subroutine Documentation

◆ cg3_create_octree_from_polyhedron()

pure subroutine, public mod_cg3_octree::cg3_create_octree_from_polyhedron ( type(t_octree), intent(out) octree,
type(t_polyhedron), intent(in) polyhedron )
Parameters
[out]octreeoctree
[in]polyhedronany polyhedron

◆ cg3_is_point_inside_octree()

logical pure function, public mod_cg3_octree::cg3_is_point_inside_octree ( type(t_octree), intent(in) octree,
double precision, dimension(3), intent(in) point )
Parameters
[in]octreeoctree
[in]pointany point
Returns
return .true. if the point is inside the octree

◆ cg3_octree_direction_intersection()

pure subroutine, public mod_cg3_octree::cg3_octree_direction_intersection ( type(t_octree), intent(in) octree,
double precision, dimension(3), intent(in) origin,
integer, intent(in) direction,
integer, intent(out) nb_objects,
integer, dimension(:), intent(out), allocatable object_list )

Get a list of object that lie in intersected leaves. The ray point to positive values of the given direction.

Parameters
[in]octreeoctree
[in]originorigin of the directional ray
[in]directionaxis of the ray
[out]nb_objectsnumber of objects in intersected leaves
[out]object_listlist of objects in intersected leaves

◆ cg3_octree_get_closest_objects()

pure subroutine, public mod_cg3_octree::cg3_octree_get_closest_objects ( type(t_octree), intent(in) octree,
double precision, dimension(3), intent(in) point,
integer, intent(out) nb_objects,
integer, dimension(:), intent(out), allocatable object_list )

Get a list of object that lie in closest leaves.

Parameters
[in]octreeoctree
[in]pointany point
[out]nb_objectsnumber of objects in closest leaves
[out]object_listlist of objects in closest leaves

◆ cg3_octree_ray_intersection()

pure subroutine, public mod_cg3_octree::cg3_octree_ray_intersection ( type(t_octree), intent(in) octree,
type(t_ray), intent(in) ray,
integer, intent(out) nb_objects,
integer, dimension(:), intent(out), allocatable object_list )

Get a list of object that lie in intersected leaves.

Parameters
[in]octreeoctree
[in]rayray
[out]nb_objectsnumber of objects in intersected leaves
[out]object_listlist of objects in intersected leaves

◆ cg3_octree_write_vtk_file()

subroutine, public mod_cg3_octree::cg3_octree_write_vtk_file ( type(t_octree), intent(in) octree,
character(len=*), intent(in) filename )
Parameters
[in]octreeoctree
[in]filenameVTK file name (with extension)