diff --git a/include/loop_detector.h b/include/loop_detector.h index 4e92ff8..ebb57b7 100644 --- a/include/loop_detector.h +++ b/include/loop_detector.h @@ -24,6 +24,14 @@ public: vector> f_tangent_u; vector> f_tangent_v; + // 有向距离计算结果。有向距离通过采样的方式计算,其结果与s曲面sub patch中的采样网格规模相同,即与s_evaluation大小一致 +// vector> distance; + // 确定有向距离后,对应的f曲面上的最短距离点的位置 + vector>> selectedPointsIdx; + // vector fields, 即有向距离关于u、v的导数 + vector> vectorFields; + vector> rotationNumbers; + // int subPatchEdgeSampleCnt; // 在一个sub patch的采样网格中,边上的采样点个数 // void init(tinynurbs::RationalSurface _s, tinynurbs::RationalSurface _f, int _maxSplitLayer); vector> detect(pair _s_subPatchIdxRange_u, pair _s_subPatchIdxRange_v, @@ -44,13 +52,6 @@ private: // 整个曲面一条边上的采样点个数 int edgeSampleCnt; - // 有向距离计算结果。有向距离通过采样的方式计算,其结果与s曲面sub patch中的采样网格规模相同,即与s_evaluation大小一致 -// vector> distance; - // 确定有向距离后,对应的f曲面上的最短距离点的位置 - vector>> selectedPointsIdx; - // vector fields, 即有向距离关于u、v的导数 - vector> vectorFields; - void initEvaluation(); void initOrientedDistance(); diff --git a/main.cpp b/main.cpp index 8c80ed9..726e22c 100644 --- a/main.cpp +++ b/main.cpp @@ -54,24 +54,13 @@ int main() { // 这里范围真包含于[0, 31] loopDetector.detect({3, 11}, {4, 11}, {2, 7}, {6, 15}); - glm::vec3 a(2, 3, 4); - glm::vec3 b(3, 7, 1); - auto nab = glm::normalize(a - b); - auto res = nab * (a - b); - auto ab = a * b; - cout << res.x << ", " << res.y << ", " << res.z << endl; - cout << nab.x << ", " << nab.y << ", " << nab.z << endl; - cout << ab.x << ", " << ab.y << ", " << ab.z << endl; - std::cout << "Hello, World!" << std::endl; - auto m = glm::mat2x2(1, 2, 3, 4); - cout << m[0][0] << " " << m[0][1] << endl; - auto dotRes = glm::dot(a, b); - cout << dotRes << endl; + // 结果 + for (const auto& line: loopDetector.rotationNumbers) { + for (const auto& el: line) { + cout << el << " "; + } + cout << endl; + } - cout<