def getGeometryOutput(derivation, xmlElement): "Get vector3 vertexes from attribute dictionary." if derivation == None: derivation = GearDerivation() derivation.setToXMLElement(xmlElement) creationFirst = derivation.creationType.lower()[: 1] toothProfileGear = getToothProfile(derivation, derivation.pitchRadiusGear, derivation.teethGear) gearProfileFirst = getGearProfileCylinder(derivation.teethPinion, derivation.pinionToothProfile) gearPaths = getGearPaths(derivation, derivation.pitchRadiusGear, derivation.teethGear, toothProfileGear) vector3GearProfileFirst = euclidean.getVector3Path(gearProfileFirst) vector3GearPaths = euclidean.getVector3Paths(gearPaths) translation = Vector3() moveFirst = derivation.moveType.lower()[: 1] if moveFirst != 'n': distance = derivation.pitchRadius + derivation.pitchRadiusGear if moveFirst != 'm': decimalPlaces = 1 - int(math.floor(math.log10(derivation.pitchRadius + abs(derivation.pitchRadiusGear)))) distance += derivation.halfWavelength + derivation.halfWavelength distance = round(1.15 * distance, decimalPlaces) translation = Vector3(0.0, -distance) if derivation.pinionThickness <=0.0: return getPathOutput( creationFirst, derivation, translation, vector3GearProfileFirst, vector3GearPaths, xmlElement) pitchRadius = derivation.pitchRadius teeth = derivation.teethPinion twist = derivation.helixThickness / derivation.pitchRadius extrudeOutputFirst = getOutputCylinder( derivation.pinionCollarThickness, derivation, None, pitchRadius, teeth, twist, [vector3GearProfileFirst], xmlElement) if creationFirst == 'f': return extrudeOutputFirst teeth = derivation.teethGear extrudeOutputSecond = None if teeth == 0: extrudeOutputSecond = getOutputRack(derivation, vector3GearPaths[0], xmlElement) else: twist = -derivation.helixThickness / derivation.pitchRadiusGear extrudeOutputSecond = getOutputCylinder( derivation.gearCollarThickness, derivation, derivation.gearHolePaths, derivation.pitchRadiusGear, teeth, twist, vector3GearPaths, xmlElement) if creationFirst == 's': return extrudeOutputSecond gearVertexes = matrix.getConnectionVertexes(extrudeOutputSecond) if moveFirst == 'v': translation = Vector3(0.0, 0.0, euclidean.getTopPath(gearVertexes)) euclidean.translateVector3Path(matrix.getConnectionVertexes(extrudeOutputFirst), translation) else: euclidean.translateVector3Path(gearVertexes, translation) return {'group' : {'shapes' : [extrudeOutputFirst, extrudeOutputSecond]}}
def getGeometryOutput(xmlElement): "Get vector3 vertexes from attribute dictionary." gearDerivation = GearDerivation() gearDerivation.setToXMLElement(xmlElement) creationFirst = gearDerivation.creationType.lower()[: 1] pitchRadiusSecond = gearDerivation.pitchRadius * float(gearDerivation.teethSecond) / float(gearDerivation.teethPinion) toothProfileFirst = getToothProfileCylinder(gearDerivation, gearDerivation.pitchRadius, gearDerivation.teethPinion) toothProfileSecond = getToothProfile(gearDerivation, pitchRadiusSecond, gearDerivation.teethSecond) gearProfileFirst = getGearProfileCylinder(gearDerivation.teethPinion, toothProfileFirst) gearProfileSecond = getGearProfile(gearDerivation, gearDerivation.teethSecond, toothProfileSecond) vector3GearProfileFirst = euclidean.getVector3Path(gearProfileFirst) vector3GearProfileSecond = euclidean.getVector3Path(gearProfileSecond) translation = Vector3() moveFirst = gearDerivation.moveType.lower()[: 1] if moveFirst != 'n': distance = gearDerivation.pitchRadius + pitchRadiusSecond if moveFirst != 'm': decimalPlaces = 1 - int(math.floor(math.log10(distance))) distance += gearDerivation.halfWavelength + gearDerivation.halfWavelength distance = round(1.15 * distance, decimalPlaces) translation = Vector3(0.0, -distance) if gearDerivation.thickness <=0.0: return getPathOutput( creationFirst, gearDerivation, translation, vector3GearProfileFirst, vector3GearProfileSecond, xmlElement) shaftRimRadius = gearDerivation.shaftRadius + gearDerivation.collarWidth vector3ShaftPath = getShaftPath(gearDerivation) pitchRadius = gearDerivation.pitchRadius teeth = gearDerivation.teethPinion twist = gearDerivation.helixThickness / gearDerivation.pitchRadius extrudeOutputFirst = getOutputCylinder( gearDerivation, pitchRadius, shaftRimRadius, teeth, twist, vector3GearProfileFirst, vector3ShaftPath, xmlElement) if creationFirst == 'f': return extrudeOutputFirst pitchRadius = pitchRadiusSecond teeth = gearDerivation.teethSecond extrudeOutputSecond = None if teeth == 0: extrudeOutputSecond = getOutputRack(gearDerivation, vector3GearProfileSecond, xmlElement) else: twist = -gearDerivation.helixThickness / pitchRadiusSecond extrudeOutputSecond = getOutputCylinder( gearDerivation, pitchRadius, shaftRimRadius, teeth, twist, vector3GearProfileSecond, vector3ShaftPath, xmlElement) if creationFirst == 's': return extrudeOutputSecond if moveFirst == 'v': connectionVertexes = matrix.getConnectionVertexes(extrudeOutputSecond) translation = Vector3(0.0, 0.0, euclidean.getTop(connectionVertexes)) euclidean.translateVector3Path(matrix.getConnectionVertexes(extrudeOutputFirst), translation) else: euclidean.translateVector3Path(matrix.getConnectionVertexes(extrudeOutputSecond), translation) return {'group' : {'shapes' : [extrudeOutputFirst, extrudeOutputSecond]}}
def getLiftedOutput(derivation, geometryOutput, xmlElement): "Get extrude output for a rack." if derivation.moveType.lower()[: 1] == 'm': return geometryOutput geometryOutputVertexes = matrix.getConnectionVertexes(geometryOutput) translation = Vector3(0.0, 0.0, -euclidean.getBottomPath(geometryOutputVertexes)) euclidean.translateVector3Path(geometryOutputVertexes, translation) return geometryOutput
def getManipulatedGeometryOutput(geometryOutput, xmlElement): "Get equated geometryOutput." rotatePoints( matrix.getConnectionVertexes(geometryOutput), 'rotate.', xmlElement ) return geometryOutput
def getManipulatedGeometryOutput(geometryOutput, xmlElement): "Get equated geometryOutput." flipPoints(matrix.getConnectionVertexes(geometryOutput), prefix, xmlElement) return geometryOutput
def getManipulatedGeometryOutput(geometryOutput, xmlElement): "Get equated geometryOutput." equatePoints( matrix.getConnectionVertexes(geometryOutput), 'equation.', None, xmlElement ) return geometryOutput
def getManipulatedGeometryOutput(geometryOutput, xmlElement): "Get equated geometryOutput." flipPoints(matrix.getConnectionVertexes(geometryOutput), prefix, xmlElement) return geometryOutput
def getManipulatedGeometryOutput(geometryOutput, xmlElement): 'Get equated geometryOutput.' transformPoints(matrix.getConnectionVertexes(geometryOutput), 'transform.', xmlElement) return geometryOutput
def getGeometryOutput(xmlElement): "Get vector3 vertexes from attribute dictionary." gearDerivation = GearDerivation() gearDerivation.setToXMLElement(xmlElement) creationFirst = gearDerivation.creationType.lower()[:1] pitchRadiusSecond = gearDerivation.pitchRadius * float( gearDerivation.teethSecond) / float(gearDerivation.teethPinion) toothProfileFirst = getToothProfileCylinder(gearDerivation, gearDerivation.pitchRadius, gearDerivation.teethPinion) toothProfileSecond = getToothProfile(gearDerivation, pitchRadiusSecond, gearDerivation.teethSecond) gearProfileFirst = getGearProfileCylinder(gearDerivation.teethPinion, toothProfileFirst) gearProfileSecond = getGearProfile(gearDerivation, gearDerivation.teethSecond, toothProfileSecond) vector3GearProfileFirst = euclidean.getVector3Path(gearProfileFirst) vector3GearProfileSecond = euclidean.getVector3Path(gearProfileSecond) translation = Vector3() moveFirst = gearDerivation.moveType.lower()[:1] if moveFirst != 'n': distance = gearDerivation.pitchRadius + pitchRadiusSecond if moveFirst != 'm': decimalPlaces = 1 - int(math.floor(math.log10(distance))) distance += gearDerivation.halfWavelength + gearDerivation.halfWavelength distance = round(1.15 * distance, decimalPlaces) translation = Vector3(0.0, -distance) if gearDerivation.thickness <= 0.0: return getPathOutput(creationFirst, gearDerivation, translation, vector3GearProfileFirst, vector3GearProfileSecond, xmlElement) shaftRimRadius = gearDerivation.shaftRadius + gearDerivation.collarWidth vector3ShaftPath = getShaftPath(gearDerivation) pitchRadius = gearDerivation.pitchRadius teeth = gearDerivation.teethPinion twist = gearDerivation.helixThickness / gearDerivation.pitchRadius extrudeOutputFirst = getOutputCylinder(gearDerivation, pitchRadius, shaftRimRadius, teeth, twist, vector3GearProfileFirst, vector3ShaftPath, xmlElement) if creationFirst == 'f': return extrudeOutputFirst pitchRadius = pitchRadiusSecond teeth = gearDerivation.teethSecond extrudeOutputSecond = None if teeth == 0: extrudeOutputSecond = getOutputRack(gearDerivation, vector3GearProfileSecond, xmlElement) else: twist = -gearDerivation.helixThickness / pitchRadiusSecond extrudeOutputSecond = getOutputCylinder(gearDerivation, pitchRadius, shaftRimRadius, teeth, twist, vector3GearProfileSecond, vector3ShaftPath, xmlElement) if creationFirst == 's': return extrudeOutputSecond if moveFirst == 'v': connectionVertexes = matrix.getConnectionVertexes(extrudeOutputSecond) translation = Vector3(0.0, 0.0, euclidean.getTop(connectionVertexes)) euclidean.translateVector3Path( matrix.getConnectionVertexes(extrudeOutputFirst), translation) else: euclidean.translateVector3Path( matrix.getConnectionVertexes(extrudeOutputSecond), translation) return {'group': {'shapes': [extrudeOutputFirst, extrudeOutputSecond]}}
def getManipulatedGeometryOutput(geometryOutput, xmlElement): 'Get equated geometryOutput.' transformPoints(matrix.getConnectionVertexes(geometryOutput), 'transform.', xmlElement) return geometryOutput