Math & Geometry Types
Vec3
Quat
- class dazpy.Quat(x, y, z, w)[source]
Bases:
objectUnit quaternion representing a 3D rotation.
Stored as
(x, y, z, w)— imaginary components first, scalar last. This matches the dict format returned by the dazpy API (DazNode.rotation,DazBone.local_rotation).All methods return new
Quatinstances. The object is immutable.- Parameters:
- classmethod from_euler(x, y, z, order='XYZ')[source]
Create from Euler angles in degrees using intrinsic rotations.
Intrinsic means each rotation is applied in the frame left by the previous rotation — the same convention DAZ Studio uses for bone rotation channels.
- Parameters:
x (float) – Rotation around the X axis in degrees.
y (float) – Rotation around the Y axis in degrees.
z (float) – Rotation around the Z axis in degrees.
order (str) – Application order — one of
XYZ,XZY,YXZ,YZX,ZXY,ZYX. Matchesrotation_order.
- Returns:
A unit quaternion.
- Return type:
- to_euler(order='XYZ')[source]
Extract Euler angles in degrees.
The inverse of
from_euler()for the same order. Gimbal-lock configurations (singularities) are handled by setting the last rotation in the order to zero.
- multiply(other)[source]
Hamilton product
self * other.Composing rotations:
a.multiply(b)applies a first, then b in the rotated frame (intrinsic), or equivalently b first then a in the world frame (extrinsic).
- slerp(other, t)[source]
Spherical linear interpolation.
Always takes the shortest arc between the two orientations.
- x
- y
- z
- w
BoundingBox
- class dazpy.BoundingBox(min, max)[source]
Bases:
objectAxis-aligned bounding box.
- Parameters:
- classmethod from_dict(d)[source]
Create from the dict returned by
bounding_box().Expected shape:
{"min": {"x":..., "y":..., "z":...}, "max": {...}}.
- classmethod from_points(points)[source]
Compute the tight bounding box around a list of
Vec3points.
- min
- max