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]}}
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]}}
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)
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)
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)
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
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
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
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
def translateNegativesPositives(negatives, positives, translation): 'Translate the negatives and postives.' euclidean.translateVector3Path(matrix.getVertexes(negatives), translation) euclidean.translateVector3Path(matrix.getVertexes(positives), translation)
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement): """Get equated geometryOutput.""" transformPoints(matrix.getVertexes(geometryOutput), prefix, xmlElement) return geometryOutput
def transformGeometryOutput(self, geometryOutput): 'Transform the geometry output by the local matrix4x4.' if self.getMatrix4X4() != None: matrix.transformVector3sByMatrix( self.getMatrix4X4().tetragrid, matrix.getVertexes(geometryOutput))
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix): "Get equated geometryOutput." equatePoints(elementNode, matrix.getVertexes(geometryOutput), prefix, None) return geometryOutput
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix): 'Get equated geometryOutput.' flipPoints(elementNode, matrix.getVertexes(geometryOutput), prefix) return geometryOutput
def translateNegativesPositives(negatives, positives, translation): 'Translate the negatives and postives.' euclidean.translateVector3Path(matrix.getVertexes(negatives), translation) euclidean.translateVector3Path(matrix.getVertexes(positives), translation)
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)
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix): 'Get equated geometryOutput.' flipPoints(elementNode, matrix.getVertexes(geometryOutput), prefix) return geometryOutput
def transformGeometryOutput(self, geometryOutput): 'Transform the geometry output by the local matrix4x4.' if self.getMatrix4X4() != None: matrix.transformVector3sByMatrix(self.getMatrix4X4().tetragrid, matrix.getVertexes(geometryOutput))
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement): 'Get equated geometryOutput.' flipPoints(matrix.getVertexes(geometryOutput), prefix, xmlElement) return geometryOutput
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix): "Get equated geometryOutput." equatePoints(elementNode, matrix.getVertexes(geometryOutput), prefix, None) return geometryOutput
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement): "Get equated geometryOutput." translatePoints(matrix.getVertexes(geometryOutput), prefix, xmlElement) return geometryOutput