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.
New in version 1.2.
- classmethod alloc()¶
- Returns:
the newly allocated
Graphene.Box
structure. 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.
New in version 1.2.
- classmethod empty()¶
- Returns:
- Return type:
A degenerate
Graphene.Box
that can only be expanded.The returned value is owned by Graphene and should not be modified or freed.
New in version 1.2.
- classmethod infinite()¶
- Returns:
- Return type:
A degenerate
Graphene.Box
that cannot be expanded.The returned value is owned by Graphene and should not be modified or freed.
New in version 1.2.
- classmethod minus_one()¶
- Returns:
- Return type:
A
Graphene.Box
with 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.
New in version 1.2.
- classmethod one()¶
- Returns:
- Return type:
A
Graphene.Box
with 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.
New in version 1.2.
- classmethod one_minus_one()¶
- Returns:
- Return type:
A
Graphene.Box
with 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.
New in version 1.2.
- classmethod zero()¶
- Returns:
- Return type:
A
Graphene.Box
with 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.
New in version 1.2.
- contains_box(b)¶
- Parameters:
b (
Graphene.Box
) – aGraphene.Box
- Returns:
true
if the box is contained in the given box- Return type:
Checks whether the
Graphene.Box
self contains the givenGraphene.Box
b.New in version 1.2.
- contains_point(point)¶
- Parameters:
point (
Graphene.Point3D
) – the coordinates to check- Returns:
true
if the point is contained in the given box- Return type:
Checks whether self contains the given point.
New in version 1.2.
- equal(b)¶
- Parameters:
b (
Graphene.Box
) – aGraphene.Box
- Returns:
true
if the boxes are equal- Return type:
Checks whether the two given boxes are equal.
New 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.
New 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.Box
will grow; if scalar is negative, theGraphene.Box
will shrink.New 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.
New in version 1.2.
- free()¶
Frees the resources allocated by
Graphene.Box.alloc
().New in version 1.2.
- get_bounding_sphere()¶
- Returns:
return location for the bounding sphere
- Return type:
sphere:
Graphene.Sphere
Computes the bounding
Graphene.Sphere
capable of containing the givenGraphene.Box
.New 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
.New in version 1.2.
- get_depth()¶
- Returns:
the depth of the box
- Return type:
Retrieves the size of the self on the Z axis.
New in version 1.2.
- get_height()¶
- Returns:
the height of the box
- Return type:
Retrieves the size of the self on the Y axis.
New 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
.New 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
.New 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.
New 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
.New in version 1.2.
- get_width()¶
- Returns:
the width of the box
- Return type:
Retrieves the size of the self on the X axis.
New in version 1.2.
- init(min, max)¶
- Parameters:
min (
Graphene.Point3D
orNone
) – the coordinates of the minimum vertexmax (
Graphene.Point3D
orNone
) – the coordinates of the maximum vertex
- Returns:
the initialized
Graphene.Box
- Return type:
Initializes the given
Graphene.Box
with two vertices.New 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.Box
with the vertices of anotherGraphene.Box
.New 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.Box
with the given array of vertices.If n_points is 0, the returned box is initialized with
Graphene.Box.empty
().New in version 1.2.
- init_from_vec3(min, max)¶
- Parameters:
min (
Graphene.Vec3
orNone
) – the coordinates of the minimum vertexmax (
Graphene.Vec3
orNone
) – the coordinates of the maximum vertex
- Returns:
the initialized
Graphene.Box
- Return type:
Initializes the given
Graphene.Box
with two vertices stored insideGraphene.Vec3
.New 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.Box
with the given array of vertices.If n_vectors is 0, the returned box is initialized with
Graphene.Box.empty
().New 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
().New 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
.New in version 1.2.