Gf module#

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


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

Classes:

BBox3d

Arbitrarily oriented 3D bounding box

Camera

DualQuatd

DualQuatf

DualQuath

Frustum

Basic view frustum

Interval

Basic mathematical interval class

Line

Line class

LineSeg

Line segment class

Matrix2d

Matrix2f

Matrix3d

Matrix3f

Matrix4d

Matrix4f

MultiInterval

Plane

Quatd

Quaternion

Quaternion class

Quatf

Quath

Range1d

Range1f

Range2d

Range2f

Range3d

Range3f

Ray

Rect2i

Rotation

3-space rotation

Size2

A 2D size class

Size3

A 3D size class

Transform

Vec2d

Vec2f

Vec2h

Vec2i

Vec3d

Vec3f

Vec3h

Vec3i

Vec4d

Vec4f

Vec4h

Vec4i

class pxr.Gf.BBox3d#

Arbitrarily oriented 3D bounding box

Methods:

Attributes:

static Combine()#
ComputeAlignedBox()#
ComputeAlignedRange()#
ComputeCentroid()#
GetBox()#
GetInverseMatrix()#
GetMatrix()#
GetRange()#
GetVolume()#
HasZeroAreaPrimitives()#
Set()#
SetHasZeroAreaPrimitives()#
SetMatrix()#
SetRange()#
Transform()#
property box#
property hasZeroAreaPrimitives#
property matrix#
class pxr.Gf.Camera#

Classes:

Methods:

Attributes:

class FOVDirection#

Methods:

Attributes:

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

Methods:

Attributes:

static GetValueFromName()#
allValues = (Gf.Camera.Perspective, Gf.Camera.Orthographic)#
GetFieldOfView()#
SetFromViewAndProjectionMatrix()#
SetOrthographicFromAspectRatioAndSize()#
SetPerspectiveFromAspectRatioAndFieldOfView()#
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#
property clippingPlanes#
property clippingRange#
property fStop#
property focalLength#
property focusDistance#
property frustum#
property horizontalAperture#
property horizontalApertureOffset#
property horizontalFieldOfView#
property projection#
property transform#
property verticalAperture#
property verticalApertureOffset#
property verticalFieldOfView#
class pxr.Gf.DualQuatd#

Methods:

Attributes:

GetConjugate()#
GetDual()#
static GetIdentity()#
GetInverse()#
GetLength()#
GetNormalized()#
GetReal()#
GetTranslation()#
static GetZero()#
Normalize()#
SetDual()#
SetReal()#
SetTranslation()#
Transform()#
property dual#
property real#
class pxr.Gf.DualQuatf#

Methods:

Attributes:

GetConjugate()#
GetDual()#
static GetIdentity()#
GetInverse()#
GetLength()#
GetNormalized()#
GetReal()#
GetTranslation()#
static GetZero()#
Normalize()#
SetDual()#
SetReal()#
SetTranslation()#
Transform()#
property dual#
property real#
class pxr.Gf.DualQuath#

Methods:

Attributes:

GetConjugate()#
GetDual()#
static GetIdentity()#
GetInverse()#
GetLength()#
GetNormalized()#
GetReal()#
GetTranslation()#
static GetZero()#
Normalize()#
SetDual()#
SetReal()#
SetTranslation()#
Transform()#
property dual#
property real#
class pxr.Gf.Frustum#

Basic view frustum

Classes:

Methods:

Attributes:

class ProjectionType#

Methods:

Attributes:

static GetValueFromName()#
allValues = (Gf.Frustum.Orthographic, Gf.Frustum.Perspective)#
ComputeAspectRatio()#
ComputeCorners()#
ComputeCornersAtDistance()#
ComputeLookAtPoint()#
ComputeNarrowedFrustum()#
ComputePickRay()#
ComputeProjectionMatrix()#
ComputeUpVector()#
ComputeViewDirection()#
ComputeViewFrame()#
ComputeViewInverse()#
ComputeViewMatrix()#
FitToSphere()#
GetFOV()#

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

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

GetNearFar()#
GetOrthographic()#
GetPerspective()#

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

GetPosition()#
GetProjectionType()#
static GetReferencePlaneDepth()#
GetRotation()#
GetViewDistance()#
GetWindow()#
Intersects()#
static IntersectsViewVolume()#
SetNearFar()#
SetOrthographic()#
SetPerspective()#
SetPosition()#
SetPositionAndRotationFromMatrix()#
SetProjectionType()#
SetRotation()#
SetViewDistance()#
SetWindow()#
Transform()#
Orthographic = Gf.Frustum.Orthographic#
Perspective = Gf.Frustum.Perspective#
property nearFar#
property position#
property projectionType#
property rotation#
property viewDistance#
property window#
class pxr.Gf.Interval#

