def getCubicPath(elementNode):
 end = evaluate.getVector3FromElementNode(elementNode)
 previousElementNode = elementNode.getPreviousElementNode()
 if (previousElementNode == None):
  print 'Warning, can not get previousElementNode in getCubicPath in cubic for:'
  print elementNode
  return [end]
 begin = elementNode.getPreviousVertex(Vector3())
 evaluatedControlPoints = evaluate.getTransformedPathByKey([], elementNode, 'controlPoints')
 if (len(evaluatedControlPoints) > 1):
  return getCubicPathByBeginEnd(begin, evaluatedControlPoints, elementNode, end)
 controlPoint0 = evaluate.getVector3ByPrefix(None, elementNode, 'controlPoint0')
 controlPoint1 = evaluate.getVector3ByPrefix(None, elementNode, 'controlPoint1')
 if (len(evaluatedControlPoints) == 1):
  controlPoint1 = evaluatedControlPoints[0]
 if (controlPoint0 == None):
  oldControlPoint = evaluate.getVector3ByPrefixes(previousElementNode, ['controlPoint', 'controlPoint1'], None)
  if (oldControlPoint == None):
   oldControlPoints = evaluate.getTransformedPathByKey([], previousElementNode, 'controlPoints')
   if (len(oldControlPoints) > 0):
    oldControlPoint = oldControlPoints[(-1)]
  if (oldControlPoint == None):
   oldControlPoint = end
  controlPoint0 = ((begin + begin) - oldControlPoint)
 return getCubicPathByBeginEnd(begin, [controlPoint0, controlPoint1], elementNode, end)

def getCubicPath ( elementNode ) : end = evaluate . getVector3FromElementNode ( elementNode ) previousElementNode = elementNode . getPreviousElementNode ( ) if ( previousElementNode == None ) : print 'Warning, can not get previousElementNode in getCubicPath in cubic for:' print elementNode return [ end ] begin = elementNode . getPreviousVertex ( Vector3 ( ) ) evaluatedControlPoints = evaluate . getTransformedPathByKey ( [ ] , elementNode , 'controlPoints' ) if ( len ( evaluatedControlPoints ) > 1 ) : return getCubicPathByBeginEnd ( begin , evaluatedControlPoints , elementNode , end ) controlPoint0 = evaluate . getVector3ByPrefix ( None , elementNode , 'controlPoint0' ) controlPoint1 = evaluate . getVector3ByPrefix ( None , elementNode , 'controlPoint1' ) if ( len ( evaluatedControlPoints ) == 1 ) : controlPoint1 = evaluatedControlPoints [ 0 ] if ( controlPoint0 == None ) : oldControlPoint = evaluate . getVector3ByPrefixes ( previousElementNode , [ 'controlPoint' , 'controlPoint1' ] , None ) if ( oldControlPoint == None ) : oldControlPoints = evaluate . getTransformedPathByKey ( [ ] , previousElementNode , 'controlPoints' ) if ( len ( oldControlPoints ) > 0 ) : oldControlPoint = oldControlPoints [ ( - 1 ) ] if ( oldControlPoint == None ) : oldControlPoint = end controlPoint0 = ( ( begin + begin ) - oldControlPoint ) return getCubicPathByBeginEnd ( begin , [ controlPoint0 , controlPoint1 ] , elementNode , end )
get the cubic path .