Ejemplo n.º 1
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get equated geometryOutput.'
	flippedGeometryOutput = triangle_mesh.getGeometryOutputCopy(geometryOutput)
	flip.flipPoints(elementNode, matrix.getVertexes(flippedGeometryOutput), prefix)
	if flip.getShouldReverse(elementNode, prefix):
		flippedFaces = face.getFaces(flippedGeometryOutput)
		for flippedFace in flippedFaces:
			flippedFace.vertexIndexes.reverse()
	return {'union' : {'shapes' : [flippedGeometryOutput, geometryOutput]}}
Ejemplo n.º 2
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
	"""Get equated geometryOutput."""
	flippedGeometryOutput = triangle_mesh.getGeometryOutputCopy(geometryOutput)
	flip.flipPoints(matrix.getVertexes(flippedGeometryOutput), prefix, xmlElement)
	if flip.getShouldReverse(prefix, xmlElement):
		flippedFaces = face.getFaces(flippedGeometryOutput)
		for flippedFace in flippedFaces:
			flippedFace.vertexIndexes.reverse()
	return {'union' : {'shapes' : [flippedGeometryOutput, geometryOutput]}}
Ejemplo n.º 3
0
def addNegativeSphere(derivation, negatives, x):
    'Add negative sphere at x.'
    radius = Vector3(derivation.radiusPlusClearance,
                     derivation.radiusPlusClearance,
                     derivation.radiusPlusClearance)
    sphereOutput = sphere.getGeometryOutput(
        radius, derivation.xmlElement.getCopyShallow())
    euclidean.translateVector3Path(matrix.getVertexes(sphereOutput),
                                   Vector3(x, 0.0, derivation.demiheight))
    negatives.append(sphereOutput)
Ejemplo n.º 4
0
def addCylinderOutputByEndStart(endZ, inradiusComplex, outputs, sides, start, topOverBottom=1.0):
	'Add cylinder triangle mesh by endZ, inradius and start.'
	inradius = Vector3(inradiusComplex.real, inradiusComplex.imag, 0.5 * abs(endZ - start.z))
	cylinderOutput = getGeometryOutput(inradius, sides, topOverBottom)
	vertexes = matrix.getVertexes(cylinderOutput)
	if endZ < start.z:
		for vertex in vertexes:
			vertex.z = -vertex.z
	translation = Vector3(start.x, start.y, inradius.z + min(start.z, endZ))
	euclidean.translateVector3Path(vertexes, translation)
	outputs.append(cylinderOutput)
Ejemplo n.º 5
0
def addCylinderOutputByEndStart(endZ, inradiusComplex, outputs, sides, start, topOverBottom=1.0):
	'Add cylinder triangle mesh by endZ, inradius and start.'
	inradius = Vector3(inradiusComplex.real, inradiusComplex.imag, 0.5 * abs(endZ - start.z))
	cylinderOutput = getGeometryOutput(inradius, sides, topOverBottom)
	vertexes = matrix.getVertexes(cylinderOutput)
	if endZ < start.z:
		for vertex in vertexes:
			vertex.z = -vertex.z
	translation = Vector3(start.x, start.y, inradius.z + min(start.z, endZ))
	euclidean.translateVector3Path(vertexes, translation)
	outputs.append(cylinderOutput)
Ejemplo n.º 6
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get bottomed geometryOutput.'
	derivation = BottomDerivation(elementNode, prefix)
	copyShallow = elementNode.getCopyShallow()
	solid.processElementNodeByGeometry(copyShallow, geometryOutput)
	targetMatrix = matrix.getBranchMatrixSetElementNode(elementNode)
	matrix.setElementNodeDictionaryMatrix(copyShallow, targetMatrix)
	minimumZ = boolean_geometry.getMinimumZ(copyShallow.xmlObject)
	copyShallow.parentNode.xmlObject.archivableObjects.remove(copyShallow.xmlObject)
	lift = derivation.altitude - minimumZ
	vertexes = matrix.getVertexes(geometryOutput)
	for vertex in vertexes:
		vertex.z += lift
	return geometryOutput
