Python: module fabmetheus_utilities.geometry.creation.gear

fabmetheus_utilities.geometry.creation.gear ($Date: 2008/02/05 $) | index /home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/fabmetheus_utilities/geometry/creation/gear.py

Previous / Next / Contents

`
The gear script can generate a spur gear couple, a bevel gear couple, a ring gear couple and a rack & pinion couple.
A helix pattern can be added to each gear type. All the gear types have a clearance and all the teeth can be beveled. A keyway, shaft and lightening holes can be added to all the round gears, and rack holes can be added to the rack. The script can output solid gears or only the gear profiles. Both gears of the couple can be generated or just one.
The couple has a pinion gear and a complement.
Examples
Bevel
Collar
Gear
Keyway
Rack
Rack Hole
Ring
Shaft
Shaft Top
Spur Helix
Spur Herringbone
Spur Parabolic
Spur Profile
Parameters
Center Distance
Clearance Couplet
Clearance Over Wavelength
Clearance
Collar Addendum Couplet
Collar Addendum Over Radius
Collar Addendum
Complement Collar Length Couplet
Complement Collar Length Over Face Width
Complement Collar Length
Creation Type
Both
Complement
Pinion
Face Width
Gear Hole Paths
Helix Angle
Helix Path
Helix Type
Basic
Herringbone
Parabolic
Keyway Radius Couplet
Keyway Radius Over Radius
Keyway Radius
Lightening Hole Margin Couplet
Lightening Hole Margin Over Rim Dedendum
Lightening Hole Margin
Lightening Hole Minimum Radius
Move Type
None
Mesh
Separate
Vertical
Operating Angle
Pinion Collar Length Couplet
Pinion Collar Length Over Face Width
Pinion Collar Length
Pitch Radius
Plate Clearance Couplet
Plate Clearance Over Length
Plate Clearance
Plate Length Couplet
Plate Length Over Face Width
Plate Length
Pressure Angle
Profile Surfaces
Rack Hole Below Over Width Couplet
Rack Hole Below Over Width
Rack Hole Below
Rack Hole Radius Couplet
Rack Hole Radius Over Width
Rack Hole Radius
Rack Hole Step Over Width Couplet
Rack Hole Step Over Width
Rack Hole Step
Rack Length Over Radius Couplet
Rack Length Over Radius
Rack Length
Rack Width Couplet
Rack Width Over Face Width
Rack Width
Rim Dedendum Couplet
Rim Dedendum Over Radius
Rim Dedendum
Root Bevel Couplet
Root Bevel Over Clearance
Root Bevel
Shaft Depth Bottom Couplet
Shaft Depth Bottom Over Radius
Shaft Depth Bottom
Shaft Depth Top Couplet
Shaft Depth Top Over Radius
Shaft Depth Top
Shaft Path
Shaft Radius Couplet
Shaft Radius Over Pitch Radius
Shaft Radius
Shaft Sides
Teeth Pinion
Teeth Complement
Tip Bevel Couplet
Tip Bevel Over Clearance
Tip Bevel
Tooth Thickness Multiplier
`

## Examples

The link text includes the distinguishing parameters. Each svg page was generated from an xml page of the same root name using carve. For example, gear.svg was generated by clicking 'Carve' on the carve tool panel and choosing gear.xml in the file chooser.
Each generated svg file has the xml fabmetheus element without comments towards the end of the file. To see it, open the svg file in a text editor and search for 'fabmetheus' If you copy that into a new text document, add the line '<?xml version='1.0' ?>' at the beginning and then give it a file name with the extension '.xml', you could then generate another svg file using carve.

### Bevel

Bevel gear couple.
gear operatingAngle=90

### Collar

Spur gear couple and each gear has a collar.
gear complementCollarLengthOverFaceWidth='1' pinionCollarLengthOverFaceWidth='1' shaftRadius='5'

### Gear

Default spur gear with no parameters.
gear

### Keyway

Spur gear couple and each gear has a collar and defined keyway.
gear complementCollarLengthOverFaceWidth='1' keywayRadius='2' pinionCollarLengthOverFaceWidth='1' shaftRadius='5'

### Rack

Rack and pinion couple.
gear teethComplement='0'

### Rack Hole

Rack and pinion couple, with holes in the rack.
gear rackHoleRadiusOverWidth='0.2' rackWidthOverFaceWidth='2' teethComplement='0'

### Ring

Pinion and ring gear.
gear teethComplement='-23'

### Shaft

Spur gear couple and each gear has a square shaft hole.
gear shaftRadius='5'

### Shaft Top

Spur gear couple and each gear has a round shaft hole, truncated on top.
gear shaftRadius='5' shaftSides='13' shaftDepthTop='2'

