Graphene.Sphere¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
center |
r |
||
radius |
r |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Graphene.Sphere¶
A sphere, represented by its center and radius.
Added in version 1.2.
- classmethod alloc()¶
- Returns:
the newly allocated
Graphene.Sphere. UseGraphene.Sphere.free() to free the resources allocated by this function- Return type:
Allocates a new
Graphene.Sphere.The contents of the newly allocated structure are undefined.
Added in version 1.2.
- contains_point(point)¶
- Parameters:
point (
Graphene.Point3D) – aGraphene.Point3D- Returns:
trueif the sphere contains the point- Return type:
Checks whether the given point is contained in the volume of a
Graphene.Sphere.Added in version 1.2.
- distance(point)¶
- Parameters:
point (
Graphene.Point3D) – aGraphene.Point3D- Returns:
the distance of the point
- Return type:
Computes the distance of the given point from the surface of a
Graphene.Sphere.Added in version 1.2.
- equal(b)¶
- Parameters:
b (
Graphene.Sphere) – aGraphene.Sphere- Returns:
trueif the spheres are equal- Return type:
Checks whether two
Graphene.Sphereare equal.Added in version 1.2.
- free()¶
Frees the resources allocated by
Graphene.Sphere.alloc().Added in version 1.2.
- get_bounding_box()¶
- Returns:
return location for the bounding box
- Return type:
box:
Graphene.Box
Computes the bounding box capable of containing the given
Graphene.Sphere.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.Sphere.Added in version 1.2.
- get_radius()¶
- Return type:
Retrieves the radius of a
Graphene.Sphere.Added in version 1.2.
- init(center, radius)¶
- Parameters:
center (
Graphene.Point3DorNone) – the coordinates of the center of the sphere, orNonefor a center in (0, 0, 0)radius (
float) – the radius of the sphere
- Returns:
the initialized
Graphene.Sphere- Return type:
Initializes the given
Graphene.Spherewith the given center and radius.Added in version 1.2.
- init_from_points(points, center)¶
- Parameters:
points ([
Graphene.Point3D]) – an array ofGraphene.Point3Dcenter (
Graphene.Point3DorNone) – the center of the sphere
- Returns:
the initialized
Graphene.Sphere- Return type:
Initializes the given
Graphene.Sphereusing the given array of 3D coordinates so that the sphere includes them.The center of the sphere can either be specified, or will be center of the 3D volume that encompasses all points.
Added in version 1.2.
- init_from_vectors(vectors, center)¶
- Parameters:
vectors ([
Graphene.Vec3]) – an array ofGraphene.Vec3center (
Graphene.Point3DorNone) – the center of the sphere
- Returns:
the initialized
Graphene.Sphere- Return type:
Initializes the given
Graphene.Sphereusing the given array of 3D coordinates so that the sphere includes them.The center of the sphere can either be specified, or will be center of the 3D volume that encompasses all vectors.
Added in version 1.2.
- is_empty()¶
- Returns:
trueif the sphere is empty- Return type:
Checks whether the sphere has a zero radius.
Added in version 1.2.
- translate(point)¶
- Parameters:
point (
Graphene.Point3D) – the coordinates of the translation- Returns:
return location for the translated sphere
- Return type:
res:
Graphene.Sphere
Translates the center of the given
Graphene.Sphereusing the point coordinates as the delta of the translation.Added in version 1.2.