YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
Sprocket.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
18class Sprocket {
19 public:
25 explicit Sprocket(double reductionStage);
26
32 explicit Sprocket(std::initializer_list<double> reductionStages);
33
39 explicit Sprocket(const std::vector<double>& reductionStages);
40
46 explicit Sprocket(const std::vector<std::string>& stages);
47
54 static Sprocket FromStages(std::initializer_list<std::string_view> stages);
55
62 Sprocket& Times(double x);
63
70 Sprocket& Div(double x);
71
78
85
86 private:
87 std::vector<double> m_reductionStages;
88 double m_sprocketReductionRatio{1.0};
89
90 void SetupStages(const std::vector<double>& stages);
91};
92
93} // namespace yams::gearing
Definition Sprocket.hpp:18
Sprocket & Times(double x)
double GetInputToOutputConversionFactor() const
double GetOutputToInputConversionFactor() const
Sprocket(double reductionStage)
static Sprocket FromStages(std::initializer_list< std::string_view > stages)
Sprocket(std::initializer_list< double > reductionStages)
Sprocket & Div(double x)
Sprocket(const std::vector< std::string > &stages)
Sprocket(const std::vector< double > &reductionStages)
Definition GearBox.hpp:11