YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
GearBox.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Yet Another Software Suite
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#pragma once
5
6#include <initializer_list>
7#include <string>
8#include <string_view>
9#include <vector>
10
11namespace yams::gearing {
12
19class GearBox {
20 public:
26 explicit GearBox(double reductionStage);
27
33 explicit GearBox(std::initializer_list<double> reductionStages);
34
40 explicit GearBox(const std::vector<double>& reductionStages);
41
47 explicit GearBox(const std::vector<std::string>& stages);
48
55 static GearBox FromReductionStages(std::initializer_list<double> stages);
56
63 static GearBox FromStages(std::initializer_list<std::string_view> stages);
64
73 static GearBox FromTeeth(std::initializer_list<int> teeth);
74
81 GearBox& Times(double x);
82
89 GearBox& Div(double x);
90
97
104
105 private:
106 std::vector<double> m_reductionStages;
107 double m_gearReductionRatio{1.0};
108
109 void SetupGearBox(const std::vector<double>& stages);
110};
111
112} // namespace yams::gearing
Definition GearBox.hpp:19
double GetOutputToInputConversionFactor() const
GearBox(double reductionStage)
GearBox(std::initializer_list< double > reductionStages)
static GearBox FromTeeth(std::initializer_list< int > teeth)
static GearBox FromStages(std::initializer_list< std::string_view > stages)
GearBox & Div(double x)
static GearBox FromReductionStages(std::initializer_list< double > stages)
GearBox(const std::vector< double > &reductionStages)
GearBox(const std::vector< std::string > &stages)
double GetInputToOutputConversionFactor() const
GearBox & Times(double x)
Definition GearBox.hpp:11