webknossos.geometry
¶
Vec3Float
¶
Bases: Sequence[float]
A three-dimensional vector of floats, e.g. a voxel size or a position with
sub-voxel precision. Use Vec3Int where only whole voxels are meaningful.
Examples:
Basic vector creation and operations:
vector_1 = Vec3Float(1.0, 2.0, 3.0)
vector_2 = Vec3Float.full(1.0)
assert vector_2.x == vector_2.y == vector_2.z
assert vector_1 + vector_2 == (2.0, 3.0, 4.0)
Instances compare, order and hash like the equivalent plain tuple, so they can be
used interchangeably with (x, y, z) in comparisons, sorting, sets and as dict
keys.
from_str
classmethod
¶
from_str(string: str) -> Vec3Float
Parses a Vec3Float from a string such as "1.0,2.0,3.0" or "(1.0,2.0,3.0)".
from_xyz
classmethod
¶
from_xyz(x: float, y: float, z: float) -> Vec3Float
Creates a Vec3Float from three floats, skipping the general parsing.
full
classmethod
¶
full(value: float) -> Vec3Float
Creates a Vec3Float with all three components set to value.
pairmax
¶
pairmax(other: Union[float, Vec3FloatLike]) -> Vec3Float
Returns the element-wise maximum of the two vectors.
pairmin
¶
pairmin(other: Union[float, Vec3FloatLike]) -> Vec3Float
Returns the element-wise minimum of the two vectors.
- Get Help
- Community Forums
- Email Support