Gf module

Summary: The Gf (Graphics Foundations) library contains classes and functions for working with basic mathematical aspects of graphics.


Graphics Foundation This package defines classes for fundamental graphics types and operations.

Classes:

BBox3d

Arbitrarily oriented 3D bounding box

Camera

DualQuatd

DualQuatf

DualQuath

Frustum

Basic view frustum

Interval

Basic mathematical interval class

Line

Line class

LineSeg

Line segment class

Matrix2d

Matrix2f

Matrix3d

Matrix3f

Matrix4d

Matrix4f

MultiInterval

Plane

Quatd

Quaternion

Quaternion class

Quatf

Quath

Range1d

Range1f

Range2d

Range2f

Range3d

Range3f

Ray

Rect2i

Rotation

3-space rotation

Size2

A 2D size class

Size3

A 3D size class

Transform

Vec2d

Vec2f

Vec2h

Vec2i

Vec3d

Vec3f

Vec3h

Vec3i

Vec4d

Vec4f

Vec4h

Vec4i

class pxr.Gf.BBox3d

Arbitrarily oriented 3D bounding box

Methods:

Combine

classmethod Combine(b1, b2) -> BBox3d

ComputeAlignedBox()

Returns the axis-aligned range (as a GfRange3d ) that results from applying the transformation matrix to the axis-aligned box and aligning the result.

ComputeAlignedRange()

Returns the axis-aligned range (as a GfRange3d ) that results from applying the transformation matrix to the wxis-aligned box and aligning the result.

ComputeCentroid()

Returns the centroid of the bounding box.

GetBox()

Returns the range of the axis-aligned untransformed box.

GetInverseMatrix()

Returns the inverse of the transformation matrix.

GetMatrix()

Returns the transformation matrix.

GetRange()

Returns the range of the axis-aligned untransformed box.

GetVolume()

Returns the volume of the box (0 for an empty box).

HasZeroAreaPrimitives()

Returns the current state of the zero-area primitives flag".

Set(box, matrix)

Sets the axis-aligned box and transformation matrix.

SetHasZeroAreaPrimitives(hasThem)

Sets the zero-area primitives flag to the given value.

SetMatrix(matrix)

Sets the transformation matrix only.

SetRange(box)

Sets the range of the axis-aligned box only.

Transform(matrix)

Transforms the bounding box by the given matrix, which is assumed to be a global transformation to apply to the box.

Attributes:

box

hasZeroAreaPrimitives

matrix

static Combine()

classmethod Combine(b1, b2) -> BBox3d

Combines two bboxes, returning a new bbox that contains both.

This uses the coordinate space of one of the two original boxes as the space of the result; it uses the one that produces whe smaller of the two resulting boxes.

Parameters
ComputeAlignedBox() Range3d

Returns the axis-aligned range (as a GfRange3d ) that results from applying the transformation matrix to the axis-aligned box and aligning the result.

This synonym for ComputeAlignedRange exists for compatibility purposes.

ComputeAlignedRange() Range3d

Returns the axis-aligned range (as a GfRange3d ) that results from applying the transformation matrix to the wxis-aligned box and aligning the result.

ComputeCentroid() Vec3d

Returns the centroid of the bounding box.

The centroid is computed as the transformed centroid of the range.

GetBox() Range3d

Returns the range of the axis-aligned untransformed box.

This synonym of GetRange exists for compatibility purposes.

GetInverseMatrix() Matrix4d

Returns the inverse of the transformation matrix.

This will be the identity matrix if the transformation matrix is not invertible.

GetMatrix() Matrix4d

Returns the transformation matrix.

GetRange() Range3d

Returns the range of the axis-aligned untransformed box.

GetVolume() float

Returns the volume of the box (0 for an empty box).

HasZeroAreaPrimitives() bool

Returns the current state of the zero-area primitives flag”.

Set(box, matrix) None

Sets the axis-aligned box and transformation matrix.

Parameters
SetHasZeroAreaPrimitives(hasThem) None

Sets the zero-area primitives flag to the given value.

Parameters

hasThem (bool) –

SetMatrix(matrix) None

Sets the transformation matrix only.

The axis-aligned box is not modified.

Parameters

matrix (Matrix4d) –

SetRange(box) None

Sets the range of the axis-aligned box only.

The transformation matrix is not modified.

Parameters

box (Range3d) –

Transform(matrix) None

Transforms the bounding box by the given matrix, which is assumed to be a global transformation to apply to the box.

Therefore, this just post-multiplies the box’s matrix by matrix .

Parameters

matrix (Matrix4d) –

property box
property hasZeroAreaPrimitives
property matrix
class pxr.Gf.Camera

Classes:

FOVDirection

Direction used for Field of View or orthographic size.

Projection

Projection type.

Methods:

GetFieldOfView(direction)

Returns the horizontal or vertical field of view in degrees.

SetFromViewAndProjectionMatrix(viewMatrix, ...)

Sets the camera from a view and projection matrix.

SetOrthographicFromAspectRatioAndSize(...)

Sets the frustum to be orthographic such that it has the given aspectRatio and such that the orthographic width, respectively, orthographic height (in cm) is equal to orthographicSize (depending on direction).

SetPerspectiveFromAspectRatioAndFieldOfView(...)

Sets the frustum to be projective with the given aspectRatio and horizontal, respectively, vertical field of view fieldOfView (similar to gluPerspective when direction = FOVVertical).

Attributes:

APERTURE_UNIT

DEFAULT_HORIZONTAL_APERTURE

DEFAULT_VERTICAL_APERTURE

FOCAL_LENGTH_UNIT

FOVHorizontal

FOVVertical

Orthographic

Perspective

aspectRatio

float

clippingPlanes

list[Vec4f]

clippingRange

Range1f

fStop

float

focalLength

float

focusDistance

float

frustum

Frustum

horizontalAperture

float

horizontalApertureOffset

float

horizontalFieldOfView

projection

Projection

transform

Matrix4d

verticalAperture

float

verticalApertureOffset

float

verticalFieldOfView

class FOVDirection

Direction used for Field of View or orthographic size.

Methods:

GetValueFromName

Attributes:

allValues

static GetValueFromName()
allValues = (Gf.Camera.FOVHorizontal, Gf.Camera.FOVVertical)
class Projection

Projection type.

Methods:

GetValueFromName

Attributes:

allValues

static GetValueFromName()
allValues = (Gf.Camera.Perspective, Gf.Camera.Orthographic)
GetFieldOfView(direction) float

Returns the horizontal or vertical field of view in degrees.

Parameters

direction (FOVDirection) –

SetFromViewAndProjectionMatrix(viewMatrix, projMatix, focalLength) None

Sets the camera from a view and projection matrix.

Note that the projection matrix does only determine the ratio of aperture to focal length, so there is a choice which defaults to 50mm (or more accurately, 50 tenths of a world unit).

Parameters
SetOrthographicFromAspectRatioAndSize(aspectRatio, orthographicSize, direction) None

Sets the frustum to be orthographic such that it has the given aspectRatio and such that the orthographic width, respectively, orthographic height (in cm) is equal to orthographicSize (depending on direction).

Parameters
  • aspectRatio (float) –

  • orthographicSize (float) –

  • direction (FOVDirection) –

SetPerspectiveFromAspectRatioAndFieldOfView(aspectRatio, fieldOfView, direction, horizontalAperture) None

Sets the frustum to be projective with the given aspectRatio and horizontal, respectively, vertical field of view fieldOfView (similar to gluPerspective when direction = FOVVertical).

Do not pass values for horionztalAperture unless you care about DepthOfField.

Parameters
  • aspectRatio (float) –

  • fieldOfView (float) –

  • direction (FOVDirection) –

  • horizontalAperture (float) –

APERTURE_UNIT = 0.1
DEFAULT_HORIZONTAL_APERTURE = 20.955
DEFAULT_VERTICAL_APERTURE = 15.290799999999999
FOCAL_LENGTH_UNIT = 0.1
FOVHorizontal = Gf.Camera.FOVHorizontal
FOVVertical = Gf.Camera.FOVVertical
Orthographic = Gf.Camera.Orthographic
Perspective = Gf.Camera.Perspective
property aspectRatio

float

Returns the projector aperture aspect ratio.

Type

type

property clippingPlanes

list[Vec4f]

Returns additional clipping planes.


type : None

Sets additional arbitrarily oriented clipping planes.

A vector (a,b,c,d) encodes a clipping plane that clips off points (x,y,z) with a * x + b * y + c * z + d * 1<0

where (x,y,z) are the coordinates in the camera’s space.

Type

type

property clippingRange

Range1f

Returns the clipping range in world units.


type : None

Sets the clipping range in world units.

Type

type

property fStop

float

Returns the lens aperture.


type : None

Sets the lens aperture, unitless.

Type

type

property focalLength

float

Returns the focal length in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).


type : None

These are the values actually stored in the class and they correspond to measurements of an actual physical camera (in mm).

Together with the clipping range, they determine the camera frustum. Sets the focal length in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).

Type

type

property focusDistance

float

Returns the focus distance in world units.


type : None

Sets the focus distance in world units.

Type

type

property frustum

Frustum

Returns the computed, world-space camera frustum.

The frustum will always be that of a Y-up, -Z-looking camera.

Type

type

property horizontalAperture

float

Returns the width of the projector aperture in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).


type : None

Sets the width of the projector aperture in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).

Type

type

property horizontalApertureOffset

float

Returns the horizontal offset of the projector aperture in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).

In particular, an offset is necessary when writing out a stereo camera with finite convergence distance as two cameras.


type : None

Sets the horizontal offset of the projector aperture in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).

Type

type

property horizontalFieldOfView
property projection

Projection

Returns the projection type.


type : None

Sets the projection type.

Type

type

property transform

Matrix4d

Returns the transform of the filmback in world space.

This is exactly the transform specified via SetTransform() .


type : None

Sets the transform of the filmback in world space to val .

Type

type

property verticalAperture

float

Returns the height of the projector aperture in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).


type : None

Sets the height of the projector aperture in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).

Type

type

property verticalApertureOffset

float

Returns the vertical offset of the projector aperture in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).


type : None

Sets the vertical offset of the projector aperture in tenths of a world unit (e.g., mm if the world unit is assumed to be cm).

Type

type

property verticalFieldOfView
class pxr.Gf.DualQuatd

Methods:

GetConjugate()

Returns the conjugate of this dual quaternion.

GetDual()

Returns the dual part of the dual quaternion.

GetIdentity

classmethod GetIdentity() -> DualQuatd

GetInverse()

Returns the inverse of this dual quaternion.

GetLength()

Returns geometric length of this dual quaternion.

GetNormalized(eps)

Returns a normalized (unit-length) version of this dual quaternion.

GetReal()

Returns the real part of the dual quaternion.

GetTranslation()

Get the translation component of this dual quaternion.

GetZero

classmethod GetZero() -> DualQuatd

Normalize(eps)

Normalizes this dual quaternion in place.

SetDual(dual)

Sets the dual part of the dual quaternion.

SetReal(real)

Sets the real part of the dual quaternion.

SetTranslation(translation)

Set the translation component of this dual quaternion.

Transform(vec)

Transforms the row vector vec by the dual quaternion.

Attributes:

dual

real

GetConjugate() DualQuatd

Returns the conjugate of this dual quaternion.

GetDual() Quatd

Returns the dual part of the dual quaternion.

static GetIdentity()

classmethod GetIdentity() -> DualQuatd

Returns the identity dual quaternion, which has a real part of (1,0,0,0) and a dual part of (0,0,0,0).

GetInverse() DualQuatd

Returns the inverse of this dual quaternion.

GetLength() tuple[float, float]

Returns geometric length of this dual quaternion.

GetNormalized(eps) DualQuatd

Returns a normalized (unit-length) version of this dual quaternion.

If the length of this dual quaternion is smaller than eps , this returns the identity dual quaternion.

Parameters

eps (float) –

GetReal() Quatd

Returns the real part of the dual quaternion.

GetTranslation() Vec3d

Get the translation component of this dual quaternion.

static GetZero()

classmethod GetZero() -> DualQuatd

Returns the zero dual quaternion, which has a real part of (0,0,0,0) and a dual part of (0,0,0,0).

Normalize(eps) tuple[float, float]

Normalizes this dual quaternion in place.

Normalizes this dual quaternion in place to unit length, returning the length before normalization. If the length of this dual quaternion is smaller than eps , this sets the dual quaternion to identity.

Parameters

eps (float) –

SetDual(dual) None

Sets the dual part of the dual quaternion.

Parameters

dual (Quatd) –

SetReal(real) None

Sets the real part of the dual quaternion.

Parameters

real (Quatd) –

SetTranslation(translation) None

Set the translation component of this dual quaternion.

Parameters

translation (Vec3d) –

Transform(vec) Vec3d

Transforms the row vector vec by the dual quaternion.

Parameters

vec (Vec3d) –

property dual
property real
class pxr.Gf.DualQuatf

Methods:

GetConjugate()

Returns the conjugate of this dual quaternion.

GetDual()

Returns the dual part of the dual quaternion.

GetIdentity

classmethod GetIdentity() -> DualQuatf

GetInverse()

Returns the inverse of this dual quaternion.

GetLength()

Returns geometric length of this dual quaternion.

GetNormalized(eps)

Returns a normalized (unit-length) version of this dual quaternion.

GetReal()

Returns the real part of the dual quaternion.

GetTranslation()

Get the translation component of this dual quaternion.

GetZero

classmethod GetZero() -> DualQuatf

Normalize(eps)

Normalizes this dual quaternion in place.

SetDual(dual)

Sets the dual part of the dual quaternion.

SetReal(real)

Sets the real part of the dual quaternion.

SetTranslation(translation)

Set the translation component of this dual quaternion.

Transform(vec)

Transforms the row vector vec by the dual quaternion.

Attributes:

dual

real

GetConjugate() DualQuatf

Returns the conjugate of this dual quaternion.

GetDual() Quatf

Returns the dual part of the dual quaternion.

static GetIdentity()

classmethod GetIdentity() -> DualQuatf

Returns the identity dual quaternion, which has a real part of (1,0,0,0) and a dual part of (0,0,0,0).

GetInverse() DualQuatf

Returns the inverse of this dual quaternion.

GetLength() tuple[float, float]

Returns geometric length of this dual quaternion.

GetNormalized(eps) DualQuatf

Returns a normalized (unit-length) version of this dual quaternion.

If the length of this dual quaternion is smaller than eps , this returns the identity dual quaternion.

Parameters

eps (float) –

GetReal() Quatf

Returns the real part of the dual quaternion.

GetTranslation() Vec3f

Get the translation component of this dual quaternion.

static GetZero()

classmethod GetZero() -> DualQuatf

Returns the zero dual quaternion, which has a real part of (0,0,0,0) and a dual part of (0,0,0,0).

Normalize(eps) tuple[float, float]

Normalizes this dual quaternion in place.

Normalizes this dual quaternion in place to unit length, returning the length before normalization. If the length of this dual quaternion is smaller than eps , this sets the dual quaternion to identity.

Parameters

eps (float) –

SetDual(dual) None

Sets the dual part of the dual quaternion.

Parameters

dual (Quatf) –

SetReal(real) None

Sets the real part of the dual quaternion.

Parameters

real (Quatf) –

SetTranslation(translation) None

Set the translation component of this dual quaternion.

Parameters

translation (Vec3f) –

Transform(vec) Vec3f

Transforms the row vector vec by the dual quaternion.

Parameters

vec (Vec3f) –

property dual
property real
class pxr.Gf.DualQuath

Methods:

GetConjugate()

Returns the conjugate of this dual quaternion.

GetDual()

Returns the dual part of the dual quaternion.

GetIdentity

classmethod GetIdentity() -> DualQuath

GetInverse()

Returns the inverse of this dual quaternion.

GetLength()

Returns geometric length of this dual quaternion.

GetNormalized(eps)

Returns a normalized (unit-length) version of this dual quaternion.

GetReal()

Returns the real part of the dual quaternion.

GetTranslation()

Get the translation component of this dual quaternion.

GetZero

classmethod GetZero() -> DualQuath

Normalize(eps)

Normalizes this dual quaternion in place.

SetDual(dual)

Sets the dual part of the dual quaternion.

SetReal(real)

Sets the real part of the dual quaternion.

SetTranslation(translation)

Set the translation component of this dual quaternion.

Transform(vec)

Transforms the row vector vec by the dual quaternion.

Attributes:

dual

real

GetConjugate() DualQuath

Returns the conjugate of this dual quaternion.

GetDual() Quath

Returns the dual part of the dual quaternion.

static GetIdentity()

