Math

Maya Dag

findDistanceTwoPoints(startPosition, endPosition)

Finds the distance between two positions in 3d space

Parameters:
  • startPosition (tuple) – Start postition to measure

  • endPosition (tuple) – End position to measure

Return distance:

Rtype distance:

straightLineSpacing(startPosition, endPosition, sectionCount, neg1=True)

given the count of sections, return the length of each space between two points

Parameters:
  • startPosition (tuple) – The start position to be measured xyz

  • endPosition (tuple) – The end position to be measured xyz

  • sectionCount (int) – The amount of divisions/sections in the straight line

  • neg1 (bool) – for joints etc where the last object should be built at the end point

Return spacingLength:

The length of each section

Rtype spacingLength:

float

distanceTwoObjs(startObj, endObj)

Finds the distance between two maya objects

Parameters:
  • startObj (str) – The first object to be measured

  • endObj (str) – The second object to be measured

Return distance:

the distance between the two objects

Rtype distance:

float

straightLineSpacingObjs(startObj, endObj, sectionCount)

Given two objects and a section count, find how long each section is

Parameters:
  • startObj (str) – The first object to be measured

  • endObj (str) – The second object to be measured

  • sectionCount (int) – The amount of divisions/sections in the straight line

Return spacingLength:

The length of each section

Rtype spacingLength:

float

getAimTwoPositions(startPosition, endPosition, worldUpVector=[0, 1, 0])

get the orientation and position of an aim between two positions in 3d space Position will match start position Orientation will aim towards end position given the upVector Returns as (pos, Rot, Roo)

Parameters:
  • startPosition

  • endPosition

  • worldUpVector

Returns:

Return type: