コード例 #1
0
ファイル: cubic.py プロジェクト: lImbus/giseburt-ReplicatorG
def getCubicPath(xmlElement):
    "Get the cubic path."
    end = evaluate.getVector3FromXMLElement(xmlElement)
    previousXMLElement = xmlElement.getPreviousXMLElement()
    if previousXMLElement == None:
        print(
            'Warning, can not get previousXMLElement in getCubicPath in cubic for:'
        )
        print(xmlElement)
        return [end]
    begin = xmlElement.getPreviousVertex(Vector3())
    controlPoint0 = evaluate.getVector3ByPrefix('controlPoint0', None,
                                                xmlElement)
    if controlPoint0 == None:
        oldControlPoint = evaluate.getVector3ByPrefixes(
            ['controlPoint', 'controlPoint1'], None, previousXMLElement)
        if oldControlPoint == None:
            print(
                'Warning, can not get oldControlPoint in getCubicPath in cubic for:'
            )
            print(xmlElement)
            return [end]
        controlPoint0 = begin + begin - oldControlPoint
    controlPoints = [
        controlPoint0,
        evaluate.getVector3ByPrefix('controlPoint1', None, xmlElement)
    ]
    return svg_reader.getCubicPoints(
        begin, controlPoints, end,
        lineation.getNumberOfBezierPoints(begin, end, xmlElement))
コード例 #2
0
ファイル: cubic.py プロジェクト: D1plo1d/ReplicatorG
def getCubicPath(xmlElement):
	"Get the cubic path."
	end = evaluate.getVector3FromXMLElement(xmlElement)
	previousXMLElement = xmlElement.getPreviousXMLElement()
	if previousXMLElement == None:
		print('Warning, can not get previousXMLElement in getCubicPath in cubic for:')
		print(xmlElement)
		return [end]
	begin = xmlElement.getPreviousVertex(Vector3())
	controlPoint0 = evaluate.getVector3ByPrefix('controlPoint0', None, xmlElement)
	if controlPoint0 == None:
		oldControlPoint = evaluate.getVector3ByPrefixes(['controlPoint','controlPoint1'], None, previousXMLElement)
		if oldControlPoint == None:
			print('Warning, can not get oldControlPoint in getCubicPath in cubic for:')
			print(xmlElement)
			return [end]
		controlPoint0 = begin + begin - oldControlPoint
	controlPoints = [controlPoint0, evaluate.getVector3ByPrefix('controlPoint1', None, xmlElement)]
	return svg_reader.getCubicPoints(begin, controlPoints, end, lineation.getNumberOfBezierPoints(begin, end, xmlElement))
コード例 #3
0
ファイル: cubic.py プロジェクト: schneider-engineering/SFACT
def getCubicPathByBeginEnd(begin, controlPoints, elementNode, end):
	"Get the cubic path by begin and end."
	return svg_reader.getCubicPoints(begin, controlPoints, end, lineation.getNumberOfBezierPoints(begin, elementNode, end))