def getOutputCylinder( collarThickness, derivation, gearHolePaths, pitchRadius, teeth, twist, vector3GearProfile, xmlElement): "Get extrude output for a cylinder gear." extrudeDerivation = extrude.ExtrudeDerivation() extrudeDerivation.offsetPathDefault = [Vector3(), Vector3(0.0, 0.0, derivation.pinionThickness)] extrudeDerivation.setToXMLElement(derivation.copyShallow) negatives = [] positives = [] if twist != 0.0: twistDegrees = math.degrees(twist) extrudeDerivation.twistPathDefault = [] for complexPoint in derivation.helixPath: extrudeDerivation.twistPathDefault.append(Vector3(complexPoint.real, twistDegrees * complexPoint.imag)) extrude.insertTwistPortions(extrudeDerivation, xmlElement) if derivation.operatingAngle != 180.0: addBevelGear(derivation, extrudeDerivation, pitchRadius, positives, teeth, vector3GearProfile) addCollarShaft(collarThickness, derivation, negatives, positives, xmlElement) return extrude.getGeometryOutputByNegativesPositives(extrudeDerivation, negatives, positives, xmlElement) if pitchRadius > 0: extrude.addNegativesPositives(extrudeDerivation, negatives, vector3GearProfile, positives) addLighteningHoles(derivation, gearHolePaths, negatives, pitchRadius, positives) addCollarShaft(collarThickness, derivation, negatives, positives, xmlElement) return extrude.getGeometryOutputByNegativesPositives(extrudeDerivation, negatives, positives, xmlElement) if derivation.plateThickness <= 0.0: extrude.addNegativesPositives(extrudeDerivation, negatives, vector3GearProfile, positives) return extrude.getGeometryOutputByNegativesPositives(extrudeDerivation, negatives, positives, xmlElement) portionDirections = extrude.getSpacedPortionDirections(extrudeDerivation.interpolationDictionary) outerGearProfile = vector3GearProfile[0] outerLoopLists = extrude.getLoopListsByPath(extrudeDerivation, None, outerGearProfile, portionDirections) addBottomLoop(-derivation.plateClearance, outerLoopLists[0]) geometryOutput = trianglemesh.getPillarsOutput(outerLoopLists) positives.append(geometryOutput) innerLoopLists = extrude.getLoopListsByPath(extrudeDerivation, None, vector3GearProfile[1], portionDirections) addBottomLoop(-derivation.plateClearance, innerLoopLists[0]) geometryOutput = trianglemesh.getPillarsOutput(innerLoopLists) negatives.append(geometryOutput) connectionStart = Vector3(0.0, 0.0, -derivation.plateThickness) plateDerivation = extrude.ExtrudeDerivation() plateDerivation.offsetPathDefault = [connectionStart, Vector3(0.0, 0.0, -derivation.plateClearance)] plateDerivation.setToXMLElement(derivation.copyShallow) extrude.addNegativesPositives(plateDerivation, negatives, [outerGearProfile], positives) vector3LighteningHoles = getLighteningHoles(derivation, gearHolePaths, pitchRadius) extrude.addNegativesPositives(plateDerivation, negatives, vector3LighteningHoles, positives) addShaft(derivation, negatives, positives) connectionEnd = Vector3(0.0, 0.0, derivation.pinionThickness) positiveOutput = trianglemesh.getUnifiedOutput(positives) annulusPlateOutput = {'difference' : {'shapes' : [positiveOutput] + negatives}} if collarThickness <= 0.0: outputCylinder = extrude.getGeometryOutputByConnection(connectionEnd, connectionStart, annulusPlateOutput, xmlElement) return getLiftedOutput(derivation, outputCylinder, xmlElement) negatives = [] positives = [] connectionEnd = Vector3(0.0, 0.0, derivation.pinionThickness + collarThickness) collarDerivation = extrude.ExtrudeDerivation() collarDerivation.offsetPathDefault = [Vector3(0.0, 0.0, -derivation.plateClearance), connectionEnd] addCollarShaftSetDerivation(collarDerivation, collarThickness, derivation, negatives, positives, xmlElement) collarOutput = {'difference' : {'shapes' : positives + negatives}} cylinderOutput = {'union' : {'shapes' : [annulusPlateOutput, collarOutput]}} outputCylinder = extrude.getGeometryOutputByConnection(connectionEnd, connectionStart, cylinderOutput, xmlElement) return getLiftedOutput(derivation, outputCylinder, xmlElement)
def getOutputCylinder(gearDerivation, pitchRadius, shaftRimRadius, teeth, twist, vector3GearProfile, vector3ShaftPath, xmlElement): "Get extrude output for a cylinder gear." vector3LighteningHoles = getLighteningHoles(gearDerivation, pitchRadius, shaftRimRadius, teeth) extrudeDerivation = extrude.ExtrudeDerivation() extrudeDerivation.offsetPathDefault = [ Vector3(), Vector3(0.0, 0.0, gearDerivation.thickness) ] extrudeDerivation.setToXMLElement(xmlElement) negatives = [] positives = [] extrude.addNegativesPositives(extrudeDerivation, negatives, vector3LighteningHoles + [vector3ShaftPath], positives) if twist != 0.0: twistDegrees = math.degrees(twist) extrudeDerivation.twistPathDefault = [] for complexPoint in getHelixComplexPath(gearDerivation, xmlElement): extrudeDerivation.twistPathDefault.append( Vector3(complexPoint.real, twistDegrees * complexPoint.imag)) extrude.insertTwistPortions(extrudeDerivation, xmlElement) extrude.addNegativesPositives(extrudeDerivation, negatives, [vector3GearProfile], positives) return extrude.getGeometryOutputByNegativesPositives( extrudeDerivation, negatives, positives, xmlElement)
def getOutputCylinder(gearDerivation, pitchRadius, shaftRimRadius, teeth, twist, vector3GearProfile, vector3ShaftPath, xmlElement): "Get extrude output for a cylinder gear." vector3LighteningHoles = getLighteningHoles(gearDerivation, pitchRadius, shaftRimRadius, teeth) extrudeDerivation = extrude.ExtrudeDerivation() extrudeDerivation.offsetPathDefault = [Vector3(), Vector3(0.0, 0.0, gearDerivation.thickness)] extrudeDerivation.setToXMLElement(xmlElement) negatives = [] positives = [] extrude.addNegativesPositives(extrudeDerivation, negatives, vector3LighteningHoles + [vector3ShaftPath], positives) if twist != 0.0: twistDegrees = math.degrees(twist) extrudeDerivation.twistPathDefault = [] for complexPoint in getHelixComplexPath(gearDerivation, xmlElement): extrudeDerivation.twistPathDefault.append(Vector3(complexPoint.real, twistDegrees * complexPoint.imag)) extrude.insertTwistPortions(extrudeDerivation, xmlElement) extrude.addNegativesPositives(extrudeDerivation, negatives, [vector3GearProfile], positives) return extrude.getGeometryOutputByNegativesPositives(extrudeDerivation, negatives, positives, xmlElement)