Ejemplo n.º 7
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
    "Get bottomed geometryOutput."
    derivation = BottomDerivation(elementNode, prefix)
    copyShallow = elementNode.getCopyShallow()
    solid.processElementNodeByGeometry(copyShallow, geometryOutput)
    targetMatrix = matrix.getBranchMatrixSetElementNode(elementNode)
    matrix.setElementNodeDictionaryMatrix(copyShallow, targetMatrix)
    minimumZ = boolean_geometry.getMinimumZ(copyShallow.xmlObject)
    copyShallow.parentNode.xmlObject.archivableObjects.remove(copyShallow.xmlObject)
    lift = derivation.altitude - minimumZ
    vertexes = matrix.getVertexes(geometryOutput)
    for vertex in vertexes:
        vertex.z += lift
    return geometryOutput
Ejemplo n.º 8
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
Ejemplo n.º 9
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
Ejemplo n.º 10
0
def translateNegativesPositives(negatives, positives, translation):
    'Translate the negatives and postives.'
    euclidean.translateVector3Path(matrix.getVertexes(negatives), translation)
    euclidean.translateVector3Path(matrix.getVertexes(positives), translation)
Ejemplo n.º 11
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
    """Get equated geometryOutput."""
    transformPoints(matrix.getVertexes(geometryOutput), prefix, xmlElement)
    return geometryOutput
Ejemplo n.º 12
0
 def transformGeometryOutput(self, geometryOutput):
     'Transform the geometry output by the local matrix4x4.'
     if self.getMatrix4X4() != None:
         matrix.transformVector3sByMatrix(
             self.getMatrix4X4().tetragrid,
             matrix.getVertexes(geometryOutput))
Ejemplo n.º 13
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
    "Get equated geometryOutput."
    equatePoints(elementNode, matrix.getVertexes(geometryOutput), prefix, None)
    return geometryOutput
Ejemplo n.º 14
0
Archivo: flip.py Proyecto: 3DNogi/SFACT
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get equated geometryOutput.'
	flipPoints(elementNode, matrix.getVertexes(geometryOutput), prefix)
	return geometryOutput
Ejemplo n.º 15
0
def translateNegativesPositives(negatives, positives, translation):
	'Translate the negatives and postives.'
	euclidean.translateVector3Path(matrix.getVertexes(negatives), translation)
	euclidean.translateVector3Path(matrix.getVertexes(positives), translation)
Ejemplo n.º 16
0
def addNegativeSphere(derivation, negatives, x):
	'Add negative sphere at x.'
	radius = Vector3(derivation.radiusPlusClearance, derivation.radiusPlusClearance, derivation.radiusPlusClearance)
	sphereOutput = sphere.getGeometryOutput(derivation.elementNode.getCopyShallow(), radius)
	euclidean.translateVector3Path(matrix.getVertexes(sphereOutput), Vector3(x, 0.0, derivation.demiheight))
	negatives.append(sphereOutput)
Ejemplo n.º 17
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
    'Get equated geometryOutput.'
    flipPoints(elementNode, matrix.getVertexes(geometryOutput), prefix)
    return geometryOutput
Ejemplo n.º 18
0
	def transformGeometryOutput(self, geometryOutput):
		'Transform the geometry output by the local matrix4x4.'
		if self.getMatrix4X4() != None:
			matrix.transformVector3sByMatrix(self.getMatrix4X4().tetragrid, matrix.getVertexes(geometryOutput))
Ejemplo n.º 19
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
	'Get equated geometryOutput.'
	flipPoints(matrix.getVertexes(geometryOutput), prefix, xmlElement)
	return geometryOutput
Ejemplo n.º 20
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	"Get equated geometryOutput."
	equatePoints(elementNode, matrix.getVertexes(geometryOutput), prefix, None)
	return geometryOutput
Ejemplo n.º 21
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
    "Get equated geometryOutput."
    translatePoints(matrix.getVertexes(geometryOutput), prefix, xmlElement)
    return geometryOutput