mgear.core.meshNavigation

Functions to help navigate the mesh topology

mgear.core.meshNavigation.bBoxData(obj=None, yZero=False, *args)

Get bounding box data of a mesh object

Parameters:
  • obj (dagNode) – Mesh object
  • yZero (bool) – If True, sets the Y axis value to 0 in world space
  • args
Returns:

center, radio, bounding box full data

Return type:

list

mgear.core.meshNavigation.bboxCenter(obj, radius=False)

Get bounding box center of mesh object

Parameters:
  • obj (dagNode) – mesh object
  • radius (bool) – If True return a list the center + the radius
Returns:

the bounding box center in world space

Return type:

list of float

>>> center = mnav.bboxCenter(source, radius=False)
mgear.core.meshNavigation.edgeRangeInLoopFromMid(edgeList, midPos, endA, endB)

Return a range of edges in the same loop from a mid position

Parameters:
  • edgeList (list) – selection edge loop
  • midPos (vertex) – mid vertex
  • endA (vertex) – endA vertex
  • endB (vertex) – endB vertex
Returns:

loop range

Return type:

list

mgear.core.meshNavigation.find_mirror_edge(obj, edgeIndx)

Return the mirror edge of an edge

Parameters:
  • obj (PyNode or str) – Mesh object to get the mirror edge
  • edge (int) – Index of the edge to find the mirror
Returns:

Mirror edge as a pynode

Return type:

PyNode

mgear.core.meshNavigation.getClosestPolygonFromTransform(geo, loc)

Get closest polygon from transform

Parameters:
  • geo (dagNode) – Mesh object
  • loc (matrix) – location transform
Returns:

Closest Polygon

mgear.core.meshNavigation.getClosestVertexFromTransform(geo, loc)

Get closest vertex from transform

Parameters:
  • geo (dagNode or str) – Mesh object
  • loc (matrix) – location transform
Returns:

Closest Vertex

>>> v = mn.getClosestVertexFromTransform(geometry, joint)
mgear.core.meshNavigation.getConcentricVertexLoop(loop, nbLoops)

Get concentric vertex loops

Parameters:
  • loop (list) – Vertex loop list
  • nbLoops (int) – Number of loops to search
Returns:

the loop list

Return type:

list

mgear.core.meshNavigation.getExtremeVertexFromLoop(edgeList=None, sideRange=False)

Get extreme vertex X and Y

min and max positions from edge loop

Parameters:
  • edgeList (list) – Edge list
  • sideRange (bool) – If True will calculate the extreme position of Z instead of X
Returns:

upPos, lowPos, inPos, outPos, edgeList, vertexList

Return type:

list

mgear.core.meshNavigation.getVertexRowsFromLoops(loopList)

Get vertex rows from edge loops

Parameters:loopList (list) – Edge loop list
Returns:vertex rows
Return type:list
mgear.core.meshNavigation.get_closes_edge_index(sourceGeo, targetGeo, edgeIndx)

Get the closes edge index from 2 diferent object.

In some situation even with same topology and vertez index order. The edge index may change.

Parameters:
  • sourceGeo (str) – Name of the source object
  • targetGeo (str) – Name of the target object
  • edgeIndx (int) – Edge Index
Returns:

Description

Return type:

PyNode