classmethod GetIdentity() -> DualQuath

Returns the identity dual quaternion, which has a real part of (1,0,0,0) and a dual part of (0,0,0,0).

GetInverse() DualQuath

Returns the inverse of this dual quaternion.

GetLength() tuple[GfHalf, GfHalf]

Returns geometric length of this dual quaternion.

GetNormalized(eps) DualQuath

Returns a normalized (unit-length) version of this dual quaternion.

If the length of this dual quaternion is smaller than eps , this returns the identity dual quaternion.

Parameters

eps (GfHalf) –

GetReal() Quath

Returns the real part of the dual quaternion.

GetTranslation() Vec3h

Get the translation component of this dual quaternion.

static GetZero()

classmethod GetZero() -> DualQuath

Returns the zero dual quaternion, which has a real part of (0,0,0,0) and a dual part of (0,0,0,0).

Normalize(eps) tuple[GfHalf, GfHalf]

Normalizes this dual quaternion in place.

Normalizes this dual quaternion in place to unit length, returning the length before normalization. If the length of this dual quaternion is smaller than eps , this sets the dual quaternion to identity.

Parameters

eps (GfHalf) –

SetDual(dual) None

Sets the dual part of the dual quaternion.

Parameters

dual (Quath) –

SetReal(real) None

Sets the real part of the dual quaternion.

Parameters

real (Quath) –

SetTranslation(translation) None

Set the translation component of this dual quaternion.

Parameters

translation (Vec3h) –

Transform(vec) Vec3h

Transforms the row vector vec by the dual quaternion.

Parameters

vec (Vec3h) –

property dual
property real
class pxr.Gf.Frustum

Basic view frustum

Classes:

ProjectionType

This enum is used to determine the type of projection represented by a frustum.

Methods:

ComputeAspectRatio()

Returns the aspect ratio of the frustum, defined as the width of the window divided by the height.

ComputeCorners()

Returns the world-space corners of the frustum as a vector of 8 points, ordered as:

ComputeCornersAtDistance(d)

Returns the world-space corners of the intersection of the frustum with a plane parallel to the near/far plane at distance d from the apex, ordered as:

ComputeLookAtPoint()

Computes and returns the world-space look-at point from the eye point (position), view direction (rotation), and view distance.

ComputeNarrowedFrustum(windowPos, size)

Returns a frustum that is a narrowed-down version of this frustum.

ComputePickRay(windowPos)

Builds and returns a GfRay that can be used for picking at the given normalized (-1 to +1 in both dimensions) window position.

ComputeProjectionMatrix()

Returns a GL-style projection matrix corresponding to the frustum's projection.

ComputeUpVector()

Returns the normalized world-space up vector, which is computed by rotating the y axis by the frustum's rotation.

ComputeViewDirection()

Returns the normalized world-space view direction vector, which is computed by rotating the -z axis by the frustum's rotation.

ComputeViewFrame(side, up, view)

Computes the view frame defined by this frustum.

ComputeViewInverse()

Returns a matrix that represents the inverse viewing transformation for this frustum.

ComputeViewMatrix()

Returns a matrix that represents the viewing transformation for this frustum.

FitToSphere(center, radius, slack)

Modifies the frustum to tightly enclose a sphere with the given center and radius, using the current view direction.

GetFOV

Returns the horizontal fov of the frustum.

GetNearFar()

Returns the near/far interval.

GetOrthographic(left, right, bottom, top, ...)

Returns the current frustum in the format used by SetOrthographic() .

GetPerspective

Returns the current perspective frustum values suitable for use by SetPerspective.

GetPosition()

Returns the position of the frustum in world space.

GetProjectionType()

Returns the projection type.

GetReferencePlaneDepth

classmethod GetReferencePlaneDepth() -> float

GetRotation()

Returns the orientation of the frustum in world space as a rotation to apply to the -z axis.

GetViewDistance()

Returns the view distance.

GetWindow()

Returns the window rectangle in the reference plane.

Intersects(bbox)

Returns true if the given axis-aligned bbox is inside or intersecting the frustum.

IntersectsViewVolume

classmethod IntersectsViewVolume(bbox, vpMat) -> bool

SetNearFar(nearFar)

Sets the near/far interval.

SetOrthographic(left, right, bottom, top, ...)

Sets up the frustum in a manner similar to glOrtho() .

SetPerspective(fieldOfViewHeight, ...)

Sets up the frustum in a manner similar to gluPerspective() .

SetPosition(position)

Sets the position of the frustum in world space.

SetPositionAndRotationFromMatrix(camToWorldXf)

Sets the position and rotation of the frustum from a camera matrix (always from a y-Up camera).

SetProjectionType(projectionType)

Sets the projection type.

SetRotation(rotation)

Sets the orientation of the frustum in world space as a rotation to apply to the default frame: looking along the -z axis with the +y axis as"up".

SetViewDistance(viewDistance)

Sets the view distance.

SetWindow(window)

Sets the window rectangle in the reference plane that defines the left, right, top, and bottom planes of the frustum.

Transform(matrix)

Transforms the frustum by the given matrix.

Attributes:

Orthographic

Perspective

nearFar

position

projectionType

rotation

viewDistance

window

class ProjectionType

This enum is used to determine the type of projection represented by a frustum.

Methods:

GetValueFromName

Attributes:

allValues

static GetValueFromName()
allValues = (Gf.Frustum.Orthographic, Gf.Frustum.Perspective)
ComputeAspectRatio() float

Returns the aspect ratio of the frustum, defined as the width of the window divided by the height.

If the height is zero or negative, this returns 0.

ComputeCorners() list[Vec3d]

Returns the world-space corners of the frustum as a vector of 8 points, ordered as:

  • Left bottom near

  • Right bottom near

  • Left top near

  • Right top near

  • Left bottom far

  • Right bottom far

  • Left top far

  • Right top far

ComputeCornersAtDistance(d) list[Vec3d]

Returns the world-space corners of the intersection of the frustum with a plane parallel to the near/far plane at distance d from the apex, ordered as:

  • Left bottom

  • Right bottom

  • Left top

  • Right top In particular, it gives the partial result of ComputeCorners when given near or far distance.

Parameters

d (float) –

ComputeLookAtPoint() Vec3d

Computes and returns the world-space look-at point from the eye point (position), view direction (rotation), and view distance.

ComputeNarrowedFrustum(windowPos, size) Frustum

Returns a frustum that is a narrowed-down version of this frustum.

The new frustum has the same near and far planes, but the other planes are adjusted to be centered on windowPos with the new width and height obtained from the existing width and height by multiplying by size [0] and size [1], respectively. Finally, the new frustum is clipped against this frustum so that it is completely contained in the existing frustum.

windowPos is given in normalized coords (-1 to +1 in both dimensions). size is given as a scalar (0 to 1 in both dimensions).

If the windowPos or size given is outside these ranges, it may result in returning a collapsed frustum.

This method is useful for computing a volume to use for interactive picking.

Parameters

ComputeNarrowedFrustum(worldPoint, size) -> Frustum

Returns a frustum that is a narrowed-down version of this frustum.

The new frustum has the same near and far planes, but the other planes are adjusted to be centered on worldPoint with the new width and height obtained from the existing width and height by multiplying by size [0] and size [1], respectively. Finally, the new frustum is clipped against this frustum so that it is completely contained in the existing frustum.

worldPoint is given in world space coordinates. size is given as a scalar (0 to 1 in both dimensions).

If the size given is outside this range, it may result in returning a collapsed frustum.

If the worldPoint is at or behind the eye of the frustum, it will return a frustum equal to this frustum.

This method is useful for computing a volume to use for interactive picking.

Parameters
ComputePickRay(windowPos) Ray

Builds and returns a GfRay that can be used for picking at the given normalized (-1 to +1 in both dimensions) window position.

Contrasted with ComputeRay() , that method returns a ray whose origin is the eyepoint, while this method returns a ray whose origin is on the near plane.

Parameters

windowPos (Vec2d) –


ComputePickRay(worldSpacePos) -> Ray

Builds and returns a GfRay that can be used for picking that connects the viewpoint to the given 3d point in worldspace.

Parameters

worldSpacePos (Vec3d) –

ComputeProjectionMatrix() Matrix4d

Returns a GL-style projection matrix corresponding to the frustum’s projection.

ComputeUpVector() Vec3d

Returns the normalized world-space up vector, which is computed by rotating the y axis by the frustum’s rotation.

ComputeViewDirection() Vec3d

Returns the normalized world-space view direction vector, which is computed by rotating the -z axis by the frustum’s rotation.

ComputeViewFrame(side, up, view) None

Computes the view frame defined by this frustum.

The frame consists of the view direction, up vector and side vector, as shown in this diagram.

up
^   ^
|  /
| / view
|/
+- - - - > side
Parameters
ComputeViewInverse() Matrix4d

Returns a matrix that represents the inverse viewing transformation for this frustum.

That is, it returns the matrix that converts points from eye (frustum) space to world space.

ComputeViewMatrix() Matrix4d

Returns a matrix that represents the viewing transformation for this frustum.

That is, it returns the matrix that converts points from world space to eye (frustum) space.

FitToSphere(center, radius, slack) None

Modifies the frustum to tightly enclose a sphere with the given center and radius, using the current view direction.

The planes of the frustum are adjusted as necessary. The given amount of slack is added to the sphere’s radius is used around the sphere to avoid boundary problems.

Parameters
  • center (Vec3d) –

  • radius (float) –

  • slack (float) –

GetFOV()

Returns the horizontal fov of the frustum. The fov of the frustum is not necessarily the same value as displayed in the viewer. The displayed fov is a function of the focal length or FOV avar. The frustum’s fov may be different due to things like lens breathing.

If the frustum is not of type GfFrustum::Perspective, the returned FOV will be 0.0.

GetNearFar() Range1d

Returns the near/far interval.

GetOrthographic(left, right, bottom, top, nearPlane, farPlane) bool

Returns the current frustum in the format used by SetOrthographic() .

If the current frustum is not an orthographic projection, this returns false and leaves the parameters untouched.

Parameters
  • left (float) –

  • right (float) –

  • bottom (float) –

  • top (float) –

  • nearPlane (float) –

  • farPlane (float) –

GetPerspective()

Returns the current perspective frustum values suitable for use by SetPerspective. If the current frustum is a perspective projection, the return value is a tuple of fieldOfView, aspectRatio, nearDistance, farDistance). If the current frustum is not perspective, the return value is None.

GetPosition() Vec3d

Returns the position of the frustum in world space.

GetProjectionType() Frustum.ProjectionType

Returns the projection type.

static GetReferencePlaneDepth()

classmethod GetReferencePlaneDepth() -> float

Returns the depth of the reference plane.

GetRotation() Rotation

Returns the orientation of the frustum in world space as a rotation to apply to the -z axis.

GetViewDistance() float

Returns the view distance.

GetWindow() Range2d

Returns the window rectangle in the reference plane.

Intersects(bbox) bool

Returns true if the given axis-aligned bbox is inside or intersecting the frustum.

Otherwise, it returns false. Useful when doing picking or frustum culling.

Parameters

bbox (BBox3d) –


Intersects(point) -> bool

Returns true if the given point is inside or intersecting the frustum.

Otherwise, it returns false.

Parameters

point (Vec3d) –


Intersects(p0, p1) -> bool

Returns true if the line segment formed by the given points is inside or intersecting the frustum.

Otherwise, it returns false.

Parameters

Intersects(p0, p1, p2) -> bool

Returns true if the triangle formed by the given points is inside or intersecting the frustum.

Otherwise, it returns false.

Parameters
static IntersectsViewVolume()

classmethod IntersectsViewVolume(bbox, vpMat) -> bool

Returns true if the bbox volume intersects the view volume given by the view-projection matrix, erring on the side of false positives for efficiency.

This method is intended for cases where a GfFrustum is not available or when the view-projection matrix yields a view volume that is not expressable as a GfFrustum.

Because it errs on the side of false positives, it is suitable for early-out tests such as draw or intersection culling.

Parameters
SetNearFar(nearFar) None

Sets the near/far interval.

Parameters

nearFar (Range1d) –

SetOrthographic(left, right, bottom, top, nearPlane, farPlane) None

Sets up the frustum in a manner similar to glOrtho() .

Sets the projection to GfFrustum::Orthographic and sets the window and near/far specifications based on the given values.

Parameters
  • left (float) –

  • right (float) –

  • bottom (float) –

  • top (float) –

  • nearPlane (float) –

  • farPlane (float) –

SetPerspective(fieldOfViewHeight, aspectRatio, nearDistance, farDistance) None

Sets up the frustum in a manner similar to gluPerspective() .

It sets the projection type to GfFrustum::Perspective and sets the window specification so that the resulting symmetric frustum encloses an angle of fieldOfViewHeight degrees in the vertical direction, with aspectRatio used to figure the angle in the horizontal direction. The near and far distances are specified as well. The window coordinates are computed as:

top    = tan(fieldOfViewHeight / 2)
bottom = -top
right  = top \* aspectRatio
left   = -right
near   = nearDistance
far    = farDistance
Parameters
  • fieldOfViewHeight (float) –

  • aspectRatio (float) –

  • nearDistance (float) –

  • farDistance (float) –


SetPerspective(fieldOfView, isFovVertical, aspectRatio, nearDistance, farDistance) -> None

Sets up the frustum in a manner similar to gluPerspective().

It sets the projection type to GfFrustum::Perspective and sets the window specification so that:

If isFovVertical is true, the resulting symmetric frustum encloses an angle of fieldOfView degrees in the vertical direction, with aspectRatio used to figure the angle in the horizontal direction.

If isFovVertical is false, the resulting symmetric frustum encloses an angle of fieldOfView degrees in the horizontal direction, with aspectRatio used to figure the angle in the vertical direction.

The near and far distances are specified as well. The window coordinates are computed as follows:

  • if isFovVertical:

  • top = tan(fieldOfView / 2)

  • right = top * aspectRatio

  • if NOT isFovVertical:

  • right = tan(fieldOfView / 2)

  • top = right / aspectRation

  • bottom = -top

  • left = -right

  • near = nearDistance

  • far = farDistance

Parameters
  • fieldOfView (float) –

  • isFovVertical (bool) –

  • aspectRatio (float) –

  • nearDistance (float) –

  • farDistance (float) –

SetPosition(position) None

Sets the position of the frustum in world space.

Parameters

position (Vec3d) –

SetPositionAndRotationFromMatrix(camToWorldXf) None

Sets the position and rotation of the frustum from a camera matrix (always from a y-Up camera).

The resulting frustum’s transform will always represent a right-handed and orthonormal coordinate sytem (scale, shear, and projection are removed from the given camToWorldXf ).

Parameters

camToWorldXf (Matrix4d) –

SetProjectionType(projectionType) None

Sets the projection type.

Parameters

projectionType (Frustum.ProjectionType) –

SetRotation(rotation) None

Sets the orientation of the frustum in world space as a rotation to apply to the default frame: looking along the -z axis with the +y axis as”up”.

Parameters

rotation (Rotation) –

SetViewDistance(viewDistance) None

Sets the view distance.

Parameters

viewDistance (float) –

SetWindow(window) None

Sets the window rectangle in the reference plane that defines the left, right, top, and bottom planes of the frustum.

Parameters

window (Range2d) –

Transform(matrix) Frustum

Transforms the frustum by the given matrix.

The transformation matrix is applied as follows: the position and the direction vector are transformed with the given matrix. Then the length of the new direction vector is used to rescale the near and far plane and the view distance. Finally, the points that define the reference plane are transformed by the matrix. This method assures that the frustum will not be sheared or perspective-projected.

Note that this definition means that the transformed frustum does not preserve scales very well. Do not use this function to transform a frustum that is to be used for precise operations such as intersection testing.

Parameters

matrix (Matrix4d) –

Orthographic = Gf.Frustum.Orthographic
Perspective = Gf.Frustum.Perspective
property nearFar
property position
property projectionType
property rotation
property viewDistance
property window
class pxr.Gf.Interval

Basic mathematical interval class

Methods:

Contains

Returns true if x is inside the interval.

GetFullInterval

classmethod GetFullInterval() -> Interval

GetMax

Get the maximum value.

GetMin

Get the minimum value.

GetSize

The width of the interval

In

Returns true if x is inside the interval.

Intersects(i)

Return true iff the given interval i intersects this interval.

IsEmpty

True if the interval is empty.

IsFinite()

Returns true if both the maximum and minimum value are finite.

IsMaxClosed()

Maximum boundary condition.

IsMaxFinite()

Returns true if the maximum value is finite.

IsMaxOpen()

Maximum boundary condition.

IsMinClosed()

Minimum boundary condition.

IsMinFinite()

Returns true if the minimum value is finite.

IsMinOpen()

Minimum boundary condition.

SetMax

Set the maximum value.

SetMin

Set the minimum value.

Attributes:

finite

isEmpty

True if the interval is empty.

max

The maximum value.

maxClosed

maxFinite

maxOpen

min

The minimum value.

minClosed

minFinite

minOpen

size

The width of the interval.

Contains()

Returns true if x is inside the interval.

Returns true if x is inside the interval.

static GetFullInterval()

classmethod GetFullInterval() -> Interval

Returns the full interval (-inf, inf).

GetMax()

Get the maximum value.

GetMin()

Get the minimum value.

GetSize()

The width of the interval

In()

Returns true if x is inside the interval.

Intersects(i) bool

Return true iff the given interval i intersects this interval.

Parameters

i (Interval) –

IsEmpty()

True if the interval is empty.

IsFinite() bool

Returns true if both the maximum and minimum value are finite.

IsMaxClosed() bool

Maximum boundary condition.

IsMaxFinite() bool

Returns true if the maximum value is finite.

IsMaxOpen() bool

Maximum boundary condition.

IsMinClosed() bool

Minimum boundary condition.

IsMinFinite() bool

Returns true if the minimum value is finite.

IsMinOpen() bool

Minimum boundary condition.

SetMax()

Set the maximum value.

Set the maximum value and boundary condition.

SetMin()

Set the minimum value.

Set the minimum value and boundary condition.

property finite
property isEmpty

True if the interval is empty.

property max

The maximum value.

property maxClosed
property maxFinite
property maxOpen
property min

The minimum value.

property minClosed
property minFinite
property minOpen
property size

The width of the interval.

class pxr.Gf.Line

Line class

Methods:

FindClosestPoint(point, t)

Returns the point on the line that is closest to point .

GetDirection()

Return the normalized direction of the line.

GetPoint(t)

Return the point on the line at ```` ( p0 + t * dir).

Set(p0, dir)

param p0

Attributes:

direction

FindClosestPoint(point, t) Vec3d

Returns the point on the line that is closest to point .

If t is not None , it will be set to the parametric distance along the line of the returned point.

Parameters
  • point (Vec3d) –

  • t (float) –

GetDirection() Vec3d

Return the normalized direction of the line.

GetPoint(t) Vec3d

Return the point on the line at ```` ( p0 + t * dir).

Remember dir has been normalized so t represents a unit distance.

Parameters

t (float) –

Set(p0, dir) float
Parameters
property direction
class pxr.Gf.LineSeg

Line segment class

Methods:

FindClosestPoint(point, t)

Returns the point on the line that is closest to point .

GetDirection()

Return the normalized direction of the line.

GetLength()

Return the length of the line.

GetPoint(t)

Return the point on the segment specified by the parameter t.

Attributes:

direction

length

FindClosestPoint(point, t) Vec3d

Returns the point on the line that is closest to point .

If t is not None , it will be set to the parametric distance along the line of the closest point.

Parameters
  • point (Vec3d) –

  • t (float) –

GetDirection() Vec3d

Return the normalized direction of the line.

GetLength() float

Return the length of the line.

GetPoint(t) Vec3d

Return the point on the segment specified by the parameter t.

p = p0 + t * (p1 - p0)

Parameters

t (float) –

property direction
property length
class pxr.Gf.Matrix2d

Methods:

GetColumn(i)

Gets a column of the matrix as a Vec2.

GetDeterminant()

Returns the determinant of the matrix.

GetInverse(det, eps)

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

GetRow(i)

Gets a row of the matrix as a Vec2.

GetTranspose()

Returns the transpose of the matrix.

Set(m00, m01, m10, m11)

Sets the matrix from 4 independent double values, specified in row-major order.

SetColumn(i, v)

Sets a column of the matrix from a Vec2.

SetDiagonal(s)

Sets the matrix to s times the identity matrix.

SetIdentity()

Sets the matrix to the identity matrix.

SetRow(i, v)

Sets a row of the matrix from a Vec2.

SetZero()

Sets the matrix to zero.

Attributes:

dimension

GetColumn(i) Vec2d

Gets a column of the matrix as a Vec2.

Parameters

i (int) –

GetDeterminant() float

Returns the determinant of the matrix.

GetInverse(det, eps) Matrix2d

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

(FLT_MAX is the largest value a float can have, as defined by the system.) The matrix is considered singular if the determinant is less than or equal to the optional parameter eps. If det is non-null, \*det is set to the determinant.

Parameters
  • det (float) –

  • eps (float) –

GetRow(i) Vec2d

Gets a row of the matrix as a Vec2.

Parameters

i (int) –

GetTranspose() Matrix2d

Returns the transpose of the matrix.

Set(m00, m01, m10, m11) Matrix2d

Sets the matrix from 4 independent double values, specified in row-major order.

For example, parameter m10 specifies the value in row 1 and column 0.

Parameters
  • m00 (float) –

  • m01 (float) –

  • m10 (float) –

  • m11 (float) –


Set(m) -> Matrix2d

Sets the matrix from a 2x2 array of double values, specified in row-major order.

Parameters

m (float) –

SetColumn(i, v) None

Sets a column of the matrix from a Vec2.

Parameters
  • i (int) –

  • v (Vec2d) –

SetDiagonal(s) Matrix2d

Sets the matrix to s times the identity matrix.

Parameters

s (float) –


SetDiagonal(arg1) -> Matrix2d

Sets the matrix to have diagonal ( v[0], v[1] ).

Parameters

arg1 (Vec2d) –

SetIdentity() Matrix2d

Sets the matrix to the identity matrix.

SetRow(i, v) None

Sets a row of the matrix from a Vec2.

Parameters
  • i (int) –

  • v (Vec2d) –

SetZero() Matrix2d

Sets the matrix to zero.

dimension = (2, 2)
class pxr.Gf.Matrix2f

Methods:

GetColumn(i)

Gets a column of the matrix as a Vec2.

GetDeterminant()

Returns the determinant of the matrix.

GetInverse(det, eps)

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

GetRow(i)

Gets a row of the matrix as a Vec2.

GetTranspose()

Returns the transpose of the matrix.

Set(m00, m01, m10, m11)

Sets the matrix from 4 independent float values, specified in row- major order.

SetColumn(i, v)

Sets a column of the matrix from a Vec2.

SetDiagonal(s)

Sets the matrix to s times the identity matrix.

SetIdentity()

Sets the matrix to the identity matrix.

SetRow(i, v)

Sets a row of the matrix from a Vec2.

SetZero()

Sets the matrix to zero.

Attributes:

dimension

GetColumn(i) Vec2f

Gets a column of the matrix as a Vec2.

Parameters

i (int) –

GetDeterminant() float

Returns the determinant of the matrix.

GetInverse(det, eps) Matrix2f

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

(FLT_MAX is the largest value a float can have, as defined by the system.) The matrix is considered singular if the determinant is less than or equal to the optional parameter eps. If det is non-null, \*det is set to the determinant.

Parameters
  • det (float) –

  • eps (float) –

GetRow(i) Vec2f

Gets a row of the matrix as a Vec2.

Parameters

i (int) –

GetTranspose() Matrix2f

Returns the transpose of the matrix.

Set(m00, m01, m10, m11) Matrix2f

Sets the matrix from 4 independent float values, specified in row- major order.

For example, parameter m10 specifies the value in row 1 and column 0.

Parameters
  • m00 (float) –

  • m01 (float) –

  • m10 (float) –

  • m11 (float) –


Set(m) -> Matrix2f

Sets the matrix from a 2x2 array of float values, specified in row-major order.

Parameters

m (float) –

SetColumn(i, v) None

Sets a column of the matrix from a Vec2.

Parameters
  • i (int) –

  • v (Vec2f) –

SetDiagonal(s) Matrix2f

Sets the matrix to s times the identity matrix.

Parameters

s (float) –


SetDiagonal(arg1) -> Matrix2f

Sets the matrix to have diagonal ( v[0], v[1] ).

Parameters

arg1 (Vec2f) –

SetIdentity() Matrix2f

Sets the matrix to the identity matrix.

SetRow(i, v) None

Sets a row of the matrix from a Vec2.

Parameters
  • i (int) –

  • v (Vec2f) –

SetZero() Matrix2f

Sets the matrix to zero.

dimension = (2, 2)
class pxr.Gf.Matrix3d

Methods:

ExtractRotation()

Returns the rotation corresponding to this matrix.

GetColumn(i)

Gets a column of the matrix as a Vec3.

GetDeterminant()

Returns the determinant of the matrix.

GetHandedness()

Returns the sign of the determinant of the matrix, i.e.

GetInverse(det, eps)

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

GetOrthonormalized(issueWarning)

Returns an orthonormalized copy of the matrix.

GetRow(i)

Gets a row of the matrix as a Vec3.

GetTranspose()

Returns the transpose of the matrix.

IsLeftHanded()

Returns true if the vectors in matrix form a left-handed coordinate system.

IsRightHanded()

Returns true if the vectors in the matrix form a right-handed coordinate system.

Orthonormalize(issueWarning)

Makes the matrix orthonormal in place.

Set(m00, m01, m02, m10, m11, m12, m20, m21, m22)

Sets the matrix from 9 independent double values, specified in row-major order.

SetColumn(i, v)

Sets a column of the matrix from a Vec3.

SetDiagonal(s)

Sets the matrix to s times the identity matrix.

SetIdentity()

Sets the matrix to the identity matrix.

SetRotate(rot)

Sets the matrix to specify a rotation equivalent to rot.

SetRow(i, v)

Sets a row of the matrix from a Vec3.

SetScale(scaleFactors)

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

SetZero()

Sets the matrix to zero.

Attributes:

dimension

ExtractRotation() Rotation

Returns the rotation corresponding to this matrix.

This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

GetColumn(i) Vec3d

Gets a column of the matrix as a Vec3.

Parameters

i (int) –

GetDeterminant() float

Returns the determinant of the matrix.

GetHandedness() float

Returns the sign of the determinant of the matrix, i.e.

1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a singular matrix.

GetInverse(det, eps) Matrix3d

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

(FLT_MAX is the largest value a float can have, as defined by the system.) The matrix is considered singular if the determinant is less than or equal to the optional parameter eps. If det is non-null, \*det is set to the determinant.

Parameters
  • det (float) –

  • eps (float) –

GetOrthonormalized(issueWarning) Matrix3d

Returns an orthonormalized copy of the matrix.

Parameters

issueWarning (bool) –

GetRow(i) Vec3d

Gets a row of the matrix as a Vec3.

Parameters

i (int) –

GetTranspose() Matrix3d

Returns the transpose of the matrix.

IsLeftHanded() bool

Returns true if the vectors in matrix form a left-handed coordinate system.

IsRightHanded() bool

Returns true if the vectors in the matrix form a right-handed coordinate system.

Orthonormalize(issueWarning) bool

Makes the matrix orthonormal in place.

This is an iterative method that is much more stable than the previous cross/cross method. If the iterative method does not converge, a warning is issued.

Returns true if the iteration converged, false otherwise. Leaves any translation part of the matrix unchanged. If issueWarning is true, this method will issue a warning if the iteration does not converge, otherwise it will be silent.

Parameters

issueWarning (bool) –

Set(m00, m01, m02, m10, m11, m12, m20, m21, m22) Matrix3d

Sets the matrix from 9 independent double values, specified in row-major order.

For example, parameter m10 specifies the value in row 1 and column 0.

Parameters
  • m00 (float) –

  • m01 (float) –

  • m02 (float) –

  • m10 (float) –

  • m11 (float) –

  • m12 (float) –

  • m20 (float) –

  • m21 (float) –

  • m22 (float) –


Set(m) -> Matrix3d

Sets the matrix from a 3x3 array of double values, specified in row-major order.

Parameters

m (float) –

SetColumn(i, v) None

Sets a column of the matrix from a Vec3.

Parameters
  • i (int) –

  • v (Vec3d) –

SetDiagonal(s) Matrix3d

Sets the matrix to s times the identity matrix.

Parameters

s (float) –


SetDiagonal(arg1) -> Matrix3d

Sets the matrix to have diagonal ( v[0], v[1], v[2] ).

Parameters

arg1 (Vec3d) –

SetIdentity() Matrix3d

Sets the matrix to the identity matrix.

SetRotate(rot) Matrix3d

Sets the matrix to specify a rotation equivalent to rot.

Parameters

rot (Quatd) –


SetRotate(rot) -> Matrix3d

Sets the matrix to specify a rotation equivalent to rot.

Parameters

rot (Rotation) –

SetRow(i, v) None

Sets a row of the matrix from a Vec3.

Parameters
  • i (int) –

  • v (Vec3d) –

SetScale(scaleFactors) Matrix3d

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

Parameters

scaleFactors (Vec3d) –


SetScale(scaleFactor) -> Matrix3d

Sets matrix to specify a uniform scaling by scaleFactor.

Parameters

scaleFactor (float) –

SetZero() Matrix3d

Sets the matrix to zero.

dimension = (3, 3)
class pxr.Gf.Matrix3f

Methods:

ExtractRotation()

Returns the rotation corresponding to this matrix.

GetColumn(i)

Gets a column of the matrix as a Vec3.

GetDeterminant()

Returns the determinant of the matrix.

GetHandedness()

Returns the sign of the determinant of the matrix, i.e.

GetInverse(det, eps)

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

GetOrthonormalized(issueWarning)

Returns an orthonormalized copy of the matrix.

GetRow(i)

Gets a row of the matrix as a Vec3.

GetTranspose()

Returns the transpose of the matrix.

IsLeftHanded()

Returns true if the vectors in matrix form a left-handed coordinate system.

IsRightHanded()

Returns true if the vectors in the matrix form a right-handed coordinate system.

Orthonormalize(issueWarning)

Makes the matrix orthonormal in place.

Set(m00, m01, m02, m10, m11, m12, m20, m21, m22)

Sets the matrix from 9 independent float values, specified in row- major order.

SetColumn(i, v)

Sets a column of the matrix from a Vec3.

SetDiagonal(s)

Sets the matrix to s times the identity matrix.

SetIdentity()

Sets the matrix to the identity matrix.

SetRotate(rot)

Sets the matrix to specify a rotation equivalent to rot.

SetRow(i, v)

Sets a row of the matrix from a Vec3.

SetScale(scaleFactors)

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

SetZero()

Sets the matrix to zero.

Attributes:

dimension

ExtractRotation() Rotation

Returns the rotation corresponding to this matrix.

This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

GetColumn(i) Vec3f

Gets a column of the matrix as a Vec3.

Parameters

i (int) –

GetDeterminant() float

Returns the determinant of the matrix.

GetHandedness() float

Returns the sign of the determinant of the matrix, i.e.

1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a singular matrix.

GetInverse(det, eps) Matrix3f

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

(FLT_MAX is the largest value a float can have, as defined by the system.) The matrix is considered singular if the determinant is less than or equal to the optional parameter eps. If det is non-null, \*det is set to the determinant.

Parameters
  • det (float) –

  • eps (float) –

GetOrthonormalized(issueWarning) Matrix3f

Returns an orthonormalized copy of the matrix.

Parameters

issueWarning (bool) –

GetRow(i) Vec3f

Gets a row of the matrix as a Vec3.

Parameters

i (int) –

GetTranspose() Matrix3f

Returns the transpose of the matrix.

IsLeftHanded() bool

Returns true if the vectors in matrix form a left-handed coordinate system.

IsRightHanded() bool

Returns true if the vectors in the matrix form a right-handed coordinate system.

Orthonormalize(issueWarning) bool

Makes the matrix orthonormal in place.

This is an iterative method that is much more stable than the previous cross/cross method. If the iterative method does not converge, a warning is issued.

Returns true if the iteration converged, false otherwise. Leaves any translation part of the matrix unchanged. If issueWarning is true, this method will issue a warning if the iteration does not converge, otherwise it will be silent.

Parameters

issueWarning (bool) –

Set(m00, m01, m02, m10, m11, m12, m20, m21, m22) Matrix3f

Sets the matrix from 9 independent float values, specified in row- major order.

For example, parameter m10 specifies the value in row 1 and column 0.

Parameters
  • m00 (float) –

  • m01 (float) –

  • m02 (float) –

  • m10 (float) –

  • m11 (float) –

  • m12 (float) –

  • m20 (float) –

  • m21 (float) –

  • m22 (float) –


Set(m) -> Matrix3f

Sets the matrix from a 3x3 array of float values, specified in row-major order.

Parameters

m (float) –

SetColumn(i, v) None

Sets a column of the matrix from a Vec3.

Parameters
  • i (int) –

  • v (Vec3f) –

SetDiagonal(s) Matrix3f

Sets the matrix to s times the identity matrix.

Parameters

s (float) –


SetDiagonal(arg1) -> Matrix3f

Sets the matrix to have diagonal ( v[0], v[1], v[2] ).

Parameters

arg1 (Vec3f) –

SetIdentity() Matrix3f

Sets the matrix to the identity matrix.

SetRotate(rot) Matrix3f

Sets the matrix to specify a rotation equivalent to rot.

Parameters

rot (Quatf) –


SetRotate(rot) -> Matrix3f

Sets the matrix to specify a rotation equivalent to rot.

Parameters

rot (Rotation) –

SetRow(i, v) None

Sets a row of the matrix from a Vec3.

Parameters
  • i (int) –

  • v (Vec3f) –

SetScale(scaleFactors) Matrix3f

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

Parameters

scaleFactors (Vec3f) –


SetScale(scaleFactor) -> Matrix3f

Sets matrix to specify a uniform scaling by scaleFactor.

Parameters

scaleFactor (float) –

SetZero() Matrix3f

Sets the matrix to zero.

dimension = (3, 3)
class pxr.Gf.Matrix4d

Methods:

ExtractRotation()

Returns the rotation corresponding to this matrix.

ExtractRotationMatrix()

Returns the rotation corresponding to this matrix.

ExtractRotationQuat()

Return the rotation corresponding to this matrix as a quaternion.

ExtractTranslation()

Returns the translation part of the matrix, defined as the first three elements of the last row.

Factor(r, s, u, t, p, eps)

Factors the matrix into 5 components:

GetColumn(i)

Gets a column of the matrix as a Vec4.

GetDeterminant()

Returns the determinant of the matrix.

GetDeterminant3()

Returns the determinant of the upper 3x3 matrix.

GetHandedness()

Returns the sign of the determinant of the upper 3x3 matrix, i.e.

GetInverse(det, eps)

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

GetOrthonormalized(issueWarning)

Returns an orthonormalized copy of the matrix.

GetRow(i)

Gets a row of the matrix as a Vec4.

GetRow3(i)

Gets a row of the matrix as a Vec3.

GetTranspose()

Returns the transpose of the matrix.

HasOrthogonalRows3()

Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis.

IsLeftHanded()

Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.

IsRightHanded()

Returns true if the vectors in the upper 3x3 matrix form a right- handed coordinate system.

Orthonormalize(issueWarning)

Makes the matrix orthonormal in place.

RemoveScaleShear()

Returns the matrix with any scaling or shearing removed, leaving only the rotation and translation.

Set(m00, m01, m02, m03, m10, m11, m12, m13, ...)

Sets the matrix from 16 independent double values, specified in row-major order.

SetColumn(i, v)

Sets a column of the matrix from a Vec4.

SetDiagonal(s)

Sets the matrix to s times the identity matrix.

SetIdentity()

Sets the matrix to the identity matrix.

SetLookAt(eyePoint, centerPoint, upDirection)

Sets the matrix to specify a viewing matrix from parameters similar to those used by gluLookAt(3G) .

SetRotate(rot)

Sets the matrix to specify a rotation equivalent to rot, and clears the translation.

SetRotateOnly(rot)

Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.

SetRow(i, v)

Sets a row of the matrix from a Vec4.

SetRow3(i, v)

Sets a row of the matrix from a Vec3.

SetScale(scaleFactors)

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

SetTransform(rotate, translate)

Sets matrix to specify a rotation by rotate and a translation by translate.

SetTranslate(trans)

Sets matrix to specify a translation by the vector trans, and clears the rotation.

SetTranslateOnly(t)

Sets matrix to specify a translation by the vector trans, without clearing the rotation.

SetZero()

Sets the matrix to zero.

Transform(vec)

Transforms the row vector vec by the matrix, returning the result.

TransformAffine(vec)

Transforms the row vector vec by the matrix, returning the result.

TransformDir(vec)

Transforms row vector vec by the matrix, returning the result.

Attributes:

dimension

ExtractRotation() Rotation

Returns the rotation corresponding to this matrix.

This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

ExtractRotationMatrix() Matrix3d

Returns the rotation corresponding to this matrix.

This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

ExtractRotationQuat() Quatd

Return the rotation corresponding to this matrix as a quaternion.

This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

ExtractTranslation() Vec3d

Returns the translation part of the matrix, defined as the first three elements of the last row.

Factor(r, s, u, t, p, eps) bool

Factors the matrix into 5 components:

  • *M* = r \* s \* -r \* u \* t where

  • t is a translation.

  • u and r are rotations, and -r is the transpose (inverse) of r. The u matrix may contain shear information.

  • s is a scale. Any projection information could be returned in matrix p, but currently p is never modified. Returns false if the matrix is singular (as determined by eps). In that case, any zero scales in s are clamped to eps to allow computation of u.

Parameters
GetColumn(i) Vec4d

Gets a column of the matrix as a Vec4.

Parameters

i (int) –

GetDeterminant() float

Returns the determinant of the matrix.

GetDeterminant3() float

Returns the determinant of the upper 3x3 matrix.

This method is useful when the matrix describes a linear transformation such as a rotation or scale because the other values in the 4x4 matrix are not important.

GetHandedness() float

Returns the sign of the determinant of the upper 3x3 matrix, i.e.

1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a singular matrix.

GetInverse(det, eps) Matrix4d

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

(FLT_MAX is the largest value a float can have, as defined by the system.) The matrix is considered singular if the determinant is less than or equal to the optional parameter eps. If det is non-null, \*det is set to the determinant.

Parameters
  • det (float) –

  • eps (float) –

GetOrthonormalized(issueWarning) Matrix4d

Returns an orthonormalized copy of the matrix.

Parameters

issueWarning (bool) –

GetRow(i) Vec4d

Gets a row of the matrix as a Vec4.

Parameters

i (int) –

GetRow3(i) Vec3d

Gets a row of the matrix as a Vec3.

Parameters

i (int) –

GetTranspose() Matrix4d

Returns the transpose of the matrix.

HasOrthogonalRows3() bool

Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis.

Note they do not have to be unit length for this test to return true.

IsLeftHanded() bool

Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.

IsRightHanded() bool

Returns true if the vectors in the upper 3x3 matrix form a right- handed coordinate system.

Orthonormalize(issueWarning) bool

Makes the matrix orthonormal in place.

This is an iterative method that is much more stable than the previous cross/cross method. If the iterative method does not converge, a warning is issued.

Returns true if the iteration converged, false otherwise. Leaves any translation part of the matrix unchanged. If issueWarning is true, this method will issue a warning if the iteration does not converge, otherwise it will be silent.

Parameters

issueWarning (bool) –

RemoveScaleShear() Matrix4d

Returns the matrix with any scaling or shearing removed, leaving only the rotation and translation.

If the matrix cannot be decomposed, returns the original matrix.

Set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) Matrix4d

Sets the matrix from 16 independent double values, specified in row-major order.

For example, parameter m10 specifies the value in row 1 and column 0.

Parameters
  • m00 (float) –

  • m01 (float) –

  • m02 (float) –

  • m03 (float) –

  • m10 (float) –

  • m11 (float) –

  • m12 (float) –

  • m13 (float) –

  • m20 (float) –

  • m21 (float) –

  • m22 (float) –

  • m23 (float) –

  • m30 (float) –

  • m31 (float) –

  • m32 (float) –

  • m33 (float) –


Set(m) -> Matrix4d

Sets the matrix from a 4x4 array of double values, specified in row-major order.

Parameters

m (float) –

SetColumn(i, v) None

Sets a column of the matrix from a Vec4.

Parameters
  • i (int) –

  • v (Vec4d) –

SetDiagonal(s) Matrix4d

Sets the matrix to s times the identity matrix.

Parameters

s (float) –


SetDiagonal(arg1) -> Matrix4d

Sets the matrix to have diagonal ( v[0], v[1], v[2], v[3] ).

Parameters

arg1 (Vec4d) –

SetIdentity() Matrix4d

Sets the matrix to the identity matrix.

SetLookAt(eyePoint, centerPoint, upDirection) Matrix4d

Sets the matrix to specify a viewing matrix from parameters similar to those used by gluLookAt(3G) .

eyePoint represents the eye point in world space. centerPoint represents the world-space center of attention. upDirection is a vector indicating which way is up.

Parameters

SetLookAt(eyePoint, orientation) -> Matrix4d

Sets the matrix to specify a viewing matrix from a world-space eyePoint and a world-space rotation that rigidly rotates the orientation from its canonical frame, which is defined to be looking along the -z axis with the +y axis as the up direction.

Parameters
SetRotate(rot) Matrix4d

Sets the matrix to specify a rotation equivalent to rot, and clears the translation.

Parameters

rot (Quatd) –


SetRotate(rot) -> Matrix4d

Sets the matrix to specify a rotation equivalent to rot, and clears the translation.

Parameters

rot (Rotation) –


SetRotate(mx) -> Matrix4d

Sets the matrix to specify a rotation equivalent to mx, and clears the translation.

Parameters

mx (Matrix3d) –

SetRotateOnly(rot) Matrix4d

Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.

Parameters

rot (Quatd) –


SetRotateOnly(rot) -> Matrix4d

Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.

Parameters

rot (Rotation) –


SetRotateOnly(mx) -> Matrix4d

Sets the matrix to specify a rotation equivalent to mx, without clearing the translation.

Parameters

mx (Matrix3d) –

SetRow(i, v) None

Sets a row of the matrix from a Vec4.

Parameters
  • i (int) –

  • v (Vec4d) –

SetRow3(i, v) None

Sets a row of the matrix from a Vec3.

The fourth element of the row is ignored.

Parameters
  • i (int) –

  • v (Vec3d) –

SetScale(scaleFactors) Matrix4d

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

Parameters

scaleFactors (Vec3d) –


SetScale(scaleFactor) -> Matrix4d

Sets matrix to specify a uniform scaling by scaleFactor.

Parameters

scaleFactor (float) –

SetTransform(rotate, translate) Matrix4d

Sets matrix to specify a rotation by rotate and a translation by translate.

Parameters

SetTransform(rotmx, translate) -> Matrix4d

Sets matrix to specify a rotation by rotmx and a translation by translate.

Parameters
SetTranslate(trans) Matrix4d

Sets matrix to specify a translation by the vector trans, and clears the rotation.

Parameters

trans (Vec3d) –

SetTranslateOnly(t) Matrix4d

Sets matrix to specify a translation by the vector trans, without clearing the rotation.

Parameters

t (Vec3d) –

SetZero() Matrix4d

Sets the matrix to zero.

Transform(vec) Vec3d

Transforms the row vector vec by the matrix, returning the result.

This treats the vector as a 4-component vector whose fourth component is 1.

Parameters

vec (Vec3d) –


Transform(vec) -> Vec3f

Transforms the row vector vec by the matrix, returning the result.

This treats the vector as a 4-component vector whose fourth component is 1. This is an overloaded method; it differs from the other version in that it returns a different value type.

Parameters

vec (Vec3f) –

TransformAffine(vec) Vec3d

Transforms the row vector vec by the matrix, returning the result.

This treats the vector as a 4-component vector whose fourth component is 1 and ignores the fourth column of the matrix (i.e. assumes it is (0, 0, 0, 1)).

Parameters

vec (Vec3d) –


TransformAffine(vec) -> Vec3f

Transforms the row vector vec by the matrix, returning the result.

This treats the vector as a 4-component vector whose fourth component is 1 and ignores the fourth column of the matrix (i.e. assumes it is (0, 0, 0, 1)).

Parameters

vec (Vec3f) –

TransformDir(vec) Vec3d

Transforms row vector vec by the matrix, returning the result.

This treats the vector as a direction vector, so the translation information in the matrix is ignored. That is, it treats the vector as a 4-component vector whose fourth component is 0.

Parameters

vec (Vec3d) –


TransformDir(vec) -> Vec3f

Transforms row vector vec by the matrix, returning the result.

This treats the vector as a direction vector, so the translation information in the matrix is ignored. That is, it treats the vector as a 4-component vector whose fourth component is 0. This is an overloaded method; it differs from the other version in that it returns a different value type.

Parameters

vec (Vec3f) –

dimension = (4, 4)
class pxr.Gf.Matrix4f

Methods:

ExtractRotation()

Returns the rotation corresponding to this matrix.

ExtractRotationMatrix()

Returns the rotation corresponding to this matrix.

ExtractRotationQuat()

Return the rotation corresponding to this matrix as a quaternion.

ExtractTranslation()

Returns the translation part of the matrix, defined as the first three elements of the last row.

Factor(r, s, u, t, p, eps)

Factors the matrix into 5 components:

GetColumn(i)

Gets a column of the matrix as a Vec4.

GetDeterminant()

Returns the determinant of the matrix.

GetDeterminant3()

Returns the determinant of the upper 3x3 matrix.

GetHandedness()

Returns the sign of the determinant of the upper 3x3 matrix, i.e.

GetInverse(det, eps)

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

GetOrthonormalized(issueWarning)

Returns an orthonormalized copy of the matrix.

GetRow(i)

Gets a row of the matrix as a Vec4.

GetRow3(i)

Gets a row of the matrix as a Vec3.

GetTranspose()

Returns the transpose of the matrix.

HasOrthogonalRows3()

Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis.

IsLeftHanded()

Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.

IsRightHanded()

Returns true if the vectors in the upper 3x3 matrix form a right- handed coordinate system.

Orthonormalize(issueWarning)

Makes the matrix orthonormal in place.

RemoveScaleShear()

Returns the matrix with any scaling or shearing removed, leaving only the rotation and translation.

Set(m00, m01, m02, m03, m10, m11, m12, m13, ...)

Sets the matrix from 16 independent float values, specified in row-major order.

SetColumn(i, v)

Sets a column of the matrix from a Vec4.

SetDiagonal(s)

Sets the matrix to s times the identity matrix.

SetIdentity()

Sets the matrix to the identity matrix.

SetLookAt(eyePoint, centerPoint, upDirection)

Sets the matrix to specify a viewing matrix from parameters similar to those used by gluLookAt(3G) .

SetRotate(rot)

Sets the matrix to specify a rotation equivalent to rot, and clears the translation.

SetRotateOnly(rot)

Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.

SetRow(i, v)

Sets a row of the matrix from a Vec4.

SetRow3(i, v)

Sets a row of the matrix from a Vec3.

SetScale(scaleFactors)

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

SetTransform(rotate, translate)

Sets matrix to specify a rotation by rotate and a translation by translate.

SetTranslate(trans)

Sets matrix to specify a translation by the vector trans, and clears the rotation.

SetTranslateOnly(t)

Sets matrix to specify a translation by the vector trans, without clearing the rotation.

SetZero()

Sets the matrix to zero.

Transform(vec)

Transforms the row vector vec by the matrix, returning the result.

TransformAffine(vec)

Transforms the row vector vec by the matrix, returning the result.

TransformDir(vec)

Transforms row vector vec by the matrix, returning the result.

Attributes:

dimension

ExtractRotation() Rotation

Returns the rotation corresponding to this matrix.

This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

ExtractRotationMatrix() Matrix3f

Returns the rotation corresponding to this matrix.

This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

ExtractRotationQuat() Quatf

Return the rotation corresponding to this matrix as a quaternion.

This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

ExtractTranslation() Vec3f

Returns the translation part of the matrix, defined as the first three elements of the last row.

Factor(r, s, u, t, p, eps) bool

Factors the matrix into 5 components:

  • *M* = r \* s \* -r \* u \* t where

  • t is a translation.

  • u and r are rotations, and -r is the transpose (inverse) of r. The u matrix may contain shear information.

  • s is a scale. Any projection information could be returned in matrix p, but currently p is never modified. Returns false if the matrix is singular (as determined by eps). In that case, any zero scales in s are clamped to eps to allow computation of u.

Parameters
GetColumn(i) Vec4f

Gets a column of the matrix as a Vec4.

Parameters

i (int) –

GetDeterminant() float

Returns the determinant of the matrix.

GetDeterminant3() float

Returns the determinant of the upper 3x3 matrix.

This method is useful when the matrix describes a linear transformation such as a rotation or scale because the other values in the 4x4 matrix are not important.

GetHandedness() float

Returns the sign of the determinant of the upper 3x3 matrix, i.e.

1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a singular matrix.

GetInverse(det, eps) Matrix4f

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular.

(FLT_MAX is the largest value a float can have, as defined by the system.) The matrix is considered singular if the determinant is less than or equal to the optional parameter eps. If det is non-null, \*det is set to the determinant.

Parameters
  • det (float) –

  • eps (float) –

GetOrthonormalized(issueWarning) Matrix4f

Returns an orthonormalized copy of the matrix.

Parameters

issueWarning (bool) –

GetRow(i) Vec4f

Gets a row of the matrix as a Vec4.

Parameters

i (int) –

GetRow3(i) Vec3f

Gets a row of the matrix as a Vec3.

Parameters

i (int) –

GetTranspose() Matrix4f

Returns the transpose of the matrix.

HasOrthogonalRows3() bool

Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis.

Note they do not have to be unit length for this test to return true.

IsLeftHanded() bool

Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.

IsRightHanded() bool

Returns true if the vectors in the upper 3x3 matrix form a right- handed coordinate system.

Orthonormalize(issueWarning) bool

Makes the matrix orthonormal in place.

This is an iterative method that is much more stable than the previous cross/cross method. If the iterative method does not converge, a warning is issued.

Returns true if the iteration converged, false otherwise. Leaves any translation part of the matrix unchanged. If issueWarning is true, this method will issue a warning if the iteration does not converge, otherwise it will be silent.

Parameters

issueWarning (bool) –

RemoveScaleShear() Matrix4f

Returns the matrix with any scaling or shearing removed, leaving only the rotation and translation.

If the matrix cannot be decomposed, returns the original matrix.

Set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) Matrix4f

Sets the matrix from 16 independent float values, specified in row-major order.

For example, parameter m10 specifies the value in row1 and column 0.

Parameters
  • m00 (float) –

  • m01 (float) –

  • m02 (float) –

  • m03 (float) –

  • m10 (float) –

  • m11 (float) –

  • m12 (float) –

  • m13 (float) –

  • m20 (float) –

  • m21 (float) –

  • m22 (float) –

  • m23 (float) –

  • m30 (float) –

  • m31 (float) –

  • m32 (float) –

  • m33 (float) –


Set(m) -> Matrix4f

Sets the matrix from a 4x4 array of float values, specified in row-major order.

Parameters

m (float) –

SetColumn(i, v) None

Sets a column of the matrix from a Vec4.

Parameters
  • i (int) –

  • v (Vec4f) –

SetDiagonal(s) Matrix4f

Sets the matrix to s times the identity matrix.

Parameters

s (float) –


SetDiagonal(arg1) -> Matrix4f

Sets the matrix to have diagonal ( v[0], v[1], v[2], v[3] ).

Parameters

arg1 (Vec4f) –

SetIdentity() Matrix4f

Sets the matrix to the identity matrix.

SetLookAt(eyePoint, centerPoint, upDirection) Matrix4f

Sets the matrix to specify a viewing matrix from parameters similar to those used by gluLookAt(3G) .

eyePoint represents the eye point in world space. centerPoint represents the world-space center of attention. upDirection is a vector indicating which way is up.

Parameters

SetLookAt(eyePoint, orientation) -> Matrix4f

Sets the matrix to specify a viewing matrix from a world-space eyePoint and a world-space rotation that rigidly rotates the orientation from its canonical frame, which is defined to be looking along the -z axis with the +y axis as the up direction.

Parameters
SetRotate(rot) Matrix4f

Sets the matrix to specify a rotation equivalent to rot, and clears the translation.

Parameters

rot (Quatf) –


SetRotate(rot) -> Matrix4f

Sets the matrix to specify a rotation equivalent to rot, and clears the translation.

Parameters

rot (Rotation) –


SetRotate(mx) -> Matrix4f

Sets the matrix to specify a rotation equivalent to mx, and clears the translation.

Parameters

mx (Matrix3f) –

SetRotateOnly(rot) Matrix4f

Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.

Parameters

rot (Quatf) –


SetRotateOnly(rot) -> Matrix4f

Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.

Parameters

rot (Rotation) –


SetRotateOnly(mx) -> Matrix4f

Sets the matrix to specify a rotation equivalent to mx, without clearing the translation.

Parameters

mx (Matrix3f) –

SetRow(i, v) None

Sets a row of the matrix from a Vec4.

Parameters
  • i (int) –

  • v (Vec4f) –

SetRow3(i, v) None

Sets a row of the matrix from a Vec3.

The fourth element of the row is ignored.

Parameters
  • i (int) –

  • v (Vec3f) –

SetScale(scaleFactors) Matrix4f

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

Parameters

scaleFactors (Vec3f) –


SetScale(scaleFactor) -> Matrix4f

Sets matrix to specify a uniform scaling by scaleFactor.

Parameters

scaleFactor (float) –

SetTransform(rotate, translate) Matrix4f

Sets matrix to specify a rotation by rotate and a translation by translate.

Parameters

SetTransform(rotmx, translate) -> Matrix4f

Sets matrix to specify a rotation by rotmx and a translation by translate.

Parameters
SetTranslate(trans) Matrix4f

Sets matrix to specify a translation by the vector trans, and clears the rotation.

Parameters

trans (Vec3f) –

SetTranslateOnly(t) Matrix4f

Sets matrix to specify a translation by the vector trans, without clearing the rotation.

Parameters

t (Vec3f) –

SetZero() Matrix4f

Sets the matrix to zero.

Transform(vec) Vec3d

Transforms the row vector vec by the matrix, returning the result.

This treats the vector as a 4-component vector whose fourth component is 1.

Parameters

vec (Vec3d) –


Transform(vec) -> Vec3f

Transforms the row vector vec by the matrix, returning the result.

This treats the vector as a 4-component vector whose fourth component is 1. This is an overloaded method; it differs from the other version in that it returns a different value type.

Parameters

vec (Vec3f) –

TransformAffine(vec) Vec3d

Transforms the row vector vec by the matrix, returning the result.

This treats the vector as a 4-component vector whose fourth component is 1 and ignores the fourth column of the matrix (i.e. assumes it is (0, 0, 0, 1)).

Parameters

vec (Vec3d) –


TransformAffine(vec) -> Vec3f

Transforms the row vector vec by the matrix, returning the result.

This treats the vector as a 4-component vector whose fourth component is 1 and ignores the fourth column of the matrix (i.e. assumes it is (0, 0, 0, 1)).

Parameters

vec (Vec3f) –

TransformDir(vec) Vec3d

Transforms row vector vec by the matrix, returning the result.

This treats the vector as a direction vector, so the translation information in the matrix is ignored. That is, it treats the vector as a 4-component vector whose fourth component is 0.

Parameters

vec (Vec3d) –


TransformDir(vec) -> Vec3f

Transforms row vector vec by the matrix, returning the result.

This treats the vector as a direction vector, so the translation information in the matrix is ignored. That is, it treats the vector as a 4-component vector whose fourth component is 0. This is an overloaded method; it differs from the other version in that it returns a different value type.

Parameters

vec (Vec3f) –

dimension = (4, 4)
class pxr.Gf.MultiInterval

Methods:

Add(i)

Add the given interval to the multi-interval.

ArithmeticAdd(i)

Uses the given interval to extend the multi-interval in the interval arithmetic sense.

Clear()

Clear the multi-interval.

Contains

Returns true if x is inside the multi-interval.

GetBounds()

Returns an interval bounding the entire multi-interval.

GetComplement()

Return the complement of this set.

GetFullInterval

classmethod GetFullInterval() -> MultiInterval

GetSize()

Returns the number of intervals in the set.

Intersect(i)

param i

IsEmpty()

Returns true if the multi-interval is empty.

Remove(i)

Remove the given interval from this multi-interval.

Attributes:

bounds

isEmpty

size

Add(i) None

Add the given interval to the multi-interval.

Parameters

i (Interval) –


Add(s) -> None

Add the given multi-interval to the multi-interval.

Sets this object to the union of the two sets.

Parameters

s (MultiInterval) –

ArithmeticAdd(i) None

Uses the given interval to extend the multi-interval in the interval arithmetic sense.

Parameters

i (Interval) –

Clear() None

Clear the multi-interval.

Contains()

Returns true if x is inside the multi-interval.

Returns true if x is inside the multi-interval.

Returns true if x is inside the multi-interval.

GetBounds() Interval

Returns an interval bounding the entire multi-interval.

Returns an empty interval if the multi-interval is empty.

GetComplement() MultiInterval

Return the complement of this set.

static GetFullInterval()

classmethod GetFullInterval() -> MultiInterval

Returns the full interval (-inf, inf).

GetSize() int

Returns the number of intervals in the set.

Intersect(i) None
Parameters

i (Interval) –


Intersect(s) -> None

Parameters

s (MultiInterval) –

IsEmpty() bool

Returns true if the multi-interval is empty.

Remove(i) None

Remove the given interval from this multi-interval.

Parameters

i (Interval) –


Remove(s) -> None

Remove the given multi-interval from this multi-interval.

Parameters

s (MultiInterval) –

property bounds
property isEmpty
property size
class pxr.Gf.Plane

Methods:

GetDistance(p)

Returns the distance of point from the plane.

GetDistanceFromOrigin()

Returns the distance of the plane from the origin.

GetEquation()

Give the coefficients of the equation of the plane.

GetNormal()

Returns the unit-length normal vector of the plane.

IntersectsPositiveHalfSpace(box)

Returns true if the given aligned bounding box is at least partially on the positive side (the one the normal points into) of the plane.

Project(p)

Return the projection of p onto the plane.

Reorient(p)

Flip the plane normal (if necessary) so that p is in the positive halfspace.

Set(normal, distanceToOrigin)

Sets this to the plane perpendicular to normal and at distance units from the origin.

Transform(matrix)

Transforms the plane by the given matrix.

Attributes:

distanceFromOrigin

normal

GetDistance(p) float

Returns the distance of point from the plane.

This distance will be positive if the point is on the side of the plane containing the normal.

Parameters

p (Vec3d) –

GetDistanceFromOrigin() float

Returns the distance of the plane from the origin.

GetEquation() Vec4d

Give the coefficients of the equation of the plane.

Suitable to OpenGL calls to set the clipping plane.

GetNormal() Vec3d

Returns the unit-length normal vector of the plane.

IntersectsPositiveHalfSpace(box) bool

Returns true if the given aligned bounding box is at least partially on the positive side (the one the normal points into) of the plane.

Parameters

box (Range3d) –


IntersectsPositiveHalfSpace(pt) -> bool

Returns true if the given point is on the plane or within its positive half space.

Parameters

pt (Vec3d) –

Project(p) Vec3d

Return the projection of p onto the plane.

Parameters

p (Vec3d) –

Reorient(p) None

Flip the plane normal (if necessary) so that p is in the positive halfspace.

Parameters

p (Vec3d) –

Set(normal, distanceToOrigin) None

Sets this to the plane perpendicular to normal and at distance units from the origin.

The passed-in normal is normalized to unit length first.

Parameters
  • normal (Vec3d) –

  • distanceToOrigin (float) –


Set(normal, point) -> None

This constructor sets this to the plane perpendicular to normal and that passes through point .

The passed-in normal is normalized to unit length first.

Parameters

Set(p0, p1, p2) -> None

This constructor sets this to the plane that contains the three given points.

The normal is constructed from the cross product of ( p1 - p0 ) ( p2 - p0 ). Results are undefined if the points are collinear.

Parameters

Set(eqn) -> None

This method sets this to the plane given by the equation eqn [0] * x + eqn [1] * y + eqn [2] * z + eqn [3] = 0.

Parameters

eqn (Vec4d) –

Transform(matrix) Plane

Transforms the plane by the given matrix.

Parameters

matrix (Matrix4d) –

property distanceFromOrigin
property normal
class pxr.Gf.Quatd

Methods:

GetConjugate()

Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.

GetIdentity

classmethod GetIdentity() -> Quatd

GetImaginary()

Return the imaginary coefficient.

GetInverse()

Return this quaternion's inverse, or reciprocal.

GetLength()

Return geometric length of this quaternion.

GetNormalized(eps)

length of this quaternion is smaller than eps , return the identity quaternion.

GetReal()

Return the real coefficient.

GetZero

classmethod GetZero() -> Quatd

Normalize(eps)

Normalizes this quaternion in place to unit length, returning the length before normalization.

SetImaginary(imaginary)

Set the imaginary coefficients.

SetReal(real)

Set the real coefficient.

Transform(point)

Transform the GfVec3d point.

Attributes:

imaginary

real

GetConjugate() Quatd

Return this quaternion’s conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.

static GetIdentity()

classmethod GetIdentity() -> Quatd

Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero.

GetImaginary() Vec3d

Return the imaginary coefficient.

GetInverse() Quatd

Return this quaternion’s inverse, or reciprocal.

This is the quaternion’s conjugate divided by it’s squared length.

GetLength() float

Return geometric length of this quaternion.

GetNormalized(eps) Quatd

length of this quaternion is smaller than eps , return the identity quaternion.

Parameters

eps (float) –

GetReal() float

Return the real coefficient.

static GetZero()

classmethod GetZero() -> Quatd

Return the zero quaternion, with real coefficient 0 and an imaginary coefficients all zero.

Normalize(eps) float

Normalizes this quaternion in place to unit length, returning the length before normalization.

If the length of this quaternion is smaller than eps , this sets the quaternion to identity.

Parameters

eps (float) –

SetImaginary(imaginary) None

Set the imaginary coefficients.

Parameters

imaginary (Vec3d) –


SetImaginary(i, j, k) -> None

Set the imaginary coefficients.

Parameters
  • i (float) –

  • j (float) –

  • k (float) –

SetReal(real) None

Set the real coefficient.

Parameters

real (float) –

Transform(point) Vec3d

Transform the GfVec3d point.

If the quaternion is normalized, the transformation is a rotation. Given a GfQuatd q, q.Transform(point) is equivalent to: (q * GfQuatd(0, point) * q.GetInverse()).GetImaginary()

but is more efficient.

Parameters

point (Vec3d) –

property imaginary
property real
class pxr.Gf.Quaternion

Quaternion class

Methods:

GetIdentity

classmethod GetIdentity() -> Quaternion

GetImaginary()

Returns the imaginary part of the quaternion.

GetInverse()

Returns the inverse of this quaternion.

GetLength()

Returns geometric length of this quaternion.

GetNormalized(eps)

Returns a normalized (unit-length) version of this quaternion.

GetReal()

Returns the real part of the quaternion.

GetZero

classmethod GetZero() -> Quaternion

Normalize(eps)

Normalizes this quaternion in place to unit length, returning the length before normalization.

Attributes:

imaginary

None

real

None

static GetIdentity()

classmethod GetIdentity() -> Quaternion

Returns the identity quaternion, which has a real part of 1 and an imaginary part of (0,0,0).

GetImaginary() Vec3d

Returns the imaginary part of the quaternion.

GetInverse() Quaternion

Returns the inverse of this quaternion.

GetLength() float

Returns geometric length of this quaternion.

GetNormalized(eps) Quaternion

Returns a normalized (unit-length) version of this quaternion.

direction as this. If the length of this quaternion is smaller than eps , this returns the identity quaternion.

Parameters

eps (float) –

GetReal() float

Returns the real part of the quaternion.

static GetZero()

classmethod GetZero() -> Quaternion

Returns the zero quaternion, which has a real part of 0 and an imaginary part of (0,0,0).

Normalize(eps) float

Normalizes this quaternion in place to unit length, returning the length before normalization.

If the length of this quaternion is smaller than eps , this sets the quaternion to identity.

Parameters

eps (float) –

property imaginary

None

Sets the imaginary part of the quaternion.

Type

type

property real

None

Sets the real part of the quaternion.

Type

type

class pxr.Gf.Quatf

Methods:

GetConjugate()

Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.

GetIdentity

classmethod GetIdentity() -> Quatf

GetImaginary()

Return the imaginary coefficient.

GetInverse()

Return this quaternion's inverse, or reciprocal.

GetLength()

Return geometric length of this quaternion.

GetNormalized(eps)

length of this quaternion is smaller than eps , return the identity quaternion.

GetReal()

Return the real coefficient.

GetZero

classmethod GetZero() -> Quatf

Normalize(eps)

Normalizes this quaternion in place to unit length, returning the length before normalization.

SetImaginary(imaginary)

Set the imaginary coefficients.

SetReal(real)

Set the real coefficient.

Transform(point)

Transform the GfVec3f point.

Attributes:

imaginary

real

GetConjugate() Quatf

Return this quaternion’s conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.

static GetIdentity()

classmethod GetIdentity() -> Quatf

Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero.

GetImaginary() Vec3f

Return the imaginary coefficient.

GetInverse() Quatf

Return this quaternion’s inverse, or reciprocal.

This is the quaternion’s conjugate divided by it’s squared length.

GetLength() float

Return geometric length of this quaternion.

GetNormalized(eps) Quatf

