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:
Arbitrarily oriented 3D bounding box |
|
Basic view frustum |
|
Basic mathematical interval class |
|
Line class |
|
Line segment class |
|
Quaternion class |
|
3-space rotation |
|
A 2D size class |
|
A 3D size class |
|
- class pxr.Gf.BBox3d
Arbitrarily oriented 3D bounding box
Methods:
classmethod Combine(b1, b2) -> BBox3d
Returns the axis-aligned range (as a
GfRange3d
) that results from applying the transformation matrix to the axis-aligned box and aligning the result.Returns the axis-aligned range (as a
GfRange3d
) that results from applying the transformation matrix to the wxis-aligned box and aligning the result.Returns the centroid of the bounding box.
GetBox
()Returns the range of the axis-aligned untransformed box.
Returns the inverse of the transformation matrix.
Returns the transformation matrix.
GetRange
()Returns the range of the axis-aligned untransformed box.
Returns the volume of the box (0 for an empty box).
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:
- 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.
- 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.
- 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”.
- 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:
Direction used for Field of View or orthographic size.
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.
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 toorthographicSize
(depending on direction).Sets the frustum to be projective with the given
aspectRatio
and horizontal, respectively, vertical field of viewfieldOfView
(similar to gluPerspective when direction = FOVVertical).Attributes:
float
list[Vec4f]
Range1f
float
float
float
Frustum
float
float
Projection
Matrix4d
float
float
- class FOVDirection
Direction used for Field of View or orthographic size.
Methods:
Attributes:
- static GetValueFromName()
- allValues = (Gf.Camera.FOVHorizontal, Gf.Camera.FOVVertical)
- class Projection
Projection type.
Methods:
Attributes:
- 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).
- 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 toorthographicSize
(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 viewfieldOfView
(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:
Returns the conjugate of this dual quaternion.
GetDual
()Returns the dual part of the dual quaternion.
classmethod GetIdentity() -> DualQuatd
Returns the inverse of this dual quaternion.
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.
Get the translation component of this dual quaternion.
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:
- 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).
- 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) –
- 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) –
- 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:
Returns the conjugate of this dual quaternion.
GetDual
()Returns the dual part of the dual quaternion.
classmethod GetIdentity() -> DualQuatf
Returns the inverse of this dual quaternion.
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.
Get the translation component of this dual quaternion.
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:
- 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).
- 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) –
- 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) –
- 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:
Returns the conjugate of this dual quaternion.
GetDual
()Returns the dual part of the dual quaternion.
classmethod GetIdentity() -> DualQuath
Returns the inverse of this dual quaternion.
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.
Get the translation component of this dual quaternion.
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:
- 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).
- 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) –
- 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) –
- 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:
This enum is used to determine the type of projection represented by a frustum.
Methods:
Returns the aspect ratio of the frustum, defined as the width of the window divided by the height.
Returns the world-space corners of the frustum as a vector of 8 points, ordered as:
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:
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.Returns a GL-style projection matrix corresponding to the frustum's projection.
Returns the normalized world-space up vector, which is computed by rotating the y axis by the frustum's rotation.
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.
Returns a matrix that represents the inverse viewing transformation for this frustum.
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.
Returns the horizontal fov of the frustum.
Returns the near/far interval.
GetOrthographic
(left, right, bottom, top, ...)Returns the current frustum in the format used by
SetOrthographic()
.Returns the current perspective frustum values suitable for use by SetPerspective.
Returns the position of the frustum in world space.
Returns the projection type.
classmethod GetReferencePlaneDepth() -> float
Returns the orientation of the frustum in world space as a rotation to apply to the -z axis.
Returns the view distance.
Returns the window rectangle in the reference plane.
Intersects
(bbox)Returns true if the given axis-aligned bbox is inside or intersecting the frustum.
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:
- class ProjectionType
This enum is used to determine the type of projection represented by a frustum.
Methods:
Attributes:
- 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 bysize
[0] andsize
[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
orsize
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.
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 bysize
[0] andsize
[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.
- 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
- 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.
- 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.
- 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.
- 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.
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.
- 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.
- 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 offieldOfViewHeight
degrees in the vertical direction, withaspectRatio
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, withaspectRatio
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, withaspectRatio
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) –
- 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:
Returns true if x is inside the interval.
classmethod GetFullInterval() -> Interval
Get the maximum value.
Get the minimum value.
The width of the interval
Returns true if x is inside the interval.
Intersects
(i)Return true iff the given interval i intersects this interval.
True if the interval is empty.
IsFinite
()Returns true if both the maximum and minimum value are finite.
Maximum boundary condition.
Returns true if the maximum value is finite.
Maximum boundary condition.
Minimum boundary condition.
Returns true if the minimum value is finite.
Minimum boundary condition.
Set the maximum value.
Set the minimum value.
Attributes:
True if the interval is empty.
The maximum value.
The minimum value.
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
.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:
- FindClosestPoint(point, t) Vec3d
Returns the point on the line that is closest to
point
.If
t
is notNone
, it will be set to the parametric distance along the line of the returned point.- Parameters
point (Vec3d) –
t (float) –
- 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) –
- property direction
- class pxr.Gf.LineSeg
Line segment class
Methods:
FindClosestPoint
(point, t)Returns the point on the line that is closest to
point
.Return the normalized direction of the line.
Return the length of the line.
GetPoint
(t)Return the point on the segment specified by the parameter t.
Attributes:
- FindClosestPoint(point, t) Vec3d
Returns the point on the line that is closest to
point
.If
t
is notNone
, it will be set to the parametric distance along the line of the closest point.- Parameters
point (Vec3d) –
t (float) –
- 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.
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.
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.
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:
- 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) –
- 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) –
- 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) –
- dimension = (2, 2)
- class pxr.Gf.Matrix2f
Methods:
GetColumn
(i)Gets a column of the matrix as a Vec2.
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.
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.
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:
- 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) –
- 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) –
- 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) –
- dimension = (2, 2)
- class pxr.Gf.Matrix3d
Methods:
Returns the rotation corresponding to this matrix.
GetColumn
(i)Gets a column of the matrix as a Vec3.
Returns the determinant of the matrix.
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.
Returns the transpose of the matrix.
Returns true if the vectors in matrix form a left-handed coordinate system.
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.
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:
- 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.
- 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) –
- 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) –
- 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) –
- 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) –
- 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) –
- dimension = (3, 3)
- class pxr.Gf.Matrix3f
Methods:
Returns the rotation corresponding to this matrix.
GetColumn
(i)Gets a column of the matrix as a Vec3.
Returns the determinant of the matrix.
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.
Returns the transpose of the matrix.
Returns true if the vectors in matrix form a left-handed coordinate system.
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.
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:
- 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.
- 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) –
- 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) –
- 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) –
- 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) –
- 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) –
- dimension = (3, 3)
- class pxr.Gf.Matrix4d
Methods:
Returns the rotation corresponding to this matrix.
Returns the rotation corresponding to this matrix.
Return the rotation corresponding to this matrix as a quaternion.
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.
Returns the determinant of the matrix.
Returns the determinant of the upper 3x3 matrix.
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.
Returns the transpose of the matrix.
Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis.
Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.
Returns true if the vectors in the upper 3x3 matrix form a right- handed coordinate system.
Orthonormalize
(issueWarning)Makes the matrix orthonormal in place.
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.
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.
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:
- 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
wheret 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.
- 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) –
- 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) –
- 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) –
- 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.
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.
- 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) –
- 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.
SetTransform(rotmx, translate) -> Matrix4d
Sets matrix to specify a rotation by rotmx and a translation by translate.
- 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) –
- 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:
Returns the rotation corresponding to this matrix.
Returns the rotation corresponding to this matrix.
Return the rotation corresponding to this matrix as a quaternion.
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.
Returns the determinant of the matrix.
Returns the determinant of the upper 3x3 matrix.
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.
Returns the transpose of the matrix.
Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis.
Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.
Returns true if the vectors in the upper 3x3 matrix form a right- handed coordinate system.
Orthonormalize
(issueWarning)Makes the matrix orthonormal in place.
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.
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.
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:
- 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
wheret 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.
- 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) –
- 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) –
- 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) –
- 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.
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.
- 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) –
- 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.
SetTransform(rotmx, translate) -> Matrix4f
Sets matrix to specify a rotation by rotmx and a translation by translate.
- 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) –
- 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.
Uses the given interval to extend the multi-interval in the interval arithmetic sense.
Clear
()Clear the multi-interval.
Returns true if x is inside the multi-interval.
Returns an interval bounding the entire multi-interval.
Return the complement of this set.
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:
- 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) –
- 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.Returns the distance of the plane from the origin.
Give the coefficients of the equation of the plane.
Returns the unit-length normal vector of the plane.
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 atdistance
units from the origin.Transform
(matrix)Transforms the plane by the given matrix.
Attributes:
- 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.
- 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) –
- 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 atdistance
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 throughpoint
.The passed-in normal is normalized to unit length first.
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.
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) –
- property distanceFromOrigin
- property normal
- class pxr.Gf.Quatd
Methods:
Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.
classmethod GetIdentity() -> Quatd
Return the imaginary coefficient.
Return this quaternion's inverse, or reciprocal.
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.
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:
- 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.
- 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) –
- 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:
classmethod GetIdentity() -> Quaternion
Returns the imaginary part of the quaternion.
Returns the inverse of this quaternion.
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.
classmethod GetZero() -> Quaternion
Normalize
(eps)Normalizes this quaternion in place to unit length, returning the length before normalization.
Attributes:
None
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).
- 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:
Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.
classmethod GetIdentity() -> Quatf
Return the imaginary coefficient.
Return this quaternion's inverse, or reciprocal.
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.
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:
- 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.
- 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) –
- 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:
Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.
classmethod GetIdentity() -> Quath
Return the imaginary coefficient.
Return this quaternion's inverse, or reciprocal.
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.
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:
- 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.
- 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) –
- 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.Compute the squared distance from a point to the range.
classmethod GetIntersection(a, b) -> Range1d
GetMax
()Returns the maximum value of the range.
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.
classmethod GetUnion(a, b) -> Range1d
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 includeb
.Attributes:
- 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 ofa
andb
.
- 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 botha
andb
.
- 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).
- UnionWith(b) Range1d
Extend
this
to includeb
.- Parameters
b (Range1d) –
UnionWith(b) -> Range1d
Extend
this
to includeb
.- 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.Compute the squared distance from a point to the range.
classmethod GetIntersection(a, b) -> Range1f
GetMax
()Returns the maximum value of the range.
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.
classmethod GetUnion(a, b) -> Range1f
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 includeb
.Attributes:
- 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 ofa
andb
.
- 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 botha
andb
.
- 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).
- UnionWith(b) Range1f
Extend
this
to includeb
.- Parameters
b (Range1f) –
UnionWith(b) -> Range1f
Extend
this
to includeb
.- 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.
Compute the squared distance from a point to the range.
classmethod GetIntersection(a, b) -> Range2d
GetMax
()Returns the maximum value of the range.
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.
classmethod GetUnion(a, b) -> Range2d
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 includeb
.Attributes:
- 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 ofa
andb
.
- 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() .
- GetQuadrant(i) Range2d
Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.
- Parameters
i (int) –
- static GetUnion()
classmethod GetUnion(a, b) -> Range2d
Returns the smallest
GfRange2d
which contains botha
andb
.
- 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).
- UnionWith(b) Range2d
Extend
this
to includeb
.- Parameters
b (Range2d) –
UnionWith(b) -> Range2d
Extend
this
to includeb
.- 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.
Compute the squared distance from a point to the range.
classmethod GetIntersection(a, b) -> Range2f
GetMax
()Returns the maximum value of the range.
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.
classmethod GetUnion(a, b) -> Range2f
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 includeb
.Attributes:
- 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 ofa
andb
.
- 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() .
- GetQuadrant(i) Range2f
Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.
- Parameters
i (int) –
- static GetUnion()
classmethod GetUnion(a, b) -> Range2f
Returns the smallest
GfRange2f
which contains botha
andb
.
- 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).
- UnionWith(b) Range2f
Extend
this
to includeb
.- Parameters
b (Range2f) –
UnionWith(b) -> Range2f
Extend
this
to includeb
.- 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.
Compute the squared distance from a point to the range.
classmethod GetIntersection(a, b) -> Range3d
GetMax
()Returns the maximum value of the range.
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.
classmethod GetUnion(a, b) -> Range3d
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 includeb
.Attributes:
- 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 ofa
andb
.
- 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() .
- 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) –
- static GetUnion()
classmethod GetUnion(a, b) -> Range3d
Returns the smallest
GfRange3d
which contains botha
andb
.
- 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).
- UnionWith(b) Range3d
Extend
this
to includeb
.- Parameters
b (Range3d) –
UnionWith(b) -> Range3d
Extend
this
to includeb
.- 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.
Compute the squared distance from a point to the range.
classmethod GetIntersection(a, b) -> Range3f
GetMax
()Returns the maximum value of the range.
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.
classmethod GetUnion(a, b) -> Range3f
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 includeb
.Attributes:
- 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 ofa
andb
.
- 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() .
- 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) –
- static GetUnion()
classmethod GetUnion(a, b) -> Range3f
Returns the smallest
GfRange3f
which contains botha
andb
.
- 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).
- UnionWith(b) Range3f
Extend
this
to includeb
.- Parameters
b (Range3f) –
UnionWith(b) -> Range3f
Extend
this
to includeb
.- 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:
Vec3d
Vec3d
- FindClosestPoint(point, rayDistance) Vec3d
Returns the point on the ray that is closest to
point
.If
rayDistance
is notNone
, 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.
- SetPointAndDirection(startPoint, direction) None
Sets the ray by specifying a starting point and a direction.
- 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.
Returns the center point of the rectangle.
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.
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:
- GetArea() int
Return the area 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) –
- GetMaxX() int
Return the X value of the max corner.
- GetMaxY() int
Return the Y value of the max corner.
- 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.
- 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).
- 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.
classmethod DecomposeRotation(rot, TwAxis, FBAxis, LRAxis, handedness, thetaTw, thetaFB, thetaLR, thetaSw, useHint, swShift) -> None
GetAngle
()Returns the rotation angle in degrees.
GetAxis
()Returns the axis of rotation.
Returns the inverse of this rotation.
GetQuat
()Returns the rotation expressed as a quaternion.
Returns the rotation expressed as a quaternion.
classmethod MatchClosestEulerRotation(targetTw, targetFB, targetLR, targetSw, thetaTw, thetaFB, thetaLR, thetaSw) -> None
classmethod RotateOntoProjected(v1, v2, axis) -> Rotation
SetAxisAngle
(axis, angle)Sets the rotation to be
angle
degrees aboutaxis
.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 withrotateTo
.TransformDir
(vec)Transforms row vector
vec
by the rotation, returning the result.Attributes:
- Decompose(axis0, axis1, axis2) Vec3d
Decompose rotation about 3 orthogonal axes.
If the axes are not orthogonal, warnings will be spewed.
- static DecomposeRotation()
classmethod DecomposeRotation(rot, TwAxis, FBAxis, LRAxis, handedness, thetaTw, thetaFB, thetaLR, thetaSw, useHint, swShift) -> None
- static DecomposeRotation3()
- GetAngle() float
Returns the rotation angle in degrees.
- 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
- SetAxisAngle(axis, angle) Rotation
Sets the rotation to be
angle
degrees aboutaxis
.- 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 withrotateTo
.The passed vectors need not be unit length.
- 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:
- 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:
- 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:
Returns a
GfMatrix4d
that implements the cumulative transformation.Returns the pivot orientation component.
Returns the pivot position component.
Returns the rotation component.
GetScale
()Returns the scale component.
Returns the translation component.
Set method used by old 2x code.
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:
- Set()
Set method used by old 2x code. (Deprecated)
- 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:
classmethod Axis(i) -> Vec2d
Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod XAxis() -> Vec2d
classmethod YAxis() -> Vec2d
Attributes:
- 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.
- GetProjection(v) Vec2d
Returns the projection of
this
ontov
.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:
classmethod Axis(i) -> Vec2f
Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod XAxis() -> Vec2f
classmethod YAxis() -> Vec2f
Attributes:
- 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.
- GetProjection(v) Vec2f
Returns the projection of
this
ontov
.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:
classmethod Axis(i) -> Vec2h
Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod XAxis() -> Vec2h
classmethod YAxis() -> Vec2h
Attributes:
- 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.
- GetProjection(v) Vec2h
Returns the projection of
this
ontov
.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:
classmethod Axis(i) -> Vec2i
classmethod XAxis() -> Vec2i
classmethod YAxis() -> Vec2i
Attributes:
- 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:
classmethod Axis(i) -> Vec3d
BuildOrthonormalFrame
(v1, v2, eps)Sets
v1
andv2
to unit vectors such that v1, v2 and *this are mutually orthogonal.Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
classmethod XAxis() -> Vec3d
classmethod YAxis() -> Vec3d
classmethod ZAxis() -> Vec3d
Attributes:
- 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
andv2
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.
- 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.
- GetProjection(v) Vec3d
Returns the projection of
this
ontov
.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.
- 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:
classmethod Axis(i) -> Vec3f
BuildOrthonormalFrame
(v1, v2, eps)Sets
v1
andv2
to unit vectors such that v1, v2 and *this are mutually orthogonal.Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
classmethod XAxis() -> Vec3f
classmethod YAxis() -> Vec3f
classmethod ZAxis() -> Vec3f
Attributes:
- 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
andv2
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.
- 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.
- GetProjection(v) Vec3f
Returns the projection of
this
ontov
.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.
- 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:
classmethod Axis(i) -> Vec3h
BuildOrthonormalFrame
(v1, v2, eps)Sets
v1
andv2
to unit vectors such that v1, v2 and *this are mutually orthogonal.Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod OrthogonalizeBasis(tx, ty, tz, normalize, eps) -> bool
classmethod XAxis() -> Vec3h
classmethod YAxis() -> Vec3h
classmethod ZAxis() -> Vec3h
Attributes:
- 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
andv2
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.
- 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.
- GetProjection(v) Vec3h
Returns the projection of
this
ontov
.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.
- 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:
classmethod Axis(i) -> Vec3i
classmethod XAxis() -> Vec3i
classmethod YAxis() -> Vec3i
classmethod ZAxis() -> Vec3i
Attributes:
- 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:
classmethod Axis(i) -> Vec4d
Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod WAxis() -> Vec4d
classmethod XAxis() -> Vec4d
classmethod YAxis() -> Vec4d
classmethod ZAxis() -> Vec4d
Attributes:
- 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.
- GetProjection(v) Vec4d
Returns the projection of
this
ontov
.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:
classmethod Axis(i) -> Vec4f
Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod WAxis() -> Vec4f
classmethod XAxis() -> Vec4f
classmethod YAxis() -> Vec4f
classmethod ZAxis() -> Vec4f
Attributes:
- 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.
- GetProjection(v) Vec4f
Returns the projection of
this
ontov
.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:
classmethod Axis(i) -> Vec4h
Returns the orthogonal complement of
this->GetProjection(b)
.Length.
GetNormalized
(eps)- param eps
Returns the projection of
this
ontov
.Normalize
(eps)Normalizes the vector in place to unit length, returning the length before normalization.
classmethod WAxis() -> Vec4h
classmethod XAxis() -> Vec4h
classmethod YAxis() -> Vec4h
classmethod ZAxis() -> Vec4h
Attributes:
- 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.
- GetProjection(v) Vec4h
Returns the projection of
this
ontov
.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:
classmethod Axis(i) -> Vec4i
classmethod WAxis() -> Vec4i
classmethod XAxis() -> Vec4i
classmethod YAxis() -> Vec4i
classmethod ZAxis() -> Vec4i
Attributes:
- 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