Graphene.Box¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
max |
r |
||
min |
r |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Graphene.Box¶
A 3D box, described as the volume between a minimum and a maximum vertices.
Added in version 1.2.
- classmethod alloc()¶
- Returns:
the newly allocated
Graphene.Boxstructure. UseGraphene.Box.free() to free the resources allocated by this function- Return type:
Allocates a new
Graphene.Box.The contents of the returned structure are undefined.
Added in version 1.2.
- classmethod empty()¶
- Returns:
- Return type:
A degenerate
Graphene.Boxthat can only be expanded.The returned value is owned by Graphene and should not be modified or freed.
Added in version 1.2.
- classmethod infinite()¶
- Returns:
- Return type:
A degenerate
Graphene.Boxthat cannot be expanded.The returned value is owned by Graphene and should not be modified or freed.
Added in version 1.2.
- classmethod minus_one()¶
- Returns:
- Return type:
A
Graphene.Boxwith the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (0, 0, 0).The returned value is owned by Graphene and should not be modified or freed.
Added in version 1.2.
- classmethod one()¶
- Returns:
- Return type:
A
Graphene.Boxwith the minimum vertex set at (0, 0, 0) and the maximum vertex set at (1, 1, 1).The returned value is owned by Graphene and should not be modified or freed.
Added in version 1.2.
- classmethod one_minus_one()¶
- Returns:
- Return type:
A
Graphene.Boxwith the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (1, 1, 1).The returned value is owned by Graphene and should not be modified or freed.
Added in version 1.2.
- classmethod zero()¶
- Returns:
- Return type:
A
Graphene.Boxwith both the minimum and maximum vertices set at (0, 0, 0).The returned value is owned by Graphene and should not be modified or freed.
Added in version 1.2.
- contains_box(b)¶
- Parameters:
b (
Graphene.Box) – aGraphene.Box- Returns:
trueif the box is contained in the given box- Return type:
Checks whether the
Graphene.Boxself contains the givenGraphene.Boxb.Added in version 1.2.
- contains_point(point)¶
- Parameters:
point (
Graphene.Point3D) – the coordinates to check- Returns:
trueif the point is contained in the given box- Return type:
Checks whether self contains the given point.
Added in version 1.2.
- equal(b)¶
- Parameters:
b (
Graphene.Box) – aGraphene.Box- Returns:
trueif the boxes are equal- Return type:
Checks whether the two given boxes are equal.
Added in version 1.2.
- expand(point)¶
- Parameters:
point (
Graphene.Point3D) – the coordinates of the point to include- Returns:
return location for the expanded box
- Return type:
res:
Graphene.Box
Expands the dimensions of self to include the coordinates at point.
Added in version 1.2.
- expand_scalar(scalar)¶
- Parameters:
scalar (
float) – a scalar value- Returns:
return location for the expanded box
- Return type:
res:
Graphene.Box
Expands the dimensions of self by the given scalar value.
If scalar is positive, the
Graphene.Boxwill grow; if scalar is negative, theGraphene.Boxwill shrink.Added in version 1.2.
- expand_vec3(vec)¶
- Parameters:
vec (
Graphene.Vec3) – the coordinates of the point to include, as aGraphene.Vec3- Returns:
return location for the expanded box
- Return type:
res:
Graphene.Box
Expands the dimensions of self to include the coordinates of the given vector.
Added in version 1.2.
- free()¶
Frees the resources allocated by
Graphene.Box.alloc().Added in version 1.2.
- get_bounding_sphere()¶
- Returns:
return location for the bounding sphere
- Return type:
sphere:
Graphene.Sphere
Computes the bounding
Graphene.Spherecapable of containing the givenGraphene.Box.Added in version 1.2.
- get_center()¶
- Returns:
return location for the coordinates of the center
- Return type:
center:
Graphene.Point3D
Retrieves the coordinates of the center of a
Graphene.Box.Added in version 1.2.
- get_depth()¶
- Returns:
the depth of the box
- Return type:
Retrieves the size of the self on the Z axis.
Added in version 1.2.
- get_height()¶
- Returns:
the height of the box
- Return type:
Retrieves the size of the self on the Y axis.
Added in version 1.2.
- get_max()¶
- Returns:
return location for the maximum point
- Return type:
max:
Graphene.Point3D
Retrieves the coordinates of the maximum point of the given
Graphene.Box.Added in version 1.2.
- get_min()¶
- Returns:
return location for the minimum point
- Return type:
min:
Graphene.Point3D
Retrieves the coordinates of the minimum point of the given
Graphene.Box.Added in version 1.2.
- get_size()¶
- Returns:
return location for the size
- Return type:
size:
Graphene.Vec3
Retrieves the size of the box on all three axes, and stores it into the given size vector.
Added in version 1.2.
- get_vertices()¶
- Returns:
return location for an array of 8
Graphene.Vec3- Return type:
vertices: [
Graphene.Vec3]
Computes the vertices of the given
Graphene.Box.Added in version 1.2.
- get_width()¶
- Returns:
the width of the box
- Return type:
Retrieves the size of the self on the X axis.
Added in version 1.2.
- init(min, max)¶
- Parameters:
min (
Graphene.Point3DorNone) – the coordinates of the minimum vertexmax (
Graphene.Point3DorNone) – the coordinates of the maximum vertex
- Returns:
the initialized
Graphene.Box- Return type:
Initializes the given
Graphene.Boxwith two vertices.Added in version 1.2.
- init_from_box(src)¶
- Parameters:
src (
Graphene.Box) – aGraphene.Box- Returns:
the initialized
Graphene.Box- Return type:
Initializes the given
Graphene.Boxwith the vertices of anotherGraphene.Box.Added in version 1.2.
- init_from_points(points)¶
- Parameters:
points ([
Graphene.Point3D]) – an array ofGraphene.Point3D- Returns:
the initialized
Graphene.Box- Return type:
Initializes the given
Graphene.Boxwith the given array of vertices.If n_points is 0, the returned box is initialized with
Graphene.Box.empty().Added in version 1.2.
- init_from_vec3(min, max)¶
- Parameters:
min (
Graphene.Vec3orNone) – the coordinates of the minimum vertexmax (
Graphene.Vec3orNone) – the coordinates of the maximum vertex
- Returns:
the initialized
Graphene.Box- Return type:
Initializes the given
Graphene.Boxwith two vertices stored insideGraphene.Vec3.Added in version 1.2.
- init_from_vectors(vectors)¶
- Parameters:
vectors ([
Graphene.Vec3]) – an array ofGraphene.Vec3- Returns:
the initialized
Graphene.Box- Return type:
Initializes the given
Graphene.Boxwith the given array of vertices.If n_vectors is 0, the returned box is initialized with
Graphene.Box.empty().Added in version 1.2.
- intersection(b)¶
- Parameters:
b (
Graphene.Box) – aGraphene.Box- Returns:
true if the two boxes intersect
- res:
return location for the result
- Return type:
(
bool, res:Graphene.Box)
Intersects the two given
Graphene.Box.If the two boxes do not intersect, res will contain a degenerate box initialized with
Graphene.Box.empty().Added in version 1.2.
- union(b)¶
- Parameters:
b (
Graphene.Box) – the box to union to self- Returns:
return location for the result
- Return type:
res:
Graphene.Box
Unions the two given
Graphene.Box.Added in version 1.2.