mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
Add new (winner) neighbor index based on measurements
This commit is contained in:
parent
b14b000c73
commit
c4507842a0
11 changed files with 327 additions and 125 deletions
|
@ -60,11 +60,19 @@ using Matrix3d = Eigen::Matrix<double, 3, 3, Eigen::DontAlign>;
|
|||
using Matrix4f = Eigen::Matrix<float, 4, 4, Eigen::DontAlign>;
|
||||
using Matrix4d = Eigen::Matrix<double, 4, 4, Eigen::DontAlign>;
|
||||
|
||||
template<int N, class T>
|
||||
using Transform = Eigen::Transform<float, N, Eigen::Affine, Eigen::DontAlign>;
|
||||
|
||||
using Transform2f = Eigen::Transform<float, 2, Eigen::Affine, Eigen::DontAlign>;
|
||||
using Transform2d = Eigen::Transform<double, 2, Eigen::Affine, Eigen::DontAlign>;
|
||||
using Transform3f = Eigen::Transform<float, 3, Eigen::Affine, Eigen::DontAlign>;
|
||||
using Transform3d = Eigen::Transform<double, 3, Eigen::Affine, Eigen::DontAlign>;
|
||||
|
||||
// I don't know why Eigen::Transform::Identity() return a const object...
|
||||
template<int N, class T> Transform<N, T> identity() { return Transform<N, T>::Identity(); }
|
||||
inline const auto &identity3f = identity<3, float>;
|
||||
inline const auto &identity3d = identity<3, double>;
|
||||
|
||||
inline bool operator<(const Vec2d &lhs, const Vec2d &rhs) { return lhs.x() < rhs.x() || (lhs.x() == rhs.x() && lhs.y() < rhs.y()); }
|
||||
|
||||
template<int Options>
|
||||
|
@ -494,6 +502,7 @@ namespace cereal {
|
|||
template<class Archive> void save(Archive& archive, Slic3r::Matrix2f &m) { archive.saveBinary((char*)m.data(), sizeof(float) * 4); }
|
||||
}
|
||||
|
||||
// To be able to use Vec<> and Mat<> in range based for loops:
|
||||
namespace Eigen {
|
||||
template<class T, int N, int M>
|
||||
T* begin(Slic3r::Mat<N, M, T> &mat) { return mat.data(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue