23 template<
typename Vec>
39 float feedrate = 100.f;
42 operator bool()
const {
return valid(); }
77 static void parseFrame_(
const std::string_view& frame, std::vector<Command> & outCommands );
78 void applyCommand_(
const Command& command );
79 void applyCommandG_(
const Command& command );
80 MoveAction generateMoveAction_();
81 MoveAction generateReturnToHomeAction_();
82 void resetTemporaryStates_();
87 MoveAction moveLine_(
const Vector3f& newPoint,
const Vector3f& newAngles );
89 MoveAction moveArc_(
const Vector3f& newPoint,
const Vector3f& newAngles,
bool clockwise );
92 void updateWorkPlane_( WorkPlane wp );
95 void updateScaling_();
100 BaseAction2f getArcPoints2_(
const Vector2f& beginPoint,
const Vector2f& endPoint,
bool clockwise );
102 BaseAction3f getArcPoints3_(
const Vector3f& center,
const Vector3f& beginPoint,
const Vector3f& endPoint,
bool clockwise );
106 BaseAction3f getArcPoints3_(
float r,
const Vector3f& beginPoint,
const Vector3f& endPoint,
bool clockwise );
109 MoveAction getToolRotationPoints_(
const Vector3f& newRotationAngles );
111 Vector3f calcNewTranslationPos_();
112 Vector3f calcNewRotationAngles_();
113 Vector3f calcRealCoord_(
const Vector3f& translationPos,
const Vector3f& rotationAngles );
114 void updateRotationAngleAndMatrix_(
const Vector3f& rotationAngles );
115 Vector3f calcRealCoordCached_(
const Vector3f& translationPos,
const Vector3f& rotationAngles );
116 Vector3f calcRealCoordCached_(
const Vector3f& translationPos );
137 CoordType coordType_ = CoordType::Movement;
138 MoveMode moveMode_ = MoveMode::Idle;
139 WorkPlane workPlane_ = WorkPlane::xy;
140 Matrix3f toWorkPlaneXf_;
141 Vector3f translationPos_;
142 Vector3f rotationAngles_;
143 bool absoluteCoordinates_ =
true;
144 Vector3f scaling_ = Vector3f::diagonal( 1.f );
145 bool inches_ =
false;
146 float feedrate_ = 100.f;
147 float feedrateMax_ = 0.f;
150 std::array<Matrix3f, 3> cacheRotationMatrix_;
153 Vector3f inputCoords_;
154 Vector3b inputCoordsReaded_;
155 std::optional<float> radius_;
156 std::optional<Vector3f> arcCenter_;
157 Vector3f inputRotation_;
158 Vector3b inputRotationReaded_;
160 std::vector<std::string_view> gcodeSource_;
163 float accuracy_ = 1.e-3f;
164 CNCMachineSettings cncSettings_;
165 std::vector<int> rotationAxesOrderMap_ = {0, 1, 2};