length of this quaternion is smaller than eps , return the identity quaternion.

Parameters

eps (float) –

GetReal() float

Return the real coefficient.

static GetZero()

classmethod GetZero() -> Quatf

Return the zero quaternion, with real coefficient 0 and an imaginary coefficients all zero.

Normalize(eps) float

Normalizes this quaternion in place to unit length, returning the length before normalization.

If the length of this quaternion is smaller than eps , this sets the quaternion to identity.

Parameters

eps (float) –

SetImaginary(imaginary) None

Set the imaginary coefficients.

Parameters

imaginary (Vec3f) –


SetImaginary(i, j, k) -> None

Set the imaginary coefficients.

Parameters
  • i (float) –

  • j (float) –

  • k (float) –

SetReal(real) None

Set the real coefficient.

Parameters

real (float) –

Transform(point) Vec3f

Transform the GfVec3f point.

If the quaternion is normalized, the transformation is a rotation. Given a GfQuatf q, q.Transform(point) is equivalent to: (q * GfQuatf(0, point) * q.GetInverse()).GetImaginary()

but is more efficient.

Parameters

point (Vec3f) –

property imaginary
property real
class pxr.Gf.Quath

Methods:

GetConjugate()

Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.

GetIdentity

classmethod GetIdentity() -> Quath

GetImaginary()

Return the imaginary coefficient.

GetInverse()

Return this quaternion's inverse, or reciprocal.

GetLength()

Return geometric length of this quaternion.

GetNormalized(eps)

length of this quaternion is smaller than eps , return the identity quaternion.

GetReal()

Return the real coefficient.

GetZero

classmethod GetZero() -> Quath

Normalize(eps)

Normalizes this quaternion in place to unit length, returning the length before normalization.

SetImaginary(imaginary)

Set the imaginary coefficients.

SetReal(real)

Set the real coefficient.

Transform(point)

Transform the GfVec3h point.

Attributes:

imaginary

real

GetConjugate() Quath

Return this quaternion’s conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.

static GetIdentity()

classmethod GetIdentity() -> Quath

Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero.

GetImaginary() Vec3h

Return the imaginary coefficient.

GetInverse() Quath

Return this quaternion’s inverse, or reciprocal.

This is the quaternion’s conjugate divided by it’s squared length.

GetLength() GfHalf

Return geometric length of this quaternion.

GetNormalized(eps) Quath

length of this quaternion is smaller than eps , return the identity quaternion.

Parameters

eps (GfHalf) –

GetReal() GfHalf

Return the real coefficient.

static GetZero()

classmethod GetZero() -> Quath

Return the zero quaternion, with real coefficient 0 and an imaginary coefficients all zero.

Normalize(eps) GfHalf

Normalizes this quaternion in place to unit length, returning the length before normalization.

If the length of this quaternion is smaller than eps , this sets the quaternion to identity.

Parameters

eps (GfHalf) –

SetImaginary(imaginary) None

Set the imaginary coefficients.

Parameters

imaginary (Vec3h) –


SetImaginary(i, j, k) -> None

Set the imaginary coefficients.

Parameters
  • i (GfHalf) –

  • j (GfHalf) –

  • k (GfHalf) –

SetReal(real) None

Set the real coefficient.

Parameters

real (GfHalf) –

Transform(point) Vec3h

Transform the GfVec3h point.

If the quaternion is normalized, the transformation is a rotation. Given a GfQuath q, q.Transform(point) is equivalent to: (q * GfQuath(0, point) * q.GetInverse()).GetImaginary()

but is more efficient.

Parameters

point (Vec3h) –

property imaginary
property real
class pxr.Gf.Range1d

Methods:

Contains(point)

Returns true if the point is located inside the range.

GetDistanceSquared(p)

Compute the squared distance from a point to the range.

GetIntersection

classmethod GetIntersection(a, b) -> Range1d

GetMax()

Returns the maximum value of the range.

GetMidpoint()

Returns the midpoint of the range, that is, 0.5*(min+max).

GetMin()

Returns the minimum value of the range.

GetSize()

Returns the size of the range.

GetUnion

classmethod GetUnion(a, b) -> Range1d

IntersectWith(b)

Modifies this range to hold its intersection with b and returns the result.

IsEmpty()

Returns whether the range is empty (max<min).

SetEmpty()

Sets the range to an empty interval.

SetMax(max)

Sets the maximum value of the range.

SetMin(min)

Sets the minimum value of the range.

UnionWith(b)

Extend this to include b .

Attributes:

dimension

max

min

Contains(point) bool

Returns true if the point is located inside the range.

As with all operations of this type, the range is assumed to include its extrema.

Parameters

point (float) –


Contains(range) -> bool

Returns true if the range is located entirely inside the range.

As with all operations of this type, the ranges are assumed to include their extrema.

Parameters

range (Range1d) –

GetDistanceSquared(p) float

Compute the squared distance from a point to the range.

Parameters

p (float) –

static GetIntersection()

classmethod GetIntersection(a, b) -> Range1d

Returns a GfRange1d that describes the intersection of a and b .

Parameters
GetMax() float

Returns the maximum value of the range.

GetMidpoint() float

Returns the midpoint of the range, that is, 0.5*(min+max).

Note: this returns zero in the case of default-constructed ranges, or ranges set via SetEmpty() .

GetMin() float

Returns the minimum value of the range.

GetSize() float

Returns the size of the range.

static GetUnion()

classmethod GetUnion(a, b) -> Range1d

Returns the smallest GfRange1d which contains both a and b .

Parameters
IntersectWith(b) Range1d

Modifies this range to hold its intersection with b and returns the result.

Parameters

b (Range1d) –

IsEmpty() bool

Returns whether the range is empty (max<min).

SetEmpty() None

Sets the range to an empty interval.

SetMax(max) None

Sets the maximum value of the range.

Parameters

max (float) –

SetMin(min) None

Sets the minimum value of the range.

Parameters

min (float) –

UnionWith(b) Range1d

Extend this to include b .

Parameters

b (Range1d) –


UnionWith(b) -> Range1d

Extend this to include b .

Parameters

b (float) –

dimension = 1
property max
property min
class pxr.Gf.Range1f

Methods:

Contains(point)

Returns true if the point is located inside the range.

GetDistanceSquared(p)

Compute the squared distance from a point to the range.

GetIntersection

classmethod GetIntersection(a, b) -> Range1f

GetMax()

Returns the maximum value of the range.

GetMidpoint()

Returns the midpoint of the range, that is, 0.5*(min+max).

GetMin()

Returns the minimum value of the range.

GetSize()

Returns the size of the range.

GetUnion

classmethod GetUnion(a, b) -> Range1f

IntersectWith(b)

Modifies this range to hold its intersection with b and returns the result.

IsEmpty()

Returns whether the range is empty (max<min).

SetEmpty()

Sets the range to an empty interval.

SetMax(max)

Sets the maximum value of the range.

SetMin(min)

Sets the minimum value of the range.

UnionWith(b)

Extend this to include b .

Attributes:

dimension

max

min

Contains(point) bool

Returns true if the point is located inside the range.

As with all operations of this type, the range is assumed to include its extrema.

Parameters

point (float) –


Contains(range) -> bool

Returns true if the range is located entirely inside the range.

As with all operations of this type, the ranges are assumed to include their extrema.

Parameters

range (Range1f) –

GetDistanceSquared(p) float

Compute the squared distance from a point to the range.

Parameters

p (float) –

static GetIntersection()

classmethod GetIntersection(a, b) -> Range1f

Returns a GfRange1f that describes the intersection of a and b .

Parameters
GetMax() float

Returns the maximum value of the range.

GetMidpoint() float

Returns the midpoint of the range, that is, 0.5*(min+max).

Note: this returns zero in the case of default-constructed ranges, or ranges set via SetEmpty() .

GetMin() float

Returns the minimum value of the range.

GetSize() float

Returns the size of the range.

static GetUnion()

classmethod GetUnion(a, b) -> Range1f

Returns the smallest GfRange1f which contains both a and b .

Parameters
IntersectWith(b) Range1f

Modifies this range to hold its intersection with b and returns the result.

Parameters

b (Range1f) –

IsEmpty() bool

Returns whether the range is empty (max<min).

SetEmpty() None

Sets the range to an empty interval.

SetMax(max) None

Sets the maximum value of the range.

Parameters

max (float) –

SetMin(min) None

Sets the minimum value of the range.

Parameters

min (float) –

UnionWith(b) Range1f

Extend this to include b .

Parameters

b (Range1f) –


UnionWith(b) -> Range1f

Extend this to include b .

Parameters

b (float) –

dimension = 1
property max
property min
class pxr.Gf.Range2d

Methods:

Contains(point)

Returns true if the point is located inside the range.

GetCorner(i)

Returns the ith corner of the range, in the following order: SW, SE, NW, NE.

GetDistanceSquared(p)

Compute the squared distance from a point to the range.

GetIntersection

classmethod GetIntersection(a, b) -> Range2d

GetMax()

Returns the maximum value of the range.

GetMidpoint()

Returns the midpoint of the range, that is, 0.5*(min+max).

GetMin()

Returns the minimum value of the range.

GetQuadrant(i)

Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.

GetSize()

Returns the size of the range.

GetUnion

classmethod GetUnion(a, b) -> Range2d

IntersectWith(b)

Modifies this range to hold its intersection with b and returns the result.

IsEmpty()

Returns whether the range is empty (max<min).

SetEmpty()

Sets the range to an empty interval.

SetMax(max)

Sets the maximum value of the range.

SetMin(min)

Sets the minimum value of the range.

UnionWith(b)

Extend this to include b .

Attributes:

dimension

max

min

unitSquare

Contains(point) bool

Returns true if the point is located inside the range.

As with all operations of this type, the range is assumed to include its extrema.

Parameters

point (Vec2d) –


Contains(range) -> bool

Returns true if the range is located entirely inside the range.

As with all operations of this type, the ranges are assumed to include their extrema.

Parameters

range (Range2d) –

GetCorner(i) Vec2d

Returns the ith corner of the range, in the following order: SW, SE, NW, NE.

Parameters

i (int) –

GetDistanceSquared(p) float

Compute the squared distance from a point to the range.

Parameters

p (Vec2d) –

static GetIntersection()

classmethod GetIntersection(a, b) -> Range2d

Returns a GfRange2d that describes the intersection of a and b .

Parameters
GetMax() Vec2d

Returns the maximum value of the range.

GetMidpoint() Vec2d

Returns the midpoint of the range, that is, 0.5*(min+max).

Note: this returns zero in the case of default-constructed ranges, or ranges set via SetEmpty() .

GetMin() Vec2d

Returns the minimum value of the range.

GetQuadrant(i) Range2d

Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.

Parameters

i (int) –

GetSize() Vec2d

Returns the size of the range.

static GetUnion()

classmethod GetUnion(a, b) -> Range2d

Returns the smallest GfRange2d which contains both a and b .

Parameters
IntersectWith(b) Range2d

Modifies this range to hold its intersection with b and returns the result.

Parameters

b (Range2d) –

IsEmpty() bool

Returns whether the range is empty (max<min).

SetEmpty() None

Sets the range to an empty interval.

SetMax(max) None

Sets the maximum value of the range.

Parameters

max (Vec2d) –

SetMin(min) None

Sets the minimum value of the range.

Parameters

min (Vec2d) –

UnionWith(b) Range2d

Extend this to include b .

Parameters

b (Range2d) –


UnionWith(b) -> Range2d

Extend this to include b .

Parameters

b (Vec2d) –

dimension = 2
property max
property min
unitSquare = Gf.Range2d(Gf.Vec2d(0.0, 0.0), Gf.Vec2d(1.0, 1.0))
class pxr.Gf.Range2f

Methods:

Contains(point)

Returns true if the point is located inside the range.

GetCorner(i)

Returns the ith corner of the range, in the following order: SW, SE, NW, NE.

GetDistanceSquared(p)

Compute the squared distance from a point to the range.

GetIntersection

classmethod GetIntersection(a, b) -> Range2f

GetMax()

Returns the maximum value of the range.

GetMidpoint()

Returns the midpoint of the range, that is, 0.5*(min+max).

GetMin()

Returns the minimum value of the range.

GetQuadrant(i)

Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.

GetSize()

Returns the size of the range.

GetUnion

classmethod GetUnion(a, b) -> Range2f

IntersectWith(b)

Modifies this range to hold its intersection with b and returns the result.

IsEmpty()

Returns whether the range is empty (max<min).

SetEmpty()

Sets the range to an empty interval.

SetMax(max)

Sets the maximum value of the range.

SetMin(min)

Sets the minimum value of the range.

UnionWith(b)

Extend this to include b .

Attributes:

dimension

max

min

unitSquare

Contains(point) bool

Returns true if the point is located inside the range.

As with all operations of this type, the range is assumed to include its extrema.

Parameters

point (Vec2f) –


Contains(range) -> bool

Returns true if the range is located entirely inside the range.

As with all operations of this type, the ranges are assumed to include their extrema.

Parameters

range (Range2f) –

GetCorner(i) Vec2f

Returns the ith corner of the range, in the following order: SW, SE, NW, NE.

Parameters

i (int) –

GetDistanceSquared(p) float

Compute the squared distance from a point to the range.

Parameters

p (Vec2f) –

static GetIntersection()

classmethod GetIntersection(a, b) -> Range2f

Returns a GfRange2f that describes the intersection of a and b .

Parameters
GetMax() Vec2f

Returns the maximum value of the range.

GetMidpoint() Vec2f

Returns the midpoint of the range, that is, 0.5*(min+max).

Note: this returns zero in the case of default-constructed ranges, or ranges set via SetEmpty() .

GetMin() Vec2f

Returns the minimum value of the range.

GetQuadrant(i) Range2f

Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.

Parameters

i (int) –

GetSize() Vec2f

Returns the size of the range.

static GetUnion()

classmethod GetUnion(a, b) -> Range2f

Returns the smallest GfRange2f which contains both a and b .

Parameters
IntersectWith(b) Range2f

Modifies this range to hold its intersection with b and returns the result.

Parameters

b (Range2f) –

IsEmpty() bool

Returns whether the range is empty (max<min).

SetEmpty() None

Sets the range to an empty interval.

SetMax(max) None

Sets the maximum value of the range.

Parameters

max (Vec2f) –

SetMin(min) None

Sets the minimum value of the range.

Parameters

min (Vec2f) –

UnionWith(b) Range2f

Extend this to include b .

Parameters

b (Range2f) –


UnionWith(b) -> Range2f

Extend this to include b .

Parameters

b (Vec2f) –

dimension = 2
property max
property min
unitSquare = Gf.Range2f(Gf.Vec2f(0.0, 0.0), Gf.Vec2f(1.0, 1.0))
class pxr.Gf.Range3d

Methods:

Contains(point)

Returns true if the point is located inside the range.

GetCorner(i)

Returns the ith corner of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

GetDistanceSquared(p)

Compute the squared distance from a point to the range.

GetIntersection

classmethod GetIntersection(a, b) -> Range3d

GetMax()

Returns the maximum value of the range.

GetMidpoint()

Returns the midpoint of the range, that is, 0.5*(min+max).

GetMin()

Returns the minimum value of the range.

GetOctant(i)

Returns the ith octant of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

GetSize()

Returns the size of the range.

GetUnion

classmethod GetUnion(a, b) -> Range3d

IntersectWith(b)

Modifies this range to hold its intersection with b and returns the result.

IsEmpty()

Returns whether the range is empty (max<min).

SetEmpty()

Sets the range to an empty interval.

SetMax(max)

Sets the maximum value of the range.

SetMin(min)

Sets the minimum value of the range.

UnionWith(b)

Extend this to include b .

Attributes:

dimension

max

min

unitCube

Contains(point) bool

Returns true if the point is located inside the range.

As with all operations of this type, the range is assumed to include its extrema.

Parameters

point (Vec3d) –


Contains(range) -> bool

Returns true if the range is located entirely inside the range.

As with all operations of this type, the ranges are assumed to include their extrema.

Parameters

range (Range3d) –

GetCorner(i) Vec3d

Returns the ith corner of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

Where L/R is left/right, D/U is down/up, and B/F is back/front.

Parameters

i (int) –

GetDistanceSquared(p) float

Compute the squared distance from a point to the range.

Parameters

p (Vec3d) –

static GetIntersection()

classmethod GetIntersection(a, b) -> Range3d

Returns a GfRange3d that describes the intersection of a and b .

Parameters
GetMax() Vec3d

Returns the maximum value of the range.

GetMidpoint() Vec3d

Returns the midpoint of the range, that is, 0.5*(min+max).

Note: this returns zero in the case of default-constructed ranges, or ranges set via SetEmpty() .