### Spur Helix

Spur gear couple with the gear teeth following a helix path.
gear helixAngle='45'

### Spur Herringbone

Spur gear couple with the gear teeth following a herringbone path.
gear helixAngle='45' helixType='herringbone'

### Spur Parabolic

Spur gear couple with the gear teeth following a parabolic path.
gear helixAngle='45' helixType='parabolic'

### Spur Profile

Spur gear couple profile. Since this is just a horizontal path, it can not be sliced, so the path is then extruded to create a solid which can be sliced and viewed.
gear id='spurProfile' faceWidth='0' | extrude target='=document.getElementByID(spurProfile)

## Parameters

### Center Distance

Default is such that the pitch radius works out to twenty.
Defines the distance between the gear centers.

### Clearance Couplet

#### Clearance Over Wavelength

Default is 0.1.
Defines the ratio of the clearance over the wavelength of the gear profile. The wavelength is the arc distance between the gear teeth.

#### Clearance

Default is the 'Clearance Over Wavelength' times the wavelength.
Defines the clearance between the gear tooth and the other gear of the couple. If the clearance is zero, the outside of the gear tooth will touch the other gear. If the clearance is too high, the gear teeth will be long and weak.

### Collar Addendum Couplet

#### Collar Addendum Over Radius

Default is one.
Defines the ratio of the collar addendum over the shaft radius.

#### Collar Addendum

Default is the 'Collar Addendum Over Radius' times the shaft radius.
Defines the collar addendum.

### Complement Collar Length Couplet

#### Complement Collar Length Over Face Width

Default is zero.
Defines the ratio of the complement collar length over the face width.

#### Complement Collar Length

Default is the 'Complement Collar Length Over Face Width' times the face width.
Defines the complement collar length. If the complement collar length is zero, there will not be a collar on the complement gear.

### Creation Type

Default is 'both'.

#### Both

When selected, the pinion and complement will be generated.

#### Complement

When selected, only the complement gear or rack will be generated.

#### Pinion

When selected, only the pinion will be generated.

### Face Width

Default is ten.
Defines the face width.

### Gear Hole Paths

Default is empty.
Defines the centers of the gear holes. If the gear hole paths parameter is the default empty, then the centers of the gear holes will be generated from other parameters.

### Helix Angle

Default is zero.

### Helix Path

Default is empty.
Defines the helix path of the gear teeth. If the helix path is the default empty, then the helix will be generated from the helix angle and helix type.

### Helix Type

Default is 'basic'.

#### Basic

When selected, the helix will be basic.

#### Herringbone

When selected, the helix will have a herringbone pattern.

#### Parabolic

When selected, the helix will have a parabolic pattern.

### Keyway Radius Couplet

#### Keyway Radius Over Radius

Default is half.
Defines the ratio of the keyway radius over the shaft radius.

#### Keyway Radius

Default is the 'Keyway Radius Over Radius' times the shaft radius.
Defines the keyway radius. If the keyway radius is zero, there will not be a keyway on the collar.

### Lightening Hole Margin Couplet

#### Lightening Hole Margin Over Rim Dedendum

Default is one.
Defines the ratio of the lightening hole margin over the rim dedendum.

#### Lightening Hole Margin

Default is the 'Lightening Hole Margin Over Rim Dedendum' times the rim dedendum.
Defines the minimum margin between lightening holes.

### Lightening Hole Minimum Radius

Default is one.
Defines the minimum radius of the lightening holes.

### Move Type

Default is 'separate'.

#### None

When selected, the gears will be not be moved and will therefore overlap. Afterwards the write plugin could be used to write each gear to a different file, so they can be fabricated in separate operations.

#### Mesh

When selected, the gears will be separated horizontally so that they just mesh. This is useful to test if the gears mesh properly.

#### Separate

When selected, the gears will be separated horizontally with a gap between them.

#### Vertical

When selected, the gears will be separated vertically.

### Operating Angle

Default is 180 degrees.
Defines the operating angle between the gear axes. If the operating angle is not 180 degrees, a bevel gear couple will be generated.

### Pinion Collar Length Couplet

#### Pinion Collar Length Over Face Width

Default is zero.
Defines the ratio of the pinion collar length over the face width.

#### Pinion Collar Length

Default is the 'Pinion Collar Length Over Face Width' times the face width.
Defines the pinion collar length. If the pinion collar length is zero, there will not be a collar on the pinion gear.

### Pitch Radius

Default is twenty if the pitch radius has not been set. If the center distance is set, the default pitch radius is the center distance times the number of pinion teeth divided by the total number of gear teeth.
Defines the pinion pitch radius.

### Plate Clearance Couplet

#### Plate Clearance Over Length

Default is 0.2.
Defines the ratio of the plate clearance over the plate length.

#### Plate Clearance

Default is the 'Plate Clearance Over Length' times the plate length.
Defines the clearance between the pinion and the plate of the ring gear. If the clearance is zero, they will touch.

### Plate Length Couplet

#### Plate Length Over Face Width

Default is half.
Defines the ratio of the plate length over the face width.

#### Plate Length

Default is the 'Plate Length Over Face Width' times the face width.
Defines the length of the plate of the ring gear.

### Pressure Angle

Default is twenty degrees.
Defines the pressure angle of the gear couple.

### Profile Surfaces

Default is eleven.
Defines the number of profile surfaces.

### Rack Hole Below Over Width Couplet

#### Rack Hole Below Over Width

Default is 0.6.
Defines the ratio of the distance below the pitch of the rack holes over the rack width.

#### Rack Hole Below

Default is the 'Rack Hole Below Over Width' times the rack width.
Defines the the distance below the pitch of the rack holes.

### Rack Hole Radius Couplet

#### Rack Hole Radius Over Width

Default is zero.
Defines the ratio of the rack hole radius over the rack width.

#### Rack Hole Radius

Default is the 'Rack Hole Radius Over Width' times the rack width.
Defines the radius of the rack holes. If the rack hole radius is zero, there won't be any rack holes.

### Rack Hole Step Over Width Couplet

#### Rack Hole Step Over Width

Default is one.
Defines the ratio of the rack hole step over the rack width.

#### Rack Hole Step

Default is the 'Rack Hole Step Over Width' times the rack width.
Defines the horizontal step distance between the rack holes.

### Rack Length Over Radius Couplet

#### Rack Length Over Radius

Default is two times pi.
Defines the ratio of the rack length over the pitch radius.

#### Rack Length

Default is the 'Rack Length Over Radius' times the pitch radius.
Defines the rack length.

### Rack Width Couplet

#### Rack Width Over Face Width

Default is one.
Defines the ratio of the rack width over the face width.

#### Rack Width

Default is the 'Rack Width Over Face Width' times the face width.
Defines the rack width.

### Rim Dedendum Couplet

#### Rim Dedendum Over Radius

Default is 0.2.
Defines the ratio of the rim dedendum over the pitch radius.

#### Rim Dedendum

Default is the 'Rim Dedendum Over Radius' times the pitch radius.
Defines the rim dedendum of the gear.

### Root Bevel Couplet

#### Root Bevel Over Clearance

Default is half.
Defines the ratio of the root bevel over the clearance.

#### Root Bevel

Default is the 'Root Bevel Over Clearance' times the clearance.
Defines the bevel at the root of the gear tooth.

### Shaft Depth Bottom Couplet

#### Shaft Depth Bottom Over Radius

Default is zero.
Defines the ratio of the bottom shaft depth over the shaft radius.

#### Shaft Depth Bottom

Default is the 'Shaft Depth Bottom Over Radius' times the shaft radius.
Defines the bottom shaft depth.

### Shaft Depth Top Couplet

#### Shaft Depth Top Over Radius

Default is zero.
Defines the ratio of the top shaft depth over the shaft radius.

#### Shaft Depth Top

Default is the 'Shaft Depth Top Over Radius' times the shaft radius.
Defines the top shaft depth.

### Shaft Path

Default is empty.
Defines the path of the shaft hole. If the shaft path is the default empty, then the shaft path will be generated from the shaft depth bottom, shaft depth top, shaft radius and shaft sides.

### Shaft Radius Couplet

#### Shaft Radius Over Pitch Radius

Default is zero.
Defines the ratio of the shaft radius over the pitch radius.

#### Shaft Radius

Default is the 'Shaft Radius Over Pitch Radius' times the pitch radius.
Defines the shaft radius. If the shaft radius is zero there will not be a shaft hole.

### Shaft Sides

Default is four.
Defines the number of shaft sides.

### Teeth Pinion

Default is seven.
Defines the number of teeth in the pinion.

### Teeth Complement

Default is seventeen.
Defines the number of teeth in the complement of the gear couple. If the number of teeth is positive, the gear couple will be a spur or bevel type. If the number of teeth is zero, the gear couple will be a rack and pinion. If the number of teeth is negative, the gear couple will be a spur and ring.

### Tip Bevel Couplet

#### Tip Bevel Over Clearance

Default is 0.1.
Defines the ratio of the tip bevel over the clearance.

#### Tip Bevel

Default is the 'Tip Bevel Over Clearance' times the clearance.
Defines the bevel at the tip of the gear tooth.

### Tooth Thickness Multiplier

