Skip to main content

Gears

bitbybit.occt.parts.mechanical.gears builds involute gears and racks as solids, and bitbybit.engineering.mechanical.gears works out how they mesh and draws their outlines as points. Standard parts explains the frames and roles they share.

Two numbers decide whether gears mesh. The module is the size of the teeth, the pitch circle's diameter divided by the number of teeth, and the pressure angle, 20 degrees by default, is the angle at which meshing teeth push on each other. Gears mesh only with gears of the same module and pressure angle.

Two spur gears that mesh​

Two spur gears that mesh
Bitbybit Platform

Two spur gears that mesh in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"pinion": {
"id": "pinion",
"name": "bitbybit.occt.parts.mechanical.gears.spurGear",
"customName": "spur gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 10,
"bore": 10,
"hub": 0,
"hubLength": 0,
"keyway": false,
"unit": "mm",
"keyStandard": "din",
"module": 2,
"teeth": 20,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"rotation": 0
},
"inputs": {},
"position": [
40,
40
]
},
"pair": {
"id": "pair",
"name": "bitbybit.engineering.mechanical.gears.gearPair",
"customName": "gear pair",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"module": 2,
"teethA": 20,
"teethB": 30,
"pressureAngle": 20,
"profileShiftA": 0,
"profileShiftB": 0,
"addendum": 1,
"dedendum": 1.25
},
"inputs": {},
"position": [
40,
978
]
},
"distance": {
"id": "distance",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "centreDistance"
},
"inputs": {
"json": {
"connections": [
{
"node": "pair",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"wheelCentre": {
"id": "wheelCentre",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 0,
"z": 0
},
"inputs": {
"x": {
"connections": [
{
"node": "distance",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"wheelFrame": {
"id": "wheelFrame",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
0,
0
],
"normal": [
0,
1,
0
],
"direction": [
1,
0,
0
]
},
"inputs": {
"origin": {
"connections": [
{
"node": "wheelCentre",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"wheel": {
"id": "wheel",
"name": "bitbybit.occt.parts.mechanical.gears.spurGear",
"customName": "spur gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 10,
"bore": 16,
"hub": 0,
"hubLength": 0,
"keyway": false,
"unit": "mm",
"keyStandard": "din",
"module": 2,
"teeth": 30,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"rotation": 6
},
"inputs": {
"frame": {
"connections": [
{
"node": "wheelFrame",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"look": {
"id": "look",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "lookMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
288
]
},
"lookMaterial": {
"id": "lookMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
1502
]
},
"drawPinion": {
"id": "drawPinion",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "pinion",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "look",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"drawWheel": {
"id": "drawWheel",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "wheel",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "look",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
334
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
30,
130,
-105
],
"lookAt": [
30,
5,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2140,
628
]
}
},
"modules": {}
}
  • gearPair gives the centre distance, 50 for module 2 with 20 and 30 teeth, so the wheel's frame stands that far along X. It also gives the ratio, 1.5, and the contact ratio, 1.61: on average 1.61 pairs of teeth are in contact, and anything over 1 keeps the drive smooth.
  • At rotation 0 a gear has a tooth along its frame's direction. The pinion's tooth then points straight at the wheel, and so does one of the wheel's, so the wheel turns half a tooth, 180 degrees over its 30 teeth, to put a gap there. Left at 0 the two would overlap.

The gears​

  • spurGear makes a spur gear: its outline swept width along the frame's normal, the first face in the frame's plane. A bore puts a hole through it, which must stay inside the root circle; a hub of a diameter between the bore and the root circle stands hubLength out from its end face; and keyway cuts a keyway along the bore, sized by keyStandard (DIN 6885 or ANSI B17.1) for a shaft of the bore's diameter in unit, toward the tooth at rotation 0.
  • helicalGear makes the same gear with its teeth leaning helixAngle degrees from the axis, positive for a right hand and negative for a left. Two external helical gears of one module and helix angle in opposite hands mesh, the sum of their pitch radii apart. herringbone makes two halves of opposite hands that meet halfway across the width, cancelling the push along the axis that one helix makes.
  • bevelGear makes a straight bevel gear, its teeth running straight to the apex (Tredgold's approximation), for turning a drive through shaftAngle, 90 degrees by default. It is sized for a mate of mateTeeth, and its teeth run faceWidth along the cone from the back. The mate is a bevel gear of mateTeeth sharing the frame's origin, the two normals at shaftAngle, turned half a tooth.
  • ringGear makes a ring with its teeth pointing in, for a gear running inside it: a spur gear of the same module meshes inside with its centre half the module times the difference of their teeth from the ring's centre.
  • rack makes a straight rack, its outline swept width along the frame's normal. A spur gear of the same module meshes with it, its centre its pitch radius from the pitch line, and turning the gear by an angle moves the rack its pitch radius times that angle in radians.

Every tooth form takes backlash (each tooth thinned by that much, leaving play between meshing teeth), addendum and dedendum (how far teeth reach above and gaps below the pitch circle, as shares of the module) and rootFillet, the radius at the bottom of each gap. The spur and helical gears also take profileShift, which moves the teeth out from the pitch circle as a share of the module, for the thicker teeth small gears need. A ring gear's rim is how thick the ring is outside the bottoms of its gaps, and a rack's height how far its back lies below the pitch line, beyond the gaps.

spurGearProfile, ringGearProfile and rackProfile draw the tooth outline in the frame's plane instead, as a face or, with makeFace off, a wire, to extrude, cut or sweep yourself; they are in bitbybit.occt.parts.mechanical.gears too.

Roles​

  • spurGearWithRoles and helicalGearWithRoles name a gear's tip, flank, root, bore, hub, keyway, start (the face in the frame's plane) and end; their axis frame sits at the start face's centre, toward the first tooth.
  • bevelGearWithRoles names tip, flank, root, back (the back cone and the flat back face), front and bore; its apex frame is your frame turned to the first tooth, and back sits at the back face's centre.
  • ringGearWithRoles names tip, flank, root, rim (the outer face), start and end, with an axis frame.
  • rackWithRoles names tip, flank, root, back, side (its two ends), start and end; its pitch frame sits on the first tooth's middle, on the pitch line, along the rack.

How gears mesh​

bitbybit.engineering.mechanical.gears answers the questions a gear train raises before anything is built:

  • gearPair works out two external spur gears in mesh: their centreDistance, the working pressure angle, the contactRatio and ratio, profile shifts included. interferes flags a tip reaching below where the other gear's flank is an involute, and tipShortening and clearance show how shifts crowd tips into roots. Shifts that pull a tip inside its base circle, or work the pair past 45 degrees, are refused.
  • internalGearPair does the same for a spur gear inside a ring: module 2, 20 teeth in 60, stand 40 apart at a ratio of 3. A gear of fewer than about 20 teeth interferes with a standard ring of any size.
  • planetarySet lays out a sun, its planets and the ring around them: the ring's teeth, where each planet sits, how far each planet and the ring turn to mesh, the ratio with the ring held, and whether the planets mesh, keep clear of each other and interfere. They mesh when the sun's and the ring's teeth together divide by the number of planets.
  • moduleFromDiametralPitch turns an inch gear's diametral pitch, its teeth per inch of pitch diameter, into the module the gear functions take: 10 DP is 0.1 inches, or 2.54 millimetres.

Here planetarySet lays out a whole set. It gives the ring its teeth, and it gives each planet a place and a turn, so that every tooth finds a gap. Its planetCentres lie in the XY plane, so the sun, the planets and the ring all stand on frames facing +Z:

A planetary gear set
Bitbybit Platform

A planetary gear set in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"set": {
"id": "set",
"name": "bitbybit.engineering.mechanical.gears.planetarySet",
"customName": "planetary set",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"module": 1,
"sunTeeth": 24,
"planetTeeth": 24,
"planets": 4,
"pressureAngle": 20,
"addendum": 1
},
"inputs": {},
"position": [
40,
40
]
},
"centre": {
"id": "centre",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
0,
0
],
"normal": [
0,
0,
1
],
"direction": [
1,
0,
0
]
},
"inputs": {},
"position": [
40,
472
]
},
"sun": {
"id": "sun",
"name": "bitbybit.occt.parts.mechanical.gears.spurGear",
"customName": "spur gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 8,
"bore": 6,
"hub": 0,
"hubLength": 0,
"keyway": false,
"unit": "mm",
"keyStandard": "din",
"module": 1,
"teeth": 24,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"rotation": 0
},
"inputs": {
"frame": {
"connections": [
{
"node": "centre",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"ringTeeth": {
"id": "ringTeeth",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "ringTeeth"
},
"inputs": {
"json": {
"connections": [
{
"node": "set",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
978
]
},
"ring": {
"id": "ring",
"name": "bitbybit.occt.parts.mechanical.gears.ringGear",
"customName": "ring gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 8,
"module": 1,
"teeth": 40,
"pressureAngle": 20,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"rim": 4,
"rotation": 0
},
"inputs": {
"frame": {
"connections": [
{
"node": "centre",
"output": "result",
"data": {}
}
]
},
"teeth": {
"connections": [
{
"node": "ringTeeth",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"planetCentres": {
"id": "planetCentres",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 1,
"forceExecution": false
},
"property": "planetCentres"
},
"inputs": {
"json": {
"connections": [
{
"node": "set",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
1226
]
},
"planetRotations": {
"id": "planetRotations",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 1,
"forceExecution": false
},
"property": "planetRotations"
},
"inputs": {
"json": {
"connections": [
{
"node": "set",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
1474
]
},
"planetFrames": {
"id": "planetFrames",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
0,
0
],
"normal": [
0,
0,
1
],
"direction": [
1,
0,
0
]
},
"inputs": {
"origin": {
"connections": [
{
"node": "planetCentres",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
702
]
},
"planets": {
"id": "planets",
"name": "bitbybit.occt.parts.mechanical.gears.spurGear",
"customName": "spur gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": true,
"flatten": 0,
"forceExecution": false
},
"width": 8,
"bore": 4,
"hub": 0,
"hubLength": 0,
"keyway": false,
"unit": "mm",
"keyStandard": "din",
"module": 1,
"teeth": 24,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"rotation": 0
},
"inputs": {
"frame": {
"connections": [
{
"node": "planetFrames",
"output": "result",
"data": {}
}
]
},
"rotation": {
"connections": [
{
"node": "planetRotations",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"look": {
"id": "look",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "lookMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
1722
]
},
"lookMaterial": {
"id": "lookMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
766
]
},
"drawSun": {
"id": "drawSun",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "sun",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "look",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"drawRing": {
"id": "drawRing",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "ring",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "look",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
334
]
},
"drawPlanets": {
"id": "drawPlanets",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "planets",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "look",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
628
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
50,
80,
-160
],
"lookAt": [
0,
0,
4
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
1720,
922
]
}
},
"modules": {}
}

The sizes give a gear's circles: spurGearSizes the pitch, base, tip and root circles (module 1 with 20 teeth has a pitch radius of 10, a tip radius of 11 and a root radius of 8.75), ringGearSizes the same for a ring, whose tips lie inside, helicalGearSizes the section's circles and how many degrees the teeth turn per unit along the axis, bevelGearSizes the pitch, tip and root cones and the apex distance (20 teeth meshing 40 at 90 degrees have a pitch cone of 26.57 degrees), and rackSizes a rack's pitch and length.

The outlines draw the tooth forms as points on the XY plane, a closed loop running counterclockwise that does not repeat its start, for a mesh, another kernel or a drawing: spurGearOutline, helicalGearOutline (extrude it with the twist helicalGearSizes gives), bevelGearOutline (the back, as seen from the apex), ringGearOutline (the edge of the hole, to cut from a larger circle) and rackOutline.

FunctionWhat it does
bevelGearMakes a straight bevel gear as a solid by Tredgold's approximation: teeth that run straight to the apex, between a back cone and a front cone faceWidth nearer the apex, on a body with flat ends.
bevelGearWithRolesMakes a bevel gear as bevelGear does and names the role each face plays.
helicalGearMakes an involute helical gear as a solid: its section square to the axis turned steadily along width, with a bore, a hub and a keyway as spurGear has them.
helicalGearWithRolesMakes a helical gear as helicalGear does and names the role each face plays.
rackMakes an involute rack as a solid: its outline swept width along the frame's normal.
rackProfileDraws an involute rack in the frame's plane: its pitch line along the frame's direction, its straight-flanked teeth pointing across it, the first tooth's middle on the origin.
rackWithRolesMakes a rack as rack does and names the role each face plays.
ringGearMakes an involute ring gear as a solid: the ring between its outer circle and its teeth, swept width along the frame's normal.
ringGearProfileDraws an involute ring gear in the frame's plane, its teeth pointing in toward the frame's origin.
ringGearWithRolesMakes a ring gear as ringGear does and names the role each face plays.
spurGearMakes an involute spur gear as a solid: its outline swept width along the frame's normal, with a bore, a hub standing out from its end face and a keyway.
spurGearProfileDraws the outline of an involute spur gear around a frame's origin, in the frame's plane.
spurGearWithRolesMakes a spur gear as spurGear does and names the role each face plays.
FunctionWhat it does
bevelGearOutlineDraws a straight bevel gear's teeth as points on the XY plane around the origin, as seen from the apex on the plane of the outer pitch circle, by Tredgold's approximation.
bevelGearSizesWorks out the cones and outer circles of a straight bevel gear meshing a mate at a shaft angle: its pitch, tip and root cones, back radii and apex distance.
gearPairWorks out how two external spur gears mesh: centre distance, working pressure angle, contact ratio and ratio, profile shifts included.
helicalGearOutlineDraws a helical gear's section square to its axis as points on the XY plane around the origin, a closed loop counterclockwise that does not repeat its start.
helicalGearSizesWorks out the circles of an involute helical gear's section square to its axis, with that section's module and pressure angle, and how many degrees the teeth turn per model unit along the axis.
internalGearPairWorks out a spur gear meshing inside a ring gear: centre distance, contact ratio, ratio and interference.
moduleFromDiametralPitchGives the module of an inch gear from its diametral pitch, in the model's unit, so the gear methods can size it.
planetarySetLays out a planetary gear set around a sun at rotation 0: the ring's teeth, where the planets sit, how far each planet and the ring turn to mesh, the ratio with the ring held, and whether the planets mesh, keep clear of each other and interfere.
rackOutlineDraws an involute rack's outline as points on the XY plane, a closed counterclockwise loop not repeating its start: pitch line on the x axis, teeth along +y, the first tooth's middle on the origin.
rackSizesWorks out the lines of an involute rack: its pitch, its length, how far its tips stand above the pitch line, how deep its gaps reach below it and how thick each tooth is on it.
ringGearOutlineDraws the teeth of an involute ring gear as points on the XY plane around the origin: the edge of the hole inside the ring, a closed loop counterclockwise that does not repeat its start.
ringGearSizesWorks out the circles of an involute ring gear, whose teeth point in toward its centre: the pitch and base circles, the tip circle inside them, the root circle beyond, and half the angle a tooth spans at the pitch circle.
spurGearOutlineDraws the outline of an involute spur gear as points on the XY plane, a closed counterclockwise loop that does not repeat its start, ready to extrude in any kernel.
spurGearSizesWorks out the circles of an involute spur gear: the pitch circle meshing gears roll on, the base circle its flanks unwind from, the tip and root circles, and half the angle a tooth spans at the pitch circle.

Herringbone gears​

A helical gear's teeth lean at its helixAngle, and a herringbone gear leans them both ways from the middle, which cancels the sideways push a plain helical gear puts on its bearings.

Two things change from a spur pair. The two gears take opposite hands, one helix angle positive and the other negative. And the spacing is no longer the module times the teeth over two, because module here is measured square to the teeth, so the pitch circle grows as the teeth lean. At 25 degrees the 18 tooth gear has a pitch radius of 4.97 rather than 4.5, and helicalGearSizes gives it to you. The pair stands 13.24 apart, where the spur formula would give 12 and the teeth would dig into each other.

A tooth of each gear points along +X. The larger gear has a tooth every 12 degrees, so turning it by 6 puts a gap where the pinion's tooth arrives. Checked with analysis.clashes, this pair touches with no overlap:

A herringbone gear pair
Bitbybit Platform

A herringbone gear pair in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"small": {
"id": "small",
"name": "bitbybit.engineering.mechanical.gears.helicalGearSizes",
"customName": "helical gear sizes",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"module": 0.5,
"teeth": 18,
"helixAngle": 25,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38
},
"inputs": {},
"position": [
40,
40
]
},
"large": {
"id": "large",
"name": "bitbybit.engineering.mechanical.gears.helicalGearSizes",
"customName": "helical gear sizes",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"module": 0.5,
"teeth": 30,
"helixAngle": -25,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38
},
"inputs": {},
"position": [
40,
610
]
},
"smallRadius": {
"id": "smallRadius",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "pitchRadius"
},
"inputs": {
"json": {
"connections": [
{
"node": "small",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"largeRadius": {
"id": "largeRadius",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "pitchRadius"
},
"inputs": {
"json": {
"connections": [
{
"node": "large",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
288
]
},
"spacing": {
"id": "spacing",
"name": "bitbybit.math.add",
"customName": "add",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"first": 1,
"second": 2
},
"inputs": {
"first": {
"connections": [
{
"node": "smallRadius",
"output": "result",
"data": {}
}
]
},
"second": {
"connections": [
{
"node": "largeRadius",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"across": {
"id": "across",
"name": "bitbybit.vector.vectorXYZ",
"customName": "vector xyz",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 0,
"z": 0
},
"inputs": {
"x": {
"connections": [
{
"node": "spacing",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"pinion": {
"id": "pinion",
"name": "bitbybit.occt.parts.mechanical.gears.helicalGear",
"customName": "helical gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"module": 0.5,
"teeth": 18,
"helixAngle": 25,
"herringbone": true,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"rotation": 0,
"width": 4,
"bore": 1.5,
"hub": 0,
"hubLength": 0,
"keyway": false,
"unit": "mm",
"keyStandard": "din"
},
"inputs": {},
"position": [
40,
1180
]
},
"wheel": {
"id": "wheel",
"name": "bitbybit.occt.parts.mechanical.gears.helicalGear",
"customName": "helical gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"module": 0.5,
"teeth": 30,
"helixAngle": -25,
"herringbone": true,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"rotation": 6,
"width": 4,
"bore": 2,
"hub": 0,
"hubLength": 0,
"keyway": false,
"unit": "mm",
"keyStandard": "din"
},
"inputs": {},
"position": [
40,
2210
]
},
"meshed": {
"id": "meshed",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "wheel",
"output": "result",
"data": {}
}
]
},
"translation": {
"connections": [
{
"node": "across",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"brass": {
"id": "brass",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "brassMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
536
]
},
"brassMaterial": {
"id": "brassMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#ffc24a",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
3240
]
},
"steel": {
"id": "steel",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "steelMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
2486
]
},
"steelMaterial": {
"id": "steelMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
4270
]
},
"drawPinion": {
"id": "drawPinion",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "pinion",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "brass",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"drawMeshed": {
"id": "drawMeshed",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "meshed",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
334
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
8,
30,
-36
],
"lookAt": [
8.5,
1,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2140,
628
]
}
},
"modules": {}
}

Racks​

bitbybit.occt.parts.mechanical.gears.rack makes a straight run of teeth, what a gear becomes as its radius grows without end. It turns rotation into travel. A spur gear of the same module meshes with it when the gear's centre sits its pitch radius, the module times the teeth over two, from the rack's pitch line, and turning the gear by an angle moves the rack by the pitch radius times that angle in radians.

The rack's frame sits at the middle of its first tooth, and height is how far its back lies below the pitch line, beyond the gaps:

A rack and its pinion
Bitbybit Platform

A rack and its pinion in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"rackFrame": {
"id": "rackFrame",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
0,
0
],
"normal": [
0,
0,
1
],
"direction": [
1,
0,
0
]
},
"inputs": {},
"position": [
40,
40
]
},
"pinionFrame": {
"id": "pinionFrame",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
9,
0
],
"normal": [
0,
0,
1
],
"direction": [
1,
0,
0
]
},
"inputs": {},
"position": [
40,
334
]
},
"rack": {
"id": "rack",
"name": "bitbybit.occt.parts.mechanical.gears.rack",
"customName": "rack",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 6,
"module": 1,
"teeth": 16,
"pressureAngle": 20,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"height": 3
},
"inputs": {
"frame": {
"connections": [
{
"node": "rackFrame",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"pinion": {
"id": "pinion",
"name": "bitbybit.occt.parts.mechanical.gears.spurGear",
"customName": "spur gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 6,
"bore": 5,
"hub": 0,
"hubLength": 0,
"keyway": false,
"unit": "mm",
"keyStandard": "din",
"module": 1,
"teeth": 18,
"pressureAngle": 20,
"profileShift": 0,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"rotation": 0
},
"inputs": {
"frame": {
"connections": [
{
"node": "pinionFrame",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
656
]
},
"steel": {
"id": "steel",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "steelMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
1594
]
},
"steelMaterial": {
"id": "steelMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
628
]
},
"brass": {
"id": "brass",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "brassMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
3544
]
},
"brassMaterial": {
"id": "brassMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#ffc24a",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
1658
]
},
"drawRack": {
"id": "drawRack",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "rack",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"drawPinion": {
"id": "drawPinion",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "pinion",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "brass",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
334
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
20,
32,
-88
],
"lookAt": [
20,
6,
3
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
880,
628
]
}
},
"modules": {}
}

Bevel gears​

bitbybit.occt.parts.mechanical.gears.bevelGear makes a straight bevel gear, for shafts that meet at an angle. Its teeth run straight toward an apex, the point where the two axes cross, and that apex is the origin of its frame. faceWidth is how long the teeth are, and shaftAngle, 90 by default, is the angle between the axes.

Each gear needs its own teeth and its mate's mateTeeth, as together they set the cone it rolls on. Give the two gears the same frame origin and turn one by half a tooth, 180 degrees over its teeth, so its teeth fall into the gaps of the other:

A bevel gear pair at a right angle
Bitbybit Platform

A bevel gear pair at a right angle in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"crown": {
"id": "crown",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
0,
0
],
"normal": [
1,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
40
]
},
"pinion": {
"id": "pinion",
"name": "bitbybit.occt.parts.mechanical.gears.bevelGear",
"customName": "bevel gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"module": 1,
"teeth": 20,
"mateTeeth": 30,
"shaftAngle": 90,
"pressureAngle": 20,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"faceWidth": 5,
"bore": 4,
"rotation": 0
},
"inputs": {},
"position": [
40,
334
]
},
"wheel": {
"id": "wheel",
"name": "bitbybit.occt.parts.mechanical.gears.bevelGear",
"customName": "bevel gear",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"module": 1,
"teeth": 30,
"mateTeeth": 20,
"shaftAngle": 90,
"pressureAngle": 20,
"backlash": 0,
"addendum": 1,
"dedendum": 1.25,
"rootFillet": 0.38,
"faceWidth": 5,
"bore": 4,
"rotation": 6
},
"inputs": {
"frame": {
"connections": [
{
"node": "crown",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"steel": {
"id": "steel",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "steelMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
794
]
},
"steelMaterial": {
"id": "steelMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#eef0f2",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
1088
]
},
"brass": {
"id": "brass",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#5f6773",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 2,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": false,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {
"faceMaterial": {
"connections": [
{
"node": "brassMaterial",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
2744
]
},
"brassMaterial": {
"id": "brassMaterial",
"name": "bitbybit.draw.createPBRMaterial",
"customName": "create pbr material",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"name": "PBRMaterial",
"baseColor": "#ffc24a",
"metallic": 0.7,
"roughness": 0.3,
"alpha": 1,
"emissiveColor": "#000000",
"emissiveIntensity": 1,
"zOffset": 0,
"zOffsetUnits": 0,
"alphaMode": "opaque",
"alphaCutoff": 0.5,
"doubleSided": false,
"wireframe": false,
"unlit": false
},
"inputs": {},
"position": [
40,
2118
]
},
"drawPinion": {
"id": "drawPinion",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "pinion",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "brass",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"drawWheel": {
"id": "drawWheel",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "wheel",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "steel",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
334
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
34,
38,
-40
],
"lookAt": [
4,
6,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
880,
628
]
}
},
"modules": {}
}