예제 #1
0
def getGearProfileRack(derivation, toothProfile):
	'Get gear profile for rack.'
	derivation.extraRackDemilength = 0.0
	for complexPoint in derivation.helixPath:
		derivation.extraRackDemilength = max(abs(derivation.helixThickness * complexPoint.imag), derivation.extraRackDemilength)
	rackDemilengthPlus = derivation.rackDemilength
	if derivation.pinionThickness > 0.0:
		derivation.extraRackDemilength *= 1.1
		rackDemilengthPlus += derivation.extraRackDemilength
	teethRack = int(math.ceil(rackDemilengthPlus / derivation.wavelength))
	gearProfile = []
	for toothIndex in xrange(-teethRack, teethRack + 1):
		translateComplex = complex(-toothIndex * derivation.wavelength, 0.0)
		translatedPath = euclidean.getTranslatedComplexPath(toothProfile, translateComplex)
		gearProfile += translatedPath
	gearProfile = euclidean.getHorizontallyBoundedPath(rackDemilengthPlus, -rackDemilengthPlus, gearProfile)
	firstPoint = gearProfile[0]
	lastPoint = gearProfile[-1]
	rackWidth = derivation.rackWidth
	minimumRackWidth = 1.1 * derivation.dedendum
	if rackWidth < minimumRackWidth:
		rackWidth = minimumRackWidth
		print('Warning, rackWidth is too small in getGearProfileRack in gear.')
		print('RackWidth will be set to a bit more than the dedendum.')
	gearProfile += [complex(lastPoint.real, -rackWidth),complex(firstPoint.real, -rackWidth)]
	return gearProfile
예제 #2
0
파일: gear.py 프로젝트: mccoyn/SkeinFactory
def getGearProfileRack(gearDerivation, toothProfile):
	'Get gear profile for rack.'
	rackDemilength = 0.5 * gearDerivation.rackLength
	teethRack = int(math.ceil(rackDemilength / gearDerivation.wavelength))
	gearProfile = []
	for toothIndex in xrange(-teethRack, teethRack + 1):
		translateComplex = complex(-toothIndex * gearDerivation.wavelength, 0.0)
		translatedPath = euclidean.getTranslatedComplexPath(toothProfile, translateComplex)
		gearProfile += translatedPath
	gearProfile = getHorizontallyBoundedPath(rackDemilength, -rackDemilength, gearProfile)
	firstPoint = gearProfile[0]
	lastPoint = gearProfile[-1]
	gearProfile.append(complex(lastPoint.real, lastPoint.imag - gearDerivation.rackWidth))
	gearProfile.append(complex(firstPoint.real, firstPoint.imag - gearDerivation.rackWidth))
	return gearProfile
예제 #3
0
def getGearProfileRack(gearDerivation, toothProfile):
    'Get gear profile for rack.'
    rackDemilength = 0.5 * gearDerivation.rackLength
    teethRack = int(math.ceil(rackDemilength / gearDerivation.wavelength))
    gearProfile = []
    for toothIndex in xrange(-teethRack, teethRack + 1):
        translateComplex = complex(-toothIndex * gearDerivation.wavelength,
                                   0.0)
        translatedPath = euclidean.getTranslatedComplexPath(
            toothProfile, translateComplex)
        gearProfile += translatedPath
    gearProfile = getHorizontallyBoundedPath(rackDemilength, -rackDemilength,
                                             gearProfile)
    firstPoint = gearProfile[0]
    lastPoint = gearProfile[-1]
    gearProfile.append(
        complex(lastPoint.real, lastPoint.imag - gearDerivation.rackWidth))
    gearProfile.append(
        complex(firstPoint.real, firstPoint.imag - gearDerivation.rackWidth))
    return gearProfile