51 n->
bb1[0] = x_min - epsilon;
52 n->
bb2[0] = x_max + epsilon;
53 n->
bb1[1] = y_min - epsilon;
54 n->
bb2[1] = y_max + epsilon;
55 n->
bb1[2] = z_min - epsilon;
56 n->
bb2[2] = z_max + epsilon;
57 real x = (x_max + x_min) / 2;
58 real y = (y_max + y_min) / 2;
59 real z = (z_max + z_min) / 2;
92 if((*node)->n000 != NULL) {
124 if(node->
n000 == NULL) {
165 if(node->
n000 == NULL) {
173 if(p[0] < x && p[1] < y && p[2] < z)
175 if(p[0] > x && p[1] < y && p[2] < z)
177 if(p[0] < x && p[1] > y && p[2] < z)
179 if(p[0] > x && p[1] > y && p[2] < z)
181 if(p[0] < x && p[1] < y && p[2] > z)
183 if(p[0] > x && p[1] < y && p[2] > z)
185 if(p[0] < x && p[1] > y && p[2] > z)
187 if(p[0] > x && p[1] > y && p[2] > z)
Main header file for ASCOT5.
void list_int_create(list_int_node **list)
Create an empty list.
void list_int_free(list_int_node **list)
Deallocate this list and all lists it is linked to.
void list_int_add(list_int_node *list, int data)
Add new node to the end of the chain.
void octree_add(octree_node *node, real t1[3], real t2[3], real t3[3], int id)
Add triangle to the node(s) it belongs to.
void octree_free(octree_node **node)
Free octree node and all its child nodes.
void octree_create(octree_node **node, real x_min, real x_max, real y_min, real y_max, real z_min, real z_max, int depth)
Create octree of given depth.
list_int_node * octree_get(octree_node *node, real p[3])
Get that leaf node's linked list the given coordinate belongs to.
Header file for octree.c.
Linked list node that stores int data.
Struct representing single octree node.
struct octree_node * n100
struct octree_node * n111
struct octree_node * n101
struct octree_node * n110
struct octree_node * n010
struct octree_node * n000
struct octree_node * n001
struct octree_node * n011
int wall_3d_tri_in_cube(real t1[3], real t2[3], real t3[3], real bb1[3], real bb2[3])
Check if any part of a triangle is inside a box.
Header file for wall_3d.c.