GetMin() Vec3d

Returns the minimum value of the range.

GetOctant(i) Range3d

Returns the ith octant of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

Where L/R is left/right, D/U is down/up, and B/F is back/front.

Parameters

i (int) –

GetSize() Vec3d

Returns the size of the range.

static GetUnion()

classmethod GetUnion(a, b) -> Range3d

Returns the smallest GfRange3d which contains both a and b .

Parameters
IntersectWith(b) Range3d

Modifies this range to hold its intersection with b and returns the result.

Parameters

b (Range3d) –

IsEmpty() bool

Returns whether the range is empty (max<min).

SetEmpty() None

Sets the range to an empty interval.

SetMax(max) None

Sets the maximum value of the range.

Parameters

max (Vec3d) –

SetMin(min) None

Sets the minimum value of the range.

Parameters

min (Vec3d) –

UnionWith(b) Range3d

Extend this to include b .

Parameters

b (Range3d) –


UnionWith(b) -> Range3d

Extend this to include b .

Parameters

b (Vec3d) –

dimension = 3
property max
property min
unitCube = Gf.Range3d(Gf.Vec3d(0.0, 0.0, 0.0), Gf.Vec3d(1.0, 1.0, 1.0))
class pxr.Gf.Range3f

Methods:

Contains(point)

Returns true if the point is located inside the range.

GetCorner(i)

Returns the ith corner of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

GetDistanceSquared(p)

Compute the squared distance from a point to the range.

GetIntersection

classmethod GetIntersection(a, b) -> Range3f

GetMax()

Returns the maximum value of the range.

GetMidpoint()

Returns the midpoint of the range, that is, 0.5*(min+max).

GetMin()

Returns the minimum value of the range.

GetOctant(i)

Returns the ith octant of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

GetSize()

Returns the size of the range.

GetUnion

classmethod GetUnion(a, b) -> Range3f

IntersectWith(b)

Modifies this range to hold its intersection with b and returns the result.

IsEmpty()

Returns whether the range is empty (max<min).

SetEmpty()

Sets the range to an empty interval.

SetMax(max)

Sets the maximum value of the range.

SetMin(min)

Sets the minimum value of the range.

UnionWith(b)

Extend this to include b .

Attributes:

dimension

max

min

unitCube

Contains(point) bool

Returns true if the point is located inside the range.

As with all operations of this type, the range is assumed to include its extrema.

Parameters

point (Vec3f) –


Contains(range) -> bool

Returns true if the range is located entirely inside the range.

As with all operations of this type, the ranges are assumed to include their extrema.

Parameters

range (Range3f) –

GetCorner(i) Vec3f

Returns the ith corner of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

Where L/R is left/right, D/U is down/up, and B/F is back/front.

Parameters

i (int) –

GetDistanceSquared(p) float

Compute the squared distance from a point to the range.

Parameters

p (Vec3f) –

static GetIntersection()

classmethod GetIntersection(a, b) -> Range3f

Returns a GfRange3f that describes the intersection of a and b .

Parameters
GetMax() Vec3f

Returns the maximum value of the range.

GetMidpoint() Vec3f

Returns the midpoint of the range, that is, 0.5*(min+max).

Note: this returns zero in the case of default-constructed ranges, or ranges set via SetEmpty() .

GetMin() Vec3f

Returns the minimum value of the range.

GetOctant(i) Range3f

Returns the ith octant of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

Where L/R is left/right, D/U is down/up, and B/F is back/front.

Parameters

i (int) –

GetSize() Vec3f

Returns the size of the range.

static GetUnion()

classmethod GetUnion(a, b) -> Range3f

Returns the smallest GfRange3f which contains both a and b .

Parameters
IntersectWith(b) Range3f

Modifies this range to hold its intersection with b and returns the result.

Parameters

b (Range3f) –

IsEmpty() bool

Returns whether the range is empty (max<min).

SetEmpty() None

Sets the range to an empty interval.

SetMax(max) None

Sets the maximum value of the range.

Parameters

max (Vec3f) –

SetMin(min) None

Sets the minimum value of the range.

Parameters

min (Vec3f) –

UnionWith(b) Range3f

Extend this to include b .

Parameters

b (Range3f) –


UnionWith(b) -> Range3f

Extend this to include b .

Parameters

b (Vec3f) –

dimension = 3
property max
property min
unitCube = Gf.Range3f(Gf.Vec3f(0.0, 0.0, 0.0), Gf.Vec3f(1.0, 1.0, 1.0))
class pxr.Gf.Ray

Methods:

FindClosestPoint(point, rayDistance)

Returns the point on the ray that is closest to point .

GetPoint(distance)

Returns the point that is distance units from the starting point along the direction vector, expressed in parametic distance.

Intersect(p0, p1, p2)

float, barycentric = GfVec3d, frontFacing = bool>

SetEnds(startPoint, endPoint)

Sets the ray by specifying a starting point and an ending point.

SetPointAndDirection(startPoint, direction)

Sets the ray by specifying a starting point and a direction.

Transform(matrix)

Transforms the ray by the given matrix.

Attributes:

direction

Vec3d

startPoint

Vec3d

FindClosestPoint(point, rayDistance) Vec3d

Returns the point on the ray that is closest to point .

If rayDistance is not None , it will be set to the parametric distance along the ray of the closest point.

Parameters
  • point (Vec3d) –

  • rayDistance (float) –

GetPoint(distance) Vec3d

Returns the point that is distance units from the starting point along the direction vector, expressed in parametic distance.

Parameters

distance (float) –

Intersect(p0, p1, p2) tuple<intersects = bool, dist =

float, barycentric = GfVec3d, frontFacing = bool>

Intersects the ray with the triangle formed by points p0, p1, and p2. The first item in the tuple is true if the ray intersects the triangle. dist is the the parametric distance to the intersection point, the barycentric coordinates of the intersection point, and the front-facing flag. The barycentric coordinates are defined with respect to the three vertices taken in order. The front-facing flag is True if the intersection hit the side of the triangle that is formed when the vertices are ordered counter-clockwise (right-hand rule).

Barycentric coordinates are defined to sum to 1 and satisfy this relationsip:

intersectionPoint = (barycentricCoords[0] * p0 +

barycentricCoords[1] * p1 + barycentricCoords[2] * p2);


Intersect( plane ) -> tuple<intersects = bool, dist = float, frontFacing = bool>

Intersects the ray with the Gf.Plane. The first item in the returned tuple is true if the ray intersects the plane. dist is the parametric distance to the intersection point and frontfacing is true if the intersection is on the side of the plane toward which the plane’s normal points. ———————————————————————-

Intersect( range3d ) -> tuple<intersects = bool, enterDist = float, exitDist = float> Intersects the plane with an axis-aligned box in a Gf.Range3d. intersects is true if the ray intersects it at all within bounds. If there is an intersection then enterDist and exitDist will be the parametric distances to the two intersection points. ———————————————————————-

Intersect( bbox3d ) -> tuple<intersects = bool, enterDist = float, exitDist = float> Intersects the plane with an oriented box in a Gf.BBox3d. intersects is true if the ray intersects it at all within bounds. If there is an intersection then enterDist and exitDist will be the parametric distances to the two intersection points. ———————————————————————-

Intersect( center, radius ) -> tuple<intersects = bool, enterDist = float, exitDist = float>

Intersects the plane with an sphere. intersects is true if the ray intersects it at all within the sphere. If there is an intersection then enterDist and exitDist will be the parametric distances to the two intersection points. ———————————————————————-

Intersect( origin, axis, radius ) -> tuple<intersects = bool, enterDist = float, exitDist = float>

Intersects the plane with an infinite cylinder. intersects is true if the ray intersects it at all within the sphere. If there is an intersection then enterDist and exitDist will be the parametric distances to the two intersection points. ———————————————————————-

Intersect( origin, axis, radius, height ) -> tuple<intersects = bool, enterDist = float, exitDist = float>

Intersects the plane with an cylinder. intersects is true if the ray intersects it at all within the sphere. If there is an intersection then enterDist and exitDist will be the parametric distances to the two intersection points. ———————————————————————-

SetEnds(startPoint, endPoint) None

Sets the ray by specifying a starting point and an ending point.

Parameters
SetPointAndDirection(startPoint, direction) None

Sets the ray by specifying a starting point and a direction.

Parameters
Transform(matrix) Ray

Transforms the ray by the given matrix.

Parameters

matrix (Matrix4d) –

property direction

Vec3d

Returns the direction vector of the segment.

This is not guaranteed to be unit length.

Type

type

property startPoint

Vec3d

Returns the starting point of the segment.

Type

type

class pxr.Gf.Rect2i

Methods:

Contains(p)

Returns true if the specified point in the rectangle.

GetArea()

Return the area of the rectangle.

GetCenter()

Returns the center point of the rectangle.

GetHeight()

Returns the height of the rectangle.

GetIntersection(that)

Computes the intersection of two rectangles.

GetMax()

Returns the max corner of the rectangle.

GetMaxX()

Return the X value of the max corner.

GetMaxY()

Return the Y value of the max corner.

GetMin()

Returns the min corner of the rectangle.

GetMinX()

Return the X value of min corner.

GetMinY()

Return the Y value of the min corner.

GetNormalized()

Returns a normalized rectangle, i.e.

GetSize()

Returns the size of the rectangle as a vector (width,height).

GetUnion(that)

Computes the union of two rectangles.

GetWidth()

Returns the width of the rectangle.

IsEmpty()

Returns true if the rectangle is empty.

IsNull()

Returns true if the rectangle is a null rectangle.

IsValid()

Return true if the rectangle is valid (equivalently, not empty).

SetMax(max)

Sets the max corner of the rectangle.

SetMaxX(x)

Set the X value of the max corner.

SetMaxY(y)

Set the Y value of the max corner.

SetMin(min)

Sets the min corner of the rectangle.

SetMinX(x)

Set the X value of the min corner.

SetMinY(y)

Set the Y value of the min corner.

Translate(displacement)

Move the rectangle by displ .

Attributes:

max

maxX

maxY

min

minX

minY

Contains(p) bool

Returns true if the specified point in the rectangle.

Parameters

p (Vec2i) –

GetArea() int

Return the area of the rectangle.

GetCenter() Vec2i

Returns the center point of the rectangle.

GetHeight() int

Returns the height of the rectangle.

If the min and max y-coordinates are coincident, the height is one.

GetIntersection(that) Rect2i

Computes the intersection of two rectangles.

Parameters

that (Rect2i) –

GetMax() Vec2i

Returns the max corner of the rectangle.

GetMaxX() int

Return the X value of the max corner.

GetMaxY() int

Return the Y value of the max corner.

GetMin() Vec2i

Returns the min corner of the rectangle.

GetMinX() int

Return the X value of min corner.

GetMinY() int

Return the Y value of the min corner.

GetNormalized() Rect2i

Returns a normalized rectangle, i.e.

one that has a non-negative width and height.

GetNormalized() swaps the min and max x-coordinates to ensure a non-negative width, and similarly for the y-coordinates.

GetSize() Vec2i

Returns the size of the rectangle as a vector (width,height).

GetUnion(that) Rect2i

Computes the union of two rectangles.

Parameters

that (Rect2i) –

GetWidth() int

Returns the width of the rectangle.

If the min and max x-coordinates are coincident, the width is one.

IsEmpty() bool

Returns true if the rectangle is empty.

An empty rectangle has one or both of its min coordinates strictly greater than the corresponding max coordinate.

An empty rectangle is not valid.

IsNull() bool

Returns true if the rectangle is a null rectangle.

A null rectangle has both the width and the height set to 0, that is

 GetMaxX() == GetMinX() - 1

and
 GetMaxY() == GetMinY() - 1

Remember that if ``GetMinX()`` and ``GetMaxX()`` return the same

value then the rectangle has width 1, and similarly for the height.

A null rectangle is both empty, and not valid.

IsValid() bool

Return true if the rectangle is valid (equivalently, not empty).

SetMax(max) None

Sets the max corner of the rectangle.

Parameters

max (Vec2i) –

SetMaxX(x) None

Set the X value of the max corner.

Parameters

x (int) –

SetMaxY(y) None

Set the Y value of the max corner.

Parameters

y (int) –

SetMin(min) None

Sets the min corner of the rectangle.

Parameters

min (Vec2i) –

SetMinX(x) None

Set the X value of the min corner.

Parameters

x (int) –

SetMinY(y) None

Set the Y value of the min corner.

Parameters

y (int) –

Translate(displacement) None

Move the rectangle by displ .

Parameters

displacement (Vec2i) –

property max
property maxX
property maxY
property min
property minX
property minY
class pxr.Gf.Rotation

3-space rotation

Methods:

Decompose(axis0, axis1, axis2)

Decompose rotation about 3 orthogonal axes.

DecomposeRotation

classmethod DecomposeRotation(rot, TwAxis, FBAxis, LRAxis, handedness, thetaTw, thetaFB, thetaLR, thetaSw, useHint, swShift) -> None

DecomposeRotation3

GetAngle()

Returns the rotation angle in degrees.

GetAxis()

Returns the axis of rotation.

GetInverse()

Returns the inverse of this rotation.

GetQuat()

Returns the rotation expressed as a quaternion.

GetQuaternion()

Returns the rotation expressed as a quaternion.

MatchClosestEulerRotation

classmethod MatchClosestEulerRotation(targetTw, targetFB, targetLR, targetSw, thetaTw, thetaFB, thetaLR, thetaSw) -> None

RotateOntoProjected

classmethod RotateOntoProjected(v1, v2, axis) -> Rotation

SetAxisAngle(axis, angle)

Sets the rotation to be angle degrees about axis .

SetIdentity()

Sets the rotation to an identity rotation.

SetQuat(quat)

Sets the rotation from a quaternion.

SetQuaternion(quat)

Sets the rotation from a quaternion.

SetRotateInto(rotateFrom, rotateTo)

Sets the rotation to one that brings the rotateFrom vector to align with rotateTo .

TransformDir(vec)

Transforms row vector vec by the rotation, returning the result.

Attributes:

angle

axis

Decompose(axis0, axis1, axis2) Vec3d

Decompose rotation about 3 orthogonal axes.

If the axes are not orthogonal, warnings will be spewed.

Parameters
static DecomposeRotation()

classmethod DecomposeRotation(rot, TwAxis, FBAxis, LRAxis, handedness, thetaTw, thetaFB, thetaLR, thetaSw, useHint, swShift) -> None

Parameters
  • rot (Matrix4d) –

  • TwAxis (Vec3d) –

  • FBAxis (Vec3d) –

  • LRAxis (Vec3d) –

  • handedness (float) –

  • thetaTw (float) –

  • thetaFB (float) –

  • thetaLR (float) –

  • thetaSw (float) –

  • useHint (bool) –

  • swShift (float) –

static DecomposeRotation3()
GetAngle() float

Returns the rotation angle in degrees.

GetAxis() Vec3d

Returns the axis of rotation.

GetInverse() Rotation

Returns the inverse of this rotation.

GetQuat() Quatd

Returns the rotation expressed as a quaternion.

GetQuaternion() Quaternion

Returns the rotation expressed as a quaternion.

static MatchClosestEulerRotation()

classmethod MatchClosestEulerRotation(targetTw, targetFB, targetLR, targetSw, thetaTw, thetaFB, thetaLR, thetaSw) -> None

Replace the hint angles with the closest rotation of the given rotation to the hint.

Each angle in the rotation will be within Pi of the corresponding hint angle and the sum of the differences with the hint will be minimized. If a given rotation value is null then that angle will be treated as 0.0 and ignored in the calculations.

All angles are in radians. The rotation order is Tw/FB/LR/Sw.

Parameters
  • targetTw (float) –

  • targetFB (float) –

  • targetLR (float) –

  • targetSw (float) –

  • thetaTw (float) –

  • thetaFB (float) –

  • thetaLR (float) –

  • thetaSw (float) –

static RotateOntoProjected()

classmethod RotateOntoProjected(v1, v2, axis) -> Rotation

Parameters
SetAxisAngle(axis, angle) Rotation

Sets the rotation to be angle degrees about axis .

Parameters
  • axis (Vec3d) –

  • angle (float) –

SetIdentity() Rotation

Sets the rotation to an identity rotation.

(This is chosen to be 0 degrees around the positive X axis.)

SetQuat(quat) Rotation

Sets the rotation from a quaternion.

Note that this method accepts GfQuatf and GfQuath since they implicitly convert to GfQuatd.

Parameters

quat (Quatd) –

SetQuaternion(quat) Rotation

Sets the rotation from a quaternion.

Parameters

quat (Quaternion) –

