py3dtiles.tileset.bounding_volume module#

class py3dtiles.tileset.bounding_volume.BoundingVolume[source]#

Bases: RootProperty[_BoundingVolumeJsonDictT], Generic[_BoundingVolumeJsonDictT]

Abstract class used as interface for box, region and sphere.

abstract add(other: BoundingVolume[Any]) None[source]#

Compute the ‘canonical’ bounding volume fitting this bounding volume together with the added bounding volume. The computed fitting bounding volume is generically not the smallest one (due to its alignment with the coordinate axis).

Parameters:

other – another bounding volume to be added with this one

abstract classmethod from_dict(bounding_volume_dict: _BoundingVolumeJsonDictT) Self[source]#

Construct a bounding volume from a dict. The implementor should support each possible format in the 3dtiles spec relevant to the specific flavor of bounding volume.

abstract get_center() ndarray[Any, dtype[float64]][source]#

Returns the center of this bounding volume.

abstract get_half_size() ndarray[Any, dtype[float64]][source]#

Returns the half size of this volume as a 3 elements array

abstract is_valid() bool[source]#

Test if the bounding volume is correctly defined.

abstract to_dict() _BoundingVolumeJsonDictT[source]#

Serialize this bounding volume into its JSON representation, ready to be embedded in a tileset.

abstract transform(transform: ndarray[Any, dtype[float64]]) None[source]#

Apply the provided transformation matrix (4x4) to the volume

Parameters:

transform – transformation matrix (4x4) to be applied

abstract translate(offset: ndarray[Any, dtype[float64]]) None[source]#

Translate the volume center with the given offset “vector”

Parameters:

offset – the 3D vector by which the volume should be translated