def getCarvableObject(globalObject, object, xmlElement):
	"Get new carvable object info."
	object.xmlObject = globalObject()
	object.xmlObject.xmlElement = object
	object.attributeDictionary['id'] = xmlElement.getFirstChildByLocalName('name').text
	coords = xmlElement.getFirstChildByLocalName('coords')
	transformXMLElement = getTransformXMLElement(coords, 'transformFrom')
	if len(transformXMLElement.attributeDictionary) < 16:
		transformXMLElement = getTransformXMLElement(coords, 'transformTo')
	matrix.setXMLElementDictionaryMatrix(object.xmlObject.matrix4X4.getFromXMLElement('', transformXMLElement), object)
	return object.xmlObject
Exemple #2
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
	"""Get bottomed geometryOutput."""
	derivation = BottomDerivation(prefix, xmlElement)
	copyShallow = xmlElement.getCopyShallow()
	solid.processXMLElementByGeometry(geometryOutput, copyShallow)
	targetMatrix = matrix.getBranchMatrixSetXMLElement(xmlElement)
	matrix.setXMLElementDictionaryMatrix(targetMatrix, copyShallow)
	minimumZ = boolean_geometry.getMinimumZ(copyShallow.xmlObject)
	copyShallow.parent.xmlObject.archivableObjects.remove(copyShallow.xmlObject)
	lift = derivation.altitude - minimumZ
	vertexes = matrix.getVertexes(geometryOutput)
	for vertex in vertexes:
		vertex.z += lift
	return geometryOutput
Exemple #3
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
    'Get bottomed geometryOutput.'
    derivation = BottomDerivation(prefix, xmlElement)
    copyShallow = xmlElement.getCopyShallow()
    solid.processXMLElementByGeometry(geometryOutput, copyShallow)
    targetMatrix = matrix.getBranchMatrixSetXMLElement(xmlElement)
    matrix.setXMLElementDictionaryMatrix(targetMatrix, copyShallow)
    minimumZ = boolean_geometry.getMinimumZ(copyShallow.xmlObject)
    copyShallow.parent.xmlObject.archivableObjects.remove(
        copyShallow.xmlObject)
    lift = derivation.altitude - minimumZ
    vertexes = matrix.getVertexes(geometryOutput)
    for vertex in vertexes:
        vertex.z += lift
    return geometryOutput
Exemple #4
0
def bottomXMLElement(derivation, target):
	"""Bottom target."""
	xmlObject = target.xmlObject
	if xmlObject is None:
		print('Warning, bottomTarget in bottom could not get xmlObject for:')
		print(target)
		print(derivation.xmlElement)
		return
	targetMatrix = matrix.getBranchMatrixSetXMLElement(target)
	lift = derivation.altitude
	transformedPaths = xmlObject.getTransformedPaths()
	if len(transformedPaths) > 0:
		lift += derivation.getAdditionalPathLift() - euclidean.getBottomByPaths(transformedPaths)
	else:
		lift -= boolean_geometry.getMinimumZ(xmlObject)
	targetMatrix.tetragrid = matrix.getIdentityTetragrid(targetMatrix.tetragrid)
	targetMatrix.tetragrid[2][3] += lift
	matrix.setXMLElementDictionaryMatrix(targetMatrix, target)
Exemple #5
0
def bottomXMLElement(derivation, target):
    "Bottom target."
    xmlObject = target.xmlObject
    if xmlObject == None:
        print('Warning, bottomTarget in bottom could not get xmlObject for:')
        print(target)
        print(derivation.xmlElement)
        return
    targetMatrix = matrix.getBranchMatrixSetXMLElement(target)
    lift = derivation.altitude
    transformedPaths = xmlObject.getTransformedPaths()
    if len(transformedPaths) > 0:
        lift += derivation.getAdditionalPathLift(
        ) - euclidean.getBottomByPaths(transformedPaths)
    else:
        lift -= boolean_geometry.getMinimumZ(xmlObject)
    targetMatrix.tetragrid = matrix.getIdentityTetragrid(
        targetMatrix.tetragrid)
    targetMatrix.tetragrid[2][3] += lift
    matrix.setXMLElementDictionaryMatrix(targetMatrix, target)