Utils: Conversion from 2d vector into XY plane 3d vector

This commit is contained in:
Abdullah Tahiri
2022-06-10 15:26:39 +02:00
parent 5411e5ffea
commit eaa431f231

View File

@@ -125,6 +125,12 @@ void ConstraintToAttachment(Sketcher::GeoElementId element, Sketcher::GeoElement
}
/// converts a 2D vector into a 3D vector in the XY plane
inline Base::Vector3d toVector3d(const Base::Vector2d & vector2d) {
return Base::Vector3d(vector2d.x, vector2d.y, 0.);
}
template <typename T>
auto toPointerVector(const std::vector<std::unique_ptr<T>> & vector) {
std::vector<T *> vp (vector.size());
@@ -133,6 +139,5 @@ auto toPointerVector(const std::vector<std::unique_ptr<T>> & vector) {
return vp;
}
#endif // SKETCHERGUI_Recompute_H