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
pointis 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
pointfrom the surface of aSphere.Added in version 1.2.
- Parameters:
point – a
Point3D
- equal(b: Sphere) bool#
Checks whether two
Sphereare 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
Spherewith the givencenterandradius.Added in version 1.2.
- Parameters:
center – the coordinates of the center of the sphere, or
Nonefor 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
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.
- Parameters:
points – an array of
Point3Dcenter – the center of the sphere
- init_from_vectors(vectors: list[Vec3], center: Point3D | None = None) Sphere#
Initializes the given
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.
- Parameters:
vectors – an array of
Vec3center – the center of the sphere