Basic mathematical interval class

Methods:

Contains

Returns true if x is inside the interval.

GetFullInterval

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

IsEmpty

True if the interval is empty.

IsFinite

IsMaxClosed

IsMaxFinite

IsMaxOpen

IsMinClosed

IsMinFinite

IsMinOpen

SetMax

Set the maximum value.

SetMin

Set the minimum value.

Attributes:

finite

isEmpty

True if the interval is empty.

max

The maximum value.

maxClosed

maxFinite

maxOpen

min

The minimum value.

minClosed

minFinite

minOpen

size

The width of the interval.

Contains()#

Returns true if x is inside the interval.

Returns true if x is inside the interval.

static GetFullInterval()#
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()#
IsEmpty()#

True if the interval is empty.

IsFinite()#
IsMaxClosed()#
IsMaxFinite()#
IsMaxOpen()#
IsMinClosed()#
IsMinFinite()#
IsMinOpen()#
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:

Attributes:

FindClosestPoint()#
GetDirection()#
GetPoint()#
Set()#
property direction#
class pxr.Gf.LineSeg#

Line segment class

Methods:

Attributes:

FindClosestPoint()#
GetDirection()#
GetLength()#
GetPoint()#
property direction#
property length#
class pxr.Gf.Matrix2d#

Methods:

Attributes:

GetColumn()#
GetDeterminant()#
GetInverse()#
GetRow()#
GetTranspose()#
Set()#
SetColumn()#
SetDiagonal()#
SetIdentity()#
SetRow()#
SetZero()#
dimension = (2, 2)#
class pxr.Gf.Matrix2f#

Methods:

Attributes:

GetColumn()#
GetDeterminant()#
GetInverse()#
GetRow()#
GetTranspose()#
Set()#
SetColumn()#
SetDiagonal()#
SetIdentity()#
SetRow()#
SetZero()#
dimension = (2, 2)#
class pxr.Gf.Matrix3d#

Methods:

Attributes:

ExtractRotation()#
GetColumn()#
GetDeterminant()#
GetHandedness()#
GetInverse()#
GetOrthonormalized()#
GetRow()#
GetTranspose()#
IsLeftHanded()#
IsRightHanded()#
Orthonormalize()#
Set()#
SetColumn()#
SetDiagonal()#
SetIdentity()#
SetRotate()#
SetRow()#
SetScale()#
SetZero()#
dimension = (3, 3)#
class pxr.Gf.Matrix3f#

Methods:

Attributes:

ExtractRotation()#
GetColumn()#
GetDeterminant()#
GetHandedness()#
GetInverse()#
GetOrthonormalized()#
GetRow()#
GetTranspose()#
IsLeftHanded()#
IsRightHanded()#
Orthonormalize()#
Set()#
SetColumn()#
SetDiagonal()#
SetIdentity()#
SetRotate()#
SetRow()#
SetScale()#
SetZero()#
dimension = (3, 3)#
class pxr.Gf.Matrix4d#

Methods:

Attributes:

ExtractRotation()#
ExtractRotationMatrix()#
ExtractRotationQuat()#
ExtractTranslation()#
Factor()#
GetColumn()#
GetDeterminant()#
GetDeterminant3()#
GetHandedness()#
GetInverse()#
GetOrthonormalized()#
GetRow()#
GetRow3()#
GetTranspose()#
HasOrthogonalRows3()#
IsLeftHanded()#
IsRightHanded()#
Orthonormalize()#
RemoveScaleShear()#
Set()#
SetColumn()#
SetDiagonal()#
SetIdentity()#
SetLookAt()#
SetRotate()#
SetRotateOnly()#
SetRow()#
SetRow3()#
SetScale()#
SetTransform()#
SetTranslate()#
SetTranslateOnly()#
SetZero()#
Transform()#
TransformAffine()#
TransformDir()#
dimension = (4, 4)#
class pxr.Gf.Matrix4f#

Methods:

Attributes:

ExtractRotation()#
ExtractRotationMatrix()#
ExtractRotationQuat()#
ExtractTranslation()#
Factor()#
GetColumn()#
GetDeterminant()#
GetDeterminant3()#
GetHandedness()#
GetInverse()#
GetOrthonormalized()#
GetRow()#
GetRow3()#
GetTranspose()#
HasOrthogonalRows3()#
IsLeftHanded()#
IsRightHanded()#
Orthonormalize()#
RemoveScaleShear()#
Set()#
SetColumn()#
SetDiagonal()#
SetIdentity()#
SetLookAt()#
SetRotate()#
SetRotateOnly()#
SetRow()#
SetRow3()#
SetScale()#
SetTransform()#
SetTranslate()#
SetTranslateOnly()#
SetZero()#
Transform()#
TransformAffine()#
TransformDir()#
dimension = (4, 4)#
class pxr.Gf.MultiInterval#

