Integration of gauss map, osculating toroidal patches, loop detection and C2 judgement to figure out the singular or loop intersection.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

56 lines
1.8 KiB

#ifndef SINGULARITYJUDGER_SINGULARITYJUDGER_H
#define SINGULARITYJUDGER_SINGULARITYJUDGER_H
#include "gauss_map.h"
#include "loop_detector.h"
#include "srf_mesh.h"
#include "tinynurbs/tinynurbs.h"
#include "vector"
using namespace std;
using namespace tinynurbs;
class SingularityJudger {
public:
SingularityJudger(RationalSurface<real> &srf1_, RationalSurface<real> &srf2_,
SrfMesh &mesh1_, SrfMesh &mesh2_);
double gaussMapTimeCost;
SrfMesh &mesh1;
SrfMesh &mesh2;
// 调用各个工具直接传入mesh信息,避免nurbs曲面的重复采样
// 但曲面参数信息仍然需要传入,因为C2C4在最小的网格的基础上还需要进一步细分采样
RationalSurface<real> &srf1;
RationalSurface<real> &srf2;
void init();
// 关注mesh的采样网格中的哪个范围
// 假设mesh.sampleLevel = 5, 则sampleRange 属于[0, 15];
bool judge(pair<int, int> focusRange_u1, pair<int, int> focusRange_v1,
pair<int, int> focusRange_u2, pair<int, int> focusRange_v2);
// 没有loop detection的版本
void judge2(pair<int, int> focusRange_u1, pair<int, int> focusRange_v1,
pair<int, int> focusRange_u2, pair<int, int> focusRange_v2);
map<pair<int, int>, int>
judge(const vector<pair<pair<int, int>, pair<int, int>>> &intersectBoxPairs,
pair<int, int> focusRange_u1, pair<int, int> focusRange_v1,
pair<int, int> focusRange_u2, pair<int, int> focusRange_v2);
vector<vector<char>> judgeRes;
private:
constexpr static int dirs[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
GaussMap gaussMap1;
GaussMap gaussMap2;
void dfs(set<pair<int, int>> &book,
vector<vector<pair<int, int>>> &cellGroups,
const LoopDetector &loopDetector, int i, int x, int y);
};
#endif // SINGULARITYJUDGER_SINGULARITYJUDGER_H