Sphere#
Added in version 1.2.
- class Sphere(*args, **kwargs)#
A sphere, represented by its center and radius.
Constructors#
Methods#
- class Sphere
- contains_point(point: Point3D) bool #
Checks whether the given
point
is contained in the volume of aSphere
.Added in version 1.2.
- Parameters:
point – a
Point3D
- distance(point: Point3D) float #
Computes the distance of the given
point
from the surface of aSphere
.Added in version 1.2.
- Parameters:
point – a
Point3D
- equal(b: Sphere) bool #
Checks whether two
Sphere
are equal.Added in version 1.2.
- Parameters:
b – a
Sphere
- get_bounding_box() Box #
Computes the bounding box capable of containing the given
Sphere
.Added in version 1.2.
- init(center: Point3D | None, radius: float) Sphere #
Initializes the given
Sphere
with the givencenter
andradius
.Added in version 1.2.
- Parameters:
center – the coordinates of the center of the sphere, or
None
for a center in (0, 0, 0)radius – the radius of the sphere
- init_from_points(points: list[Point3D], center: Point3D | None = None) Sphere #
Initializes the given
Sphere
using 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.
- Parameters:
points – an array of
Point3D
center – the center of the sphere
- init_from_vectors(vectors: list[Vec3], center: Point3D | None = None) Sphere #
Initializes the given
Sphere
using 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.
- Parameters:
vectors – an array of
Vec3
center – the center of the sphere