Methods:

Attributes:

Add()#
ArithmeticAdd()#
Clear()#
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()#
GetComplement()#
GetContainingInterval()#
static GetFullInterval()#
GetNextNonContainingInterval()#
GetPriorNonContainingInterval()#
GetSize()#
Intersect()#
IsEmpty()#
Remove()#
property bounds#
property isEmpty#
property size#
class pxr.Gf.Plane#

Methods:

Attributes:

GetDistance()#
GetDistanceFromOrigin()#
GetEquation()#
GetNormal()#
IntersectsPositiveHalfSpace()#
Project()#
Reorient()#
Set()#
Transform()#
property distanceFromOrigin#
property normal#
class pxr.Gf.Quatd#

Methods:

Attributes:

GetConjugate()#
static GetIdentity()#
GetImaginary()#
GetInverse()#
GetLength()#
GetNormalized()#
GetReal()#
static GetZero()#
Normalize()#
SetImaginary()#
SetReal()#
Transform()#
property imaginary#
property real#
class pxr.Gf.Quaternion#

Quaternion class

Methods:

Attributes:

static GetIdentity()#
GetImaginary()#
GetInverse()#
GetLength()#
GetNormalized()#
GetReal()#
static GetZero()#
Normalize()#
property imaginary#
property real#
class pxr.Gf.Quatf#

Methods:

Attributes:

GetConjugate()#
static GetIdentity()#
GetImaginary()#
GetInverse()#
GetLength()#
GetNormalized()#
GetReal()#
static GetZero()#
Normalize()#
SetImaginary()#
SetReal()#
Transform()#
property imaginary#
property real#
class pxr.Gf.Quath#

Methods:

Attributes:

GetConjugate()#
static GetIdentity()#
GetImaginary()#
GetInverse()#
GetLength()#
GetNormalized()#
GetReal()#
static GetZero()#
Normalize()#
SetImaginary()#
SetReal()#
Transform()#
property imaginary#
property real#
class pxr.Gf.Range1d#

Methods:

Attributes:

Contains()#
GetDistanceSquared()#
static GetIntersection()#
GetMax()#
GetMidpoint()#
GetMin()#
GetSize()#
static GetUnion()#
IntersectWith()#
IsEmpty()#
SetEmpty()#
SetMax()#
SetMin()#
UnionWith()#
dimension = 1#
property max#
property min#
class pxr.Gf.Range1f#

Methods:

Attributes:

Contains()#
GetDistanceSquared()#
static GetIntersection()#
GetMax()#
GetMidpoint()#
GetMin()#
GetSize()#
static GetUnion()#
IntersectWith()#
IsEmpty()#
SetEmpty()#
SetMax()#
SetMin()#
UnionWith()#
dimension = 1#
property max#
property min#
class pxr.Gf.Range2d#

Methods:

Attributes:

Contains()#
GetCorner()#
GetDistanceSquared()#
static GetIntersection()#
GetMax()#
GetMidpoint()#
GetMin()#
GetQuadrant()#
GetSize()#
static GetUnion()#
IntersectWith()#
IsEmpty()#
SetEmpty()#
SetMax()#
SetMin()#
UnionWith()#
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:

Attributes:

Contains()#
GetCorner()#
GetDistanceSquared()#
static GetIntersection()#
GetMax()#
GetMidpoint()#
GetMin()#
GetQuadrant()#
GetSize()#
static GetUnion()#
IntersectWith()#
IsEmpty()#
SetEmpty()#
SetMax()#
SetMin()#
UnionWith()#
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:

Attributes:

Contains()#
GetCorner()#
GetDistanceSquared()#
static GetIntersection()#
GetMax()#
GetMidpoint()#
GetMin()#
GetOctant()#
GetSize()#
static GetUnion()#
IntersectWith()#
IsEmpty()#
SetEmpty()#
SetMax()#
SetMin()#
UnionWith()#
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:

Attributes:

Contains()#
GetCorner()#
GetDistanceSquared()#
static GetIntersection()#
GetMax()#
GetMidpoint()#
GetMin()#
GetOctant()#
GetSize()#
static GetUnion()#
IntersectWith()#
IsEmpty()#
SetEmpty()#
SetMax()#
SetMin()#
UnionWith()#
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

GetPoint

Intersect(p0, p1, p2)

float, barycentric = GfVec3d, frontFacing = bool>

