def getHelixComplexPath(derivation, elementNode):
 helixTypeFirstCharacter = derivation.helixType.lower()[:1]
 if (helixTypeFirstCharacter == 'b'):
  return [complex(), complex(1.0, 1.0)]
 if (helixTypeFirstCharacter == 'h'):
  return [complex(), complex(0.5, 0.5), complex(1.0, 0.0)]
 if (helixTypeFirstCharacter == 'p'):
  helixComplexPath = []
  x = 0.0
  xStep = (setting.getLayerThickness(elementNode) / derivation.faceWidth)
  justBelowOne = (1.0 - (0.5 * xStep))
  while (x < justBelowOne):
   distanceFromCenter = (0.5 - x)
   parabolicTwist = (0.25 - (distanceFromCenter * distanceFromCenter))
   helixComplexPath.append(complex(x, parabolicTwist))
   x += xStep
  helixComplexPath.append(complex(1.0, 0.0))
  return helixComplexPath
 print 'Warning, the helix type was not one of (basic, herringbone or parabolic) in getHelixComplexPath in gear for:'
 print derivation.helixType
 print derivation.elementNode

def getHelixComplexPath ( derivation , elementNode ) : helixTypeFirstCharacter = derivation . helixType . lower ( ) [ : 1 ] if ( helixTypeFirstCharacter == 'b' ) : return [ complex ( ) , complex ( 1.0 , 1.0 ) ] if ( helixTypeFirstCharacter == 'h' ) : return [ complex ( ) , complex ( 0.5 , 0.5 ) , complex ( 1.0 , 0.0 ) ] if ( helixTypeFirstCharacter == 'p' ) : helixComplexPath = [ ] x = 0.0 xStep = ( setting . getLayerThickness ( elementNode ) / derivation . faceWidth ) justBelowOne = ( 1.0 - ( 0.5 * xStep ) ) while ( x < justBelowOne ) : distanceFromCenter = ( 0.5 - x ) parabolicTwist = ( 0.25 - ( distanceFromCenter * distanceFromCenter ) ) helixComplexPath . append ( complex ( x , parabolicTwist ) ) x += xStep helixComplexPath . append ( complex ( 1.0 , 0.0 ) ) return helixComplexPath print 'Warning, the helix type was not one of (basic, herringbone or parabolic) in getHelixComplexPath in gear for:' print derivation . helixType print derivation . elementNode
set gear helix path .