# pragma once #include #include #include #include #include"../geo/geocal.h" #include"../display/Struct3d.h" using namespace std; // 这里是CNT的初始化方式 // 原文 // The first approach that we have considered starts by sampling // all of the circular edges of the selected portion of the ACHoCC. // In this version, the sampling of the two circular edges of each // chopped-beam may be coordinated so that the beam will be // tessellated by a quad-loop. But the samplings of the circular edges // of a chopped-ball are not coordinated. Then, for each solid, it // computes the convex hull of the sample points on all the circular // edges of that solid. This is trivial for the beams, but requires // computing the convex hull of sn cospherical points for a ball with // n incident beams, assuming an average of s samples per circle. // This approach has higher computational cost and more faces on // the polyhedral approximation of the CHoCC of a ball than the // approach proposed next. class CNT{ static void ShowTriDirt(Struct3d& s,print3d& result){ int pnum=result.p.size(); for(int i=0;i& x,vector& angles){ for(int i=0;i>& tmp) { int pnum=result.p.size(); int j=0; //将这些点归类到各个圆形上面 vector> x(s.circs.size()); for(int i=0;i angles; for(int i=0;i>& ms,Struct3d& s){ for(int i=0;i> ShowCNT(Struct3d& s,print3d& result){ map> tmp; //加入大三角形 ShowTriDirt(s,result); //加入最简单的多边形的接口 ShowCirFace(s,result,tmp); //加入边线 map> ms; ShowEdge(ms,s); for(auto m:ms){ result.f.push_back(Vector3i(m.second[3],m.second[0],m.second[2])); result.f.push_back(Vector3i(m.second[2],m.second[0],m.second[1])); } return tmp; } };