SetEnds

SetPointAndDirection

Transform

Attributes:

FindClosestPoint()#
GetPoint()#
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()#
SetPointAndDirection()#
Transform()#
property direction#
property startPoint#
class pxr.Gf.Rect2i#

Methods:

Attributes:

Contains()#
GetArea()#
GetCenter()#
GetHeight()#
GetIntersection()#
GetMax()#
GetMaxX()#
GetMaxY()#
GetMin()#
GetMinX()#
GetMinY()#
GetNormalized()#
GetSize()#
GetUnion()#
GetWidth()#
IsEmpty()#
IsNull()#
IsValid()#
SetMax()#
SetMaxX()#
SetMaxY()#
SetMin()#
SetMinX()#
SetMinY()#
Translate()#
property max#
property maxX#
property maxY#
property min#
property minX#
property minY#
class pxr.Gf.Rotation#

3-space rotation

Methods:

Attributes:

Decompose()#
static DecomposeRotation()#
static DecomposeRotation3()#
GetAngle()#
GetAxis()#
GetInverse()#
GetQuat()#
GetQuaternion()#
static MatchClosestEulerRotation()#
static RotateOntoProjected()#
SetAxisAngle()#
SetIdentity()#
SetQuat()#
SetQuaternion()#
SetRotateInto()#
TransformDir()#
property angle#
property axis#
class pxr.Gf.Size2#

A 2D size class

Methods:

Set

Attributes:

Set()#
dimension = 2#
class pxr.Gf.Size3#

A 3D size class

Methods:

Set

Attributes:

Set()#
dimension = 3#
class pxr.Gf.Transform#

Methods:

Attributes:

GetMatrix()#
GetPivotOrientation()#
GetPivotPosition()#
GetRotation()#
GetScale()#
GetTranslation()#
Set()#

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

SetIdentity()#
SetMatrix()#
SetPivotOrientation()#
SetPivotPosition()#
SetRotation()#
SetScale()#
SetTranslation()#
property pivotOrientation#
property pivotPosition#
property rotation#
property scale#
property translation#
class pxr.Gf.Vec2d#

Methods:

Attributes:

static Axis()#
GetComplement()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static XAxis()#
static YAxis()#
dimension = 2#
class pxr.Gf.Vec2f#

Methods:

Attributes:

static Axis()#
GetComplement()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static XAxis()#
static YAxis()#
dimension = 2#
class pxr.Gf.Vec2h#

Methods:

Attributes:

static Axis()#
GetComplement()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static XAxis()#
static YAxis()#
dimension = 2#
class pxr.Gf.Vec2i#

Methods:

Attributes:

static Axis()#
GetDot()#
static XAxis()#
static YAxis()#
dimension = 2#
class pxr.Gf.Vec3d#

Methods:

Attributes:

static Axis()#
BuildOrthonormalFrame()#
GetComplement()#
GetCross()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static OrthogonalizeBasis()#
static XAxis()#
static YAxis()#
static ZAxis()#
dimension = 3#
class pxr.Gf.Vec3f#

Methods:

Attributes:

static Axis()#
BuildOrthonormalFrame()#
GetComplement()#
GetCross()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static OrthogonalizeBasis()#
static XAxis()#
static YAxis()#
static ZAxis()#
dimension = 3#
class pxr.Gf.Vec3h#

Methods:

Attributes:

static Axis()#
BuildOrthonormalFrame()#
GetComplement()#
GetCross()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static OrthogonalizeBasis()#
static XAxis()#
static YAxis()#
static ZAxis()#
dimension = 3#
class pxr.Gf.Vec3i#

Methods:

Attributes:

static Axis()#
GetDot()#
static XAxis()#
static YAxis()#
static ZAxis()#
dimension = 3#
class pxr.Gf.Vec4d#

Methods:

Attributes:

static Axis()#
GetComplement()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static WAxis()#
static XAxis()#
static YAxis()#
static ZAxis()#
dimension = 4#
class pxr.Gf.Vec4f#

Methods:

Attributes:

static Axis()#
GetComplement()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static WAxis()#
static XAxis()#
static YAxis()#
static ZAxis()#
dimension = 4#
class pxr.Gf.Vec4h#

Methods:

Attributes:

static Axis()#
GetComplement()#
GetDot()#
GetLength()#
GetNormalized()#
GetProjection()#
Normalize()#
static WAxis()#
static XAxis()#
static YAxis()#
static ZAxis()#
dimension = 4#
class pxr.Gf.Vec4i#

Methods:

Attributes:

static Axis()#
GetDot()#
static WAxis()#
static XAxis()#
static YAxis()#
static ZAxis()#
dimension = 4#