def getQuadraticPath(xmlElement): "Get the quadratic path." end = evaluate.getVector3FromXMLElement(xmlElement) previousXMLElement = xmlElement.getPreviousXMLElement() if previousXMLElement == None: print( 'Warning, can not get previousXMLElement in getQuadraticPath in quadratic for:' ) print(xmlElement) return [end] begin = xmlElement.getPreviousVertex(Vector3()) controlPoint = evaluate.getVector3ByPrefix('controlPoint', None, xmlElement) if controlPoint == None: oldControlPoint = evaluate.getVector3ByPrefixes( ['controlPoint', 'controlPoint1'], None, previousXMLElement) if oldControlPoint == None: print( 'Warning, can not get oldControlPoint in getQuadraticPath in quadratic for:' ) print(xmlElement) return [end] controlPoint = begin + begin - oldControlPoint evaluate.addVector3ToXMLElement('controlPoint', controlPoint, xmlElement) return svg_reader.getQuadraticPoints( begin, controlPoint, end, lineation.getNumberOfBezierPoints(begin, end, xmlElement))
def getQuadraticPath(xmlElement): "Get the quadratic path." end = evaluate.getVector3FromXMLElement(xmlElement) previousXMLElement = xmlElement.getPreviousXMLElement() if previousXMLElement == None: print('Warning, can not get previousXMLElement in getQuadraticPath in quadratic for:') print(xmlElement) return [end] begin = xmlElement.getPreviousVertex(Vector3()) controlPoint = evaluate.getVector3ByPrefix(None, 'controlPoint', xmlElement) if controlPoint == None: oldControlPoint = evaluate.getVector3ByPrefixes(['controlPoint','controlPoint1'], None, previousXMLElement) if oldControlPoint == None: oldControlPoint = end controlPoint = begin + begin - oldControlPoint evaluate.addVector3ToXMLElement('controlPoint', controlPoint, xmlElement) return svg_reader.getQuadraticPoints(begin, controlPoint, end, lineation.getNumberOfBezierPoints(begin, end, xmlElement))