SetRotateInto(rotateFrom, rotateTo) Rotation

Sets the rotation to one that brings the rotateFrom vector to align with rotateTo .

The passed vectors need not be unit length.

Parameters
TransformDir(vec) Vec3f

Transforms row vector vec by the rotation, returning the result.

Parameters

vec (Vec3f) –


TransformDir(vec) -> Vec3d

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

vec (Vec3d) –

property angle
property axis
class pxr.Gf.Size2

A 2D size class

Methods:

Set(v)

Set to the values in a given array.

Attributes:

dimension

Set(v) Size2

Set to the values in a given array.

Parameters

v (int) –


Set(v0, v1) -> Size2

Set to values passed directly.

Parameters
  • v0 (int) –

  • v1 (int) –

dimension = 2
class pxr.Gf.Size3

A 3D size class

Methods:

Set(v)

Set to the values in v .

Attributes:

dimension

Set(v) Size3

Set to the values in v .

Parameters

v (int) –


Set(v0, v1, v2) -> Size3

Set to values passed directly.

Parameters
  • v0 (int) –

  • v1 (int) –

  • v2 (int) –

dimension = 3
class pxr.Gf.Transform

Methods:

GetMatrix()

Returns a GfMatrix4d that implements the cumulative transformation.

GetPivotOrientation()

Returns the pivot orientation component.

GetPivotPosition()

Returns the pivot position component.

GetRotation()

Returns the rotation component.

GetScale()

Returns the scale component.

GetTranslation()

Returns the translation component.

Set

Set method used by old 2x code.

SetIdentity()

Sets the transformation to the identity transformation.

SetMatrix(m)

Sets the transform components to implement the transformation represented by matrix m , ignoring any projection.

SetPivotOrientation(pivotOrient)

Sets the pivot orientation component, leaving all others untouched.

SetPivotPosition(pivPos)

Sets the pivot position component, leaving all others untouched.

SetRotation(rotation)

Sets the rotation component, leaving all others untouched.

SetScale(scale)

Sets the scale component, leaving all others untouched.

SetTranslation(translation)

Sets the translation component, leaving all others untouched.

Attributes:

pivotOrientation

pivotPosition

rotation

scale

translation

GetMatrix() Matrix4d

Returns a GfMatrix4d that implements the cumulative transformation.

GetPivotOrientation() Rotation

Returns the pivot orientation component.

GetPivotPosition() Vec3d

Returns the pivot position component.

GetRotation() Rotation

Returns the rotation component.

GetScale() Vec3d

Returns the scale component.

GetTranslation() Vec3d

Returns the translation component.

Set()

Set method used by old 2x code. (Deprecated)

SetIdentity() Transform

Sets the transformation to the identity transformation.

SetMatrix(m) Transform

Sets the transform components to implement the transformation represented by matrix m , ignoring any projection.

This tries to leave the current center unchanged.

Parameters

m (Matrix4d) –

SetPivotOrientation(pivotOrient) None

Sets the pivot orientation component, leaving all others untouched.

Parameters

pivotOrient (Rotation) –

SetPivotPosition(pivPos) None

Sets the pivot position component, leaving all others untouched.

Parameters

pivPos (Vec3d) –

SetRotation(rotation) None

Sets the rotation component, leaving all others untouched.

Parameters

rotation (Rotation) –

SetScale(scale) None

Sets the scale component, leaving all others untouched.

Parameters

scale (Vec3d) –

SetTranslation(translation) None

Sets the translation component, leaving all others untouched.

Parameters

translation (Vec3d) –

property pivotOrientation
property pivotPosition
property rotation
property scale
property translation
class pxr.Gf.Vec2d

Methods:

Axis

classmethod Axis(i) -> Vec2d

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

XAxis

classmethod XAxis() -> Vec2d

YAxis

classmethod YAxis() -> Vec2d

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec2d

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 2.

Parameters

i (int) –

GetComplement(b) Vec2d

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec2d) –

GetDot()
GetLength() float

Length.

GetNormalized(eps) Vec2d
Parameters

eps (float) –

GetProjection(v) Vec2d

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec2d) –

Normalize(eps) float

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (float) –

static XAxis()

classmethod XAxis() -> Vec2d

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec2d

Create a unit vector along the Y-axis.

dimension = 2
class pxr.Gf.Vec2f

Methods:

Axis

classmethod Axis(i) -> Vec2f

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

XAxis

classmethod XAxis() -> Vec2f

YAxis

classmethod YAxis() -> Vec2f

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec2f

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 2.

Parameters

i (int) –

GetComplement(b) Vec2f

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec2f) –

GetDot()
GetLength() float

Length.

GetNormalized(eps) Vec2f
Parameters

eps (float) –

GetProjection(v) Vec2f

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec2f) –

Normalize(eps) float

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (float) –

static XAxis()

classmethod XAxis() -> Vec2f

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec2f

Create a unit vector along the Y-axis.

dimension = 2
class pxr.Gf.Vec2h

Methods:

Axis

classmethod Axis(i) -> Vec2h

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

XAxis

classmethod XAxis() -> Vec2h

YAxis

classmethod YAxis() -> Vec2h

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec2h

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 2.

Parameters

i (int) –

GetComplement(b) Vec2h

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec2h) –

GetDot()
GetLength() GfHalf

Length.

GetNormalized(eps) Vec2h
Parameters

eps (GfHalf) –

GetProjection(v) Vec2h

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec2h) –

Normalize(eps) GfHalf

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (GfHalf) –

static XAxis()

classmethod XAxis() -> Vec2h

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec2h

Create a unit vector along the Y-axis.

dimension = 2
class pxr.Gf.Vec2i

Methods:

Axis

classmethod Axis(i) -> Vec2i

GetDot

XAxis

classmethod XAxis() -> Vec2i

YAxis

classmethod YAxis() -> Vec2i

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec2i

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 2.

Parameters

i (int) –

GetDot()
static XAxis()

classmethod XAxis() -> Vec2i

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec2i

Create a unit vector along the Y-axis.

dimension = 2
class pxr.Gf.Vec3d

Methods:

Axis

classmethod Axis(i) -> Vec3d

BuildOrthonormalFrame(v1, v2, eps)

Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetCross

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

OrthogonalizeBasis

classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool

XAxis

classmethod XAxis() -> Vec3d

YAxis

classmethod YAxis() -> Vec3d

ZAxis

classmethod ZAxis() -> Vec3d

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec3d

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 3.

Parameters

i (int) –

BuildOrthonormalFrame(v1, v2, eps) None

Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.

If the length L of *this is smaller than eps , then v1 and v2 will have magnitude L/eps. As a result, the function delivers a continuous result as *this shrinks in length.

Parameters
GetComplement(b) Vec3d

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec3d) –

GetCross()
GetDot()
GetLength() float

Length.

GetNormalized(eps) Vec3d
Parameters

eps (float) –

GetProjection(v) Vec3d

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec3d) –

Normalize(eps) float

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (float) –

static OrthogonalizeBasis()

classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool

Orthogonalize and optionally normalize a set of basis vectors.

This uses an iterative method that is very stable even when the vectors are far from orthogonal (close to colinear). The number of iterations and thus the computation time does increase as the vectors become close to colinear, however. Returns a bool specifying whether the solution converged after a number of iterations. If it did not converge, the returned vectors will be as close as possible to orthogonal within the iteration limit. Colinear vectors will be unaltered, and the method will return false.

Parameters
  • tx (Vec3d) –

  • ty (Vec3d) –

  • tz (Vec3d) –

  • normalize (bool) –

  • eps (float) –

static XAxis()

classmethod XAxis() -> Vec3d

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec3d

Create a unit vector along the Y-axis.

static ZAxis()

classmethod ZAxis() -> Vec3d

Create a unit vector along the Z-axis.

dimension = 3
class pxr.Gf.Vec3f

Methods:

Axis

classmethod Axis(i) -> Vec3f

BuildOrthonormalFrame(v1, v2, eps)

Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetCross

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

OrthogonalizeBasis

classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool

XAxis

classmethod XAxis() -> Vec3f

YAxis

classmethod YAxis() -> Vec3f

ZAxis

classmethod ZAxis() -> Vec3f

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec3f

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 3.

Parameters

i (int) –

BuildOrthonormalFrame(v1, v2, eps) None

Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.

If the length L of *this is smaller than eps , then v1 and v2 will have magnitude L/eps. As a result, the function delivers a continuous result as *this shrinks in length.

Parameters
GetComplement(b) Vec3f

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec3f) –

GetCross()
GetDot()
GetLength() float

Length.

GetNormalized(eps) Vec3f
Parameters

eps (float) –

GetProjection(v) Vec3f

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec3f) –

Normalize(eps) float

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (float) –

static OrthogonalizeBasis()

classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool

Orthogonalize and optionally normalize a set of basis vectors.

This uses an iterative method that is very stable even when the vectors are far from orthogonal (close to colinear). The number of iterations and thus the computation time does increase as the vectors become close to colinear, however. Returns a bool specifying whether the solution converged after a number of iterations. If it did not converge, the returned vectors will be as close as possible to orthogonal within the iteration limit. Colinear vectors will be unaltered, and the method will return false.

Parameters
  • tx (Vec3f) –

  • ty (Vec3f) –

  • tz (Vec3f) –

  • normalize (bool) –

  • eps (float) –

static XAxis()

classmethod XAxis() -> Vec3f

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec3f

Create a unit vector along the Y-axis.

static ZAxis()

classmethod ZAxis() -> Vec3f

Create a unit vector along the Z-axis.

dimension = 3
class pxr.Gf.Vec3h

Methods:

Axis

classmethod Axis(i) -> Vec3h

BuildOrthonormalFrame(v1, v2, eps)

Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetCross

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

OrthogonalizeBasis

classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool

XAxis

classmethod XAxis() -> Vec3h

YAxis

classmethod YAxis() -> Vec3h

ZAxis

classmethod ZAxis() -> Vec3h

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec3h

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 3.

Parameters

i (int) –

BuildOrthonormalFrame(v1, v2, eps) None

Sets v1 and v2 to unit vectors such that v1, v2 and *this are mutually orthogonal.

If the length L of *this is smaller than eps , then v1 and v2 will have magnitude L/eps. As a result, the function delivers a continuous result as *this shrinks in length.

Parameters
GetComplement(b) Vec3h

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec3h) –

GetCross()
GetDot()
GetLength() GfHalf

Length.

GetNormalized(eps) Vec3h
Parameters

eps (GfHalf) –

GetProjection(v) Vec3h

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec3h) –

Normalize(eps) GfHalf

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (GfHalf) –

static OrthogonalizeBasis()

classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool

Orthogonalize and optionally normalize a set of basis vectors.

This uses an iterative method that is very stable even when the vectors are far from orthogonal (close to colinear). The number of iterations and thus the computation time does increase as the vectors become close to colinear, however. Returns a bool specifying whether the solution converged after a number of iterations. If it did not converge, the returned vectors will be as close as possible to orthogonal within the iteration limit. Colinear vectors will be unaltered, and the method will return false.

Parameters
  • tx (Vec3h) –

  • ty (Vec3h) –

  • tz (Vec3h) –

  • normalize (bool) –

  • eps (float) –

static XAxis()

classmethod XAxis() -> Vec3h

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec3h

Create a unit vector along the Y-axis.

static ZAxis()

classmethod ZAxis() -> Vec3h

Create a unit vector along the Z-axis.

dimension = 3
class pxr.Gf.Vec3i

Methods:

Axis

classmethod Axis(i) -> Vec3i

GetDot

XAxis

classmethod XAxis() -> Vec3i

YAxis

classmethod YAxis() -> Vec3i

ZAxis

classmethod ZAxis() -> Vec3i

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec3i

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 3.

Parameters

i (int) –

GetDot()
static XAxis()

classmethod XAxis() -> Vec3i

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec3i

Create a unit vector along the Y-axis.

static ZAxis()

classmethod ZAxis() -> Vec3i

Create a unit vector along the Z-axis.

dimension = 3
class pxr.Gf.Vec4d

Methods:

Axis

classmethod Axis(i) -> Vec4d

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

WAxis

classmethod WAxis() -> Vec4d

XAxis

classmethod XAxis() -> Vec4d

YAxis

classmethod YAxis() -> Vec4d

ZAxis

classmethod ZAxis() -> Vec4d

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec4d

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 4.

Parameters

i (int) –

GetComplement(b) Vec4d

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec4d) –

GetDot()
GetLength() float

Length.

GetNormalized(eps) Vec4d
Parameters

eps (float) –

GetProjection(v) Vec4d

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec4d) –

Normalize(eps) float

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (float) –

static WAxis()

classmethod WAxis() -> Vec4d

Create a unit vector along the W-axis.

static XAxis()

classmethod XAxis() -> Vec4d

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec4d

Create a unit vector along the Y-axis.

static ZAxis()

classmethod ZAxis() -> Vec4d

Create a unit vector along the Z-axis.

dimension = 4
class pxr.Gf.Vec4f

Methods:

Axis

classmethod Axis(i) -> Vec4f

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

WAxis

classmethod WAxis() -> Vec4f

XAxis

classmethod XAxis() -> Vec4f

YAxis

classmethod YAxis() -> Vec4f

ZAxis

classmethod ZAxis() -> Vec4f

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec4f

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 4.

Parameters

i (int) –

GetComplement(b) Vec4f

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec4f) –

GetDot()
GetLength() float

Length.

GetNormalized(eps) Vec4f
Parameters

eps (float) –

GetProjection(v) Vec4f

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec4f) –

Normalize(eps) float

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (float) –

static WAxis()

classmethod WAxis() -> Vec4f

Create a unit vector along the W-axis.

static XAxis()

classmethod XAxis() -> Vec4f

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec4f

Create a unit vector along the Y-axis.

static ZAxis()

classmethod ZAxis() -> Vec4f

Create a unit vector along the Z-axis.

dimension = 4
class pxr.Gf.Vec4h

Methods:

Axis

classmethod Axis(i) -> Vec4h

GetComplement(b)

Returns the orthogonal complement of this->GetProjection(b) .

GetDot

GetLength()

Length.

GetNormalized(eps)

param eps

GetProjection(v)

Returns the projection of this onto v .

Normalize(eps)

Normalizes the vector in place to unit length, returning the length before normalization.

WAxis

classmethod WAxis() -> Vec4h

XAxis

classmethod XAxis() -> Vec4h

YAxis

classmethod YAxis() -> Vec4h

ZAxis

classmethod ZAxis() -> Vec4h

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec4h

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 4.

Parameters

i (int) –

GetComplement(b) Vec4h

Returns the orthogonal complement of this->GetProjection(b) .

That is:

\*this - this->GetProjection(b)
Parameters

b (Vec4h) –

GetDot()
GetLength() GfHalf

Length.

GetNormalized(eps) Vec4h
Parameters

eps (GfHalf) –

GetProjection(v) Vec4h

Returns the projection of this onto v .

That is:

v \* (\*this \* v)
Parameters

v (Vec4h) –

Normalize(eps) GfHalf

Normalizes the vector in place to unit length, returning the length before normalization.

If the length of the vector is smaller than eps , then the vector is set to vector/ eps . The original length of the vector is returned. See also GfNormalize() .

Parameters

eps (GfHalf) –

static WAxis()

classmethod WAxis() -> Vec4h

Create a unit vector along the W-axis.

static XAxis()

classmethod XAxis() -> Vec4h

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec4h

Create a unit vector along the Y-axis.

static ZAxis()

classmethod ZAxis() -> Vec4h

Create a unit vector along the Z-axis.

dimension = 4
class pxr.Gf.Vec4i

Methods:

Axis

classmethod Axis(i) -> Vec4i

GetDot

WAxis

classmethod WAxis() -> Vec4i

XAxis

classmethod XAxis() -> Vec4i

YAxis

classmethod YAxis() -> Vec4i

ZAxis

classmethod ZAxis() -> Vec4i

Attributes:

dimension

static Axis()

classmethod Axis(i) -> Vec4i

Create a unit vector along the i-th axis, zero-based.

Return the zero vector if i is greater than or equal to 4.

Parameters

i (int) –

GetDot()
static WAxis()

classmethod WAxis() -> Vec4i

Create a unit vector along the W-axis.

static XAxis()

classmethod XAxis() -> Vec4i

Create a unit vector along the X-axis.

static YAxis()

classmethod YAxis() -> Vec4i

Create a unit vector along the Y-axis.

static ZAxis()

classmethod ZAxis() -> Vec4i

Create a unit vector along the Z-axis.

dimension = 4