def insertTwistPortions(derivation, elementNode):
 interpolationDictionary = derivation.interpolationDictionary
 interpolationTwist = Interpolation().getByPrefixX(elementNode, derivation.twistPathDefault, 'twist')
 interpolationDictionary['twist'] = interpolationTwist
 for point in interpolationTwist.path:
  point.y = math.radians(point.y)
 remainderPortionDirections = interpolationTwist.portionDirections[1:]
 interpolationTwist.portionDirections = [interpolationTwist.portionDirections[0]]
 if (elementNode != None):
  twistPrecision = setting.getTwistPrecisionRadians(elementNode)
 for remainderPortionDirection in remainderPortionDirections:
  addTwistPortions(interpolationTwist, remainderPortionDirection, twistPrecision)
  interpolationTwist.portionDirections.append(remainderPortionDirection)

def insertTwistPortions ( derivation , elementNode ) : interpolationDictionary = derivation . interpolationDictionary interpolationTwist = Interpolation ( ) . getByPrefixX ( elementNode , derivation . twistPathDefault , 'twist' ) interpolationDictionary [ 'twist' ] = interpolationTwist for point in interpolationTwist . path : point . y = math . radians ( point . y ) remainderPortionDirections = interpolationTwist . portionDirections [ 1 : ] interpolationTwist . portionDirections = [ interpolationTwist . portionDirections [ 0 ] ] if ( elementNode != None ) : twistPrecision = setting . getTwistPrecisionRadians ( elementNode ) for remainderPortionDirection in remainderPortionDirections : addTwistPortions ( interpolationTwist , remainderPortionDirection , twistPrecision ) interpolationTwist . portionDirections . append ( remainderPortionDirection )
insert twist portions and radian the twist .