Default is 0.99999.
Defines the amount the thickness of the tooth will multiplied. If when the gears are produced, they mesh too tightly, you can reduce the tooth thickness multiplier so that they mesh with reasonable tightness.

Previous / Next / Contents

Modules
`` |  |
__init__ fabmetheus_utilities.euclidean fabmetheus_utilities.geometry.geometry_utilities.evaluate fabmetheus_utilities.geometry.creation.extrude | fabmetheus_utilities.geometry.creation.lineation math fabmetheus_utilities.geometry.geometry_utilities.matrix fabmetheus_utilities.geometry.geometry_tools.path | fabmetheus_utilities.geometry.geometry_utilities.evaluate_elements.setting fabmetheus_utilities.geometry.creation.shaft fabmetheus_utilities.geometry.creation.solid fabmetheus_utilities.geometry.creation.teardrop | fabmetheus_utilities.geometry.solids.triangle_mesh

Classes
`` |  | GearDerivation
class GearDerivation
`` | `Class to hold gear variables.`
| Methods defined here: __init__(self, elementNode) `Set defaults.`

Functions
`` |  | addBevelGear(derivation, extrudeDerivation, pitchRadius, positives, teeth, vector3GearProfile) `Get extrude output for a cylinder gear.` addBottomLoop(deltaZ, loops) `Add bottom loop to loops.` addCollarShaft(collarLength, derivation, elementNode, negatives, positives) `Add collar.` addCollarShaftSetDerivation(collarDerivation, collarLength, derivation, elementNode, negatives, positives) `Add collar and shaft.` addLighteningHoles(derivation, gearHolePaths, negatives, pitchRadius, positives) `Add lightening holes.` addRackHole(derivation, elementNode, vector3RackProfiles, x) `Add rack hole to vector3RackProfiles.` addRackHoles(derivation, elementNode, vector3RackProfiles) `Add rack holes to vector3RackProfiles.` addShaft(derivation, negatives, positives) `Add shaft.` getAxialMargin(circleRadius, numberOfSides, polygonRadius) `Get axial margin.` getBevelPath(begin, bevel, center, end) `Get bevel path.` getGearPaths(derivation, pitchRadius, teeth, toothProfile) `Get gear paths.` getGearProfileAnnulus(derivation, pitchRadius, teeth, toothProfile) `Get gear profile for an annulus gear.` getGearProfileCylinder(teeth, toothProfile) `Get gear profile for a cylinder gear.` getGearProfileRack(derivation, toothProfile) `Get gear profile for rack.` getGeometryOutput(derivation, elementNode) `Get vector3 vertexes from attribute dictionary.` getGeometryOutputByArguments(arguments, elementNode) `Get vector3 vertexes from attribute dictionary by arguments.` getHalfwave(pitchRadius, teeth) `Get tooth halfwave.` getHelixComplexPath(derivation, elementNode) `Set gear helix path.` getLiftedOutput(derivation, geometryOutput) `Get extrude output for a rack.` getLighteningHoles(derivation, gearHolePaths, pitchRadius) `Get cutout circles.` getNewDerivation(elementNode) `Get new derivation.` getOutputCylinder(collarLength, derivation, elementNode, gearHolePaths, pitchRadius, teeth, twist, vector3GearProfile) `Get extrude output for a cylinder gear.` getOutputRack(derivation, elementNode, vector3GearProfile) `Get extrude output for a rack.` getPathOutput(creationFirst, derivation, elementNode, translation, vector3ComplementPaths, vector3PinionProfile) `Get gear path output.` getThicknessMultipliedPath(path, thicknessMultiplier) `Get thickness multiplied path.` getToothProfile(derivation, pitchRadius, teeth) `Get profile for one tooth.` getToothProfileAnnulus(derivation, pitchRadius, teeth) `Get profile for one tooth of an annulus.` getToothProfileCylinder(derivation, pitchRadius, teeth) `Get profile for one tooth of a cylindrical gear.` getToothProfileCylinderByProfile(derivation, pitchRadius, teeth, toothProfileHalf) `Get profile for one tooth of a cylindrical gear.` getToothProfileHalfCylinder(derivation, pitchRadius) `Get profile for half of a one tooth of a cylindrical gear.` getToothProfileRack(derivation) `Get profile for one rack tooth.` processElementNode(elementNode) `Process the xml element.`

Data
`` |  | __author__ = 'Enrique Perez (perez_enrique@yahoo.com)' __credits__ = 'Art of Illusion <http://www.artofillusion.org/>' __date__ = '$Date: 2008/02/05 $' __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)

Author
`` |  | Enrique Perez (perez_enrique@yahoo.com)

Credits
`` |  | Art of Illusion <http://www.artofillusion.org/>