Перейти к основному содержимому

Class: BlockVolume

Immutable inclusive block volume.

Python projects the JavaScript from endpoint as from_ because from is a reserved word.

class BlockVolume

Related API: BlockVector3, Vector3Like

Constructors

Constructor

def __init__(self, from_: Vector3Like, to: Vector3Like) -> None:

Create an inclusive volume from two opposite corners.

Related API: Vector3Like

Properties

from_

@property
def from_(self) -> BlockVector3:

Original first corner, converted to integer block coordinates.

Related API: BlockVector3

to

@property
def to(self) -> BlockVector3:

Original opposite corner, converted to integer block coordinates.

Related API: BlockVector3

Methods

get_min

def get_min(self) -> BlockVector3:

Return the component-wise smallest corner.

Related API: BlockVector3

get_max

def get_max(self) -> BlockVector3:

Return the component-wise largest corner.

Related API: BlockVector3

get_span

def get_span(self) -> BlockVector3:

Return the inclusive number of blocks along each axis.

Related API: BlockVector3

get_capacity

def get_capacity(self) -> int:

Return the inclusive volume in blocks.

is_inside

def is_inside(self, location: Vector3Like) -> bool:

Return whether a location falls inside the inclusive bounds.

Related API: Vector3Like