YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
yams::gearing::GearBox Class Reference

#include <GearBox.hpp>

Public Member Functions

 GearBox (double reductionStage)
 
 GearBox (std::initializer_list< double > reductionStages)
 
 GearBox (const std::vector< double > &reductionStages)
 
 GearBox (const std::vector< std::string > &stages)
 
GearBox & Times (double x)
 
GearBox & Div (double x)
 
double GetInputToOutputConversionFactor () const
 
double GetOutputToInputConversionFactor () const
 

Static Public Member Functions

static GearBox FromReductionStages (std::initializer_list< double > stages)
 
static GearBox FromStages (std::initializer_list< std::string_view > stages)
 
static GearBox FromTeeth (std::initializer_list< int > teeth)
 

Detailed Description

Calculates input-to-output conversion factors for a multi-stage gearbox.

Each stage is a ratio > 0 representing the speed reduction from input to output. For example, a 3:1 reduction is expressed as 3.0.

Constructor & Destructor Documentation

◆ GearBox() [1/4]

yams::gearing::GearBox::GearBox ( double  reductionStage)
explicit

Construct the GearBox with a single reduction stage.

Parameters
reductionStageReduction stage where the value is > 0 to indicate a reduction.

◆ GearBox() [2/4]

yams::gearing::GearBox::GearBox ( std::initializer_list< double >  reductionStages)
explicit

Construct the GearBox with the reduction stages given.

Parameters
reductionStagesReduction stages where each value is > 0 to indicate a reduction.

◆ GearBox() [3/4]

yams::gearing::GearBox::GearBox ( const std::vector< double > &  reductionStages)
explicit

Construct the GearBox with the reduction stages given.

Parameters
reductionStagesReduction stages where each value is > 0 to indicate a reduction.

◆ GearBox() [4/4]

yams::gearing::GearBox::GearBox ( const std::vector< std::string > &  stages)
explicit

Construct the GearBox with the reduction stages given as "IN:OUT" strings.

Parameters
stagesList of stages in the format "IN:OUT", e.g. "3:1".

Member Function Documentation

◆ Div()

GearBox & yams::gearing::GearBox::Div ( double  x)

Divide the gear reduction ratio by x.

Parameters
xFactor to divide by.
Returns
*this for chaining.

◆ FromReductionStages()

static GearBox yams::gearing::GearBox::FromReductionStages ( std::initializer_list< double >  stages)
static

Create a GearBox from numeric reduction stages.

Parameters
stagesReduction stages where each value is > 0 to indicate a reduction.
Returns
GearBox.

◆ FromStages()

static GearBox yams::gearing::GearBox::FromStages ( std::initializer_list< std::string_view >  stages)
static

Create a GearBox from stages in "IN:OUT" string form.

Parameters
stagesStages in the format "IN:OUT", e.g. "3:1".
Returns
GearBox.

◆ FromTeeth()

static GearBox yams::gearing::GearBox::FromTeeth ( std::initializer_list< int >  teeth)
static

Create a GearBox from the tooth counts of each gear in the train.

At least two gears (drive and driven) are required, and all tooth counts must be positive.

Parameters
teethGear tooth counts in mesh order.
Returns
GearBox.

◆ GetInputToOutputConversionFactor()

double yams::gearing::GearBox::GetInputToOutputConversionFactor ( ) const

Get the conversion factor from gearbox input to gearbox output rotations (OUT/IN).

Returns
OUT/IN conversion factor.

◆ GetOutputToInputConversionFactor()

double yams::gearing::GearBox::GetOutputToInputConversionFactor ( ) const

Get the conversion factor from gearbox output to gearbox input rotations (IN/OUT).

Returns
IN/OUT conversion factor.

◆ Times()

GearBox & yams::gearing::GearBox::Times ( double  x)

Multiply the gear reduction ratio by x.

Parameters
xFactor to multiply by.
Returns
*this for chaining.

The documentation for this class was generated from the following file: