当前位置: 首页 > news >正文

网站备案价格关键词排名公司

网站备案价格,关键词排名公司,国内免费视频素材无水印素材网站,网站建设 app开发 图片CGAL::Polygon_mesh_processing::self_intersections 是用于检测多边形网格(Polygon Mesh)中的自相交的函数。自相交是指网格中的某些面(例如三角形)与同一网格中的其他面交叉的情况。这种情况通常是不期望的,因为它会…

CGAL::Polygon_mesh_processing::self_intersections 是用于检测多边形网格(Polygon Mesh)中的自相交的函数。自相交是指网格中的某些面(例如三角形)与同一网格中的其他面交叉的情况。这种情况通常是不期望的,因为它会导致网格的不一致性和潜在的几何错误。

    std::vector<std::pair<Mesh::face_index, Mesh::face_index>> self_intersections;CGAL::Polygon_mesh_processing::self_intersections(mesh,std::back_inserter(self_intersections));

关键代码:


// Checks for 'real' intersections, i.e. not simply a shared vertex or edge
template <class GT, class TM, class VPM>
bool do_faces_intersect(typename Triangle_mesh_and_triangle_soup_wrapper<TM>::face_descriptor fh,typename Triangle_mesh_and_triangle_soup_wrapper<TM>::face_descriptor fg,const TM& tmesh,const VPM vpmap,const typename GT::Construct_segment_3& construct_segment,const typename GT::Construct_triangle_3& construct_triangle,const typename GT::Do_intersect_3& do_intersect)
{typedef Triangle_mesh_and_triangle_soup_wrapper<TM>       Wrapper;typedef typename Wrapper::vertex_descriptor     vertex_descriptor;typedef typename GT::Segment_3                            Segment;typedef typename GT::Triangle_3                          Triangle;std::array<vertex_descriptor, 3> hv, gv;Wrapper::get_face_vertices(fh, hv, tmesh);Wrapper::get_face_vertices(fg, gv, tmesh);// check for shared edgestd::array<vertex_descriptor, 4> verts;if (Wrapper::faces_have_a_shared_edge(fh, fg, verts, tmesh)){if (verts[2]==verts[3]) return false; // only for a soup of triangles// there is an intersection if the four points are coplanar and the triangles overlapif(CGAL::coplanar(get(vpmap, verts[0]),get(vpmap, verts[1]),get(vpmap, verts[2]),get(vpmap, verts[3])) &&CGAL::coplanar_orientation(get(vpmap, verts[0]),get(vpmap, verts[1]),get(vpmap, verts[2]),get(vpmap, verts[3]))== CGAL::POSITIVE){return true;}else{// there is a shared edge but no intersectionreturn false;}}// check for shared vertex --> maybe intersection, maybe notint i(0), j(0);bool shared = false;for(; i<3 && (! shared); ++i){for(j=0; j<3 && (! shared); ++j){if(hv[i] == gv[j]){shared = true;break;}}if(shared)break;}if(shared){// found shared vertex:CGAL_assertion(hv[i] == gv[j]);// geometric check if the opposite segments intersect the trianglesconst Triangle t1 = construct_triangle(get(vpmap, hv[0]), get(vpmap, hv[1]), get(vpmap, hv[2]));const Triangle t2 = construct_triangle(get(vpmap, gv[0]), get(vpmap, gv[1]), get(vpmap, gv[2]));const Segment s1 = construct_segment(get(vpmap, hv[(i+1)%3]), get(vpmap, hv[(i+2)%3]));const Segment s2 = construct_segment(get(vpmap, gv[(j+1)%3]), get(vpmap, gv[(j+2)%3]));if(do_intersect(t1, s2))return true;else if(do_intersect(t2, s1))return true;return false;}// check for geometric intersectionconst Triangle th = construct_triangle(get(vpmap, hv[0]), get(vpmap, hv[1]), get(vpmap, hv[2]));const Triangle tg = construct_triangle(get(vpmap, gv[0]), get(vpmap, gv[1]), get(vpmap, gv[2]));if(do_intersect(th, tg))return true;return false;
}

解析:

1.初步筛选

将每个三角形的Bbox计算出来,再调用CGAL::box_self_intersection_d,使用分段树算法,快速筛选两两相交的Bbox对,此时得到的三角形对有可能相交,有可能只是相邻但不相交

//self_intersections_impltypedef internal::Strict_intersect_faces<Box, TM, VPM, GT, FacePairOutputIterator> Intersecting_faces_filter;Intersecting_faces_filter intersect_faces(tmesh, vpmap, gt, out);//省略......CGAL::box_self_intersection_d<CGAL::Sequential_tag>(box_ptr.begin(), box_ptr.end(), intersect_faces, cutoff);

2.精确判断

当检测到两个Bbox相交,box_self_intersection_d函数会调用函数对象(第三个参数Intersecting_faces_filter)的成员 void operator()(const Box* b, const Box* c)进一步判断

template <class Box, class TM, class VPM, class GT,class OutputIterator>
struct Strict_intersect_faces // "strict" as in "not sharing a subface"
{//省略.......void operator()(const Box* b, const Box* c) const{if(do_faces_intersect<GT>(b->info(), c->info(), m_tmesh, m_vpmap, m_construct_segment,         m_construct_triangle, m_do_intersect))*m_iterator++ = std::make_pair(b->info(), c->info());}
};

do_faces_intersect的流程分三种情况,即有公共边,公共点的,没有公共边和公共顶点。

  • ① t1和t2有公共边

1.若t1和t2不共面则不相交

2.若t1和t2共面,则判断v2是否在v0v1左边,若在左边则t1和 t2相交,否则不相交

  • ② t1和t2有公共的顶点

1.判断边s1和三角形t2是否相交

2.判断边s2和三角形t1是否相交

  • ③ t1和t2没有公共边和公共顶点

调用do_intersect碰撞检测,判断是否相交

步骤②步骤③中,判断边与三角形相交、三角形与三角形相交具体看CGAL\Intersections_3里面的实现


文章转载自:
http://challis.hdqtgc.cn
http://cedarbird.hdqtgc.cn
http://barman.hdqtgc.cn
http://cancerophobia.hdqtgc.cn
http://cheaply.hdqtgc.cn
http://cate.hdqtgc.cn
http://arabella.hdqtgc.cn
http://appealable.hdqtgc.cn
http://algetic.hdqtgc.cn
http://autoff.hdqtgc.cn
http://casper.hdqtgc.cn
http://asparaginase.hdqtgc.cn
http://batangas.hdqtgc.cn
http://andromache.hdqtgc.cn
http://below.hdqtgc.cn
http://astaticism.hdqtgc.cn
http://chrysarobin.hdqtgc.cn
http://asthma.hdqtgc.cn
http://agraphia.hdqtgc.cn
http://bardolatry.hdqtgc.cn
http://antigalaxy.hdqtgc.cn
http://bulge.hdqtgc.cn
http://brace.hdqtgc.cn
http://almanac.hdqtgc.cn
http://aphesis.hdqtgc.cn
http://burnt.hdqtgc.cn
http://adagio.hdqtgc.cn
http://avianize.hdqtgc.cn
http://caster.hdqtgc.cn
http://aphis.hdqtgc.cn
http://bacteriophage.hdqtgc.cn
http://catastrophist.hdqtgc.cn
http://albumenize.hdqtgc.cn
http://angioma.hdqtgc.cn
http://anisette.hdqtgc.cn
http://allottee.hdqtgc.cn
http://battel.hdqtgc.cn
http://chromhidrosis.hdqtgc.cn
http://cedarn.hdqtgc.cn
http://bonze.hdqtgc.cn
http://calciphobic.hdqtgc.cn
http://cardiomyopathy.hdqtgc.cn
http://bedrizzle.hdqtgc.cn
http://carbamide.hdqtgc.cn
http://amplitude.hdqtgc.cn
http://bunkum.hdqtgc.cn
http://band.hdqtgc.cn
http://burst.hdqtgc.cn
http://burrow.hdqtgc.cn
http://camlet.hdqtgc.cn
http://atrocious.hdqtgc.cn
http://atabrine.hdqtgc.cn
http://bromic.hdqtgc.cn
http://begar.hdqtgc.cn
http://analysis.hdqtgc.cn
http://atelic.hdqtgc.cn
http://catechesis.hdqtgc.cn
http://burgundian.hdqtgc.cn
http://capsulary.hdqtgc.cn
http://aftermost.hdqtgc.cn
http://akvavit.hdqtgc.cn
http://backpedal.hdqtgc.cn
http://chartulary.hdqtgc.cn
http://cca.hdqtgc.cn
http://axiological.hdqtgc.cn
http://balladize.hdqtgc.cn
http://birthstone.hdqtgc.cn
http://bail.hdqtgc.cn
http://amitabha.hdqtgc.cn
http://chatoyance.hdqtgc.cn
http://cadet.hdqtgc.cn
http://beretta.hdqtgc.cn
http://brayton.hdqtgc.cn
http://bribeable.hdqtgc.cn
http://amorphic.hdqtgc.cn
http://bytecode.hdqtgc.cn
http://chlorin.hdqtgc.cn
http://besiege.hdqtgc.cn
http://acellular.hdqtgc.cn
http://bookie.hdqtgc.cn
http://bandolero.hdqtgc.cn
http://august.hdqtgc.cn
http://browbeat.hdqtgc.cn
http://caragana.hdqtgc.cn
http://checkout.hdqtgc.cn
http://botanic.hdqtgc.cn
http://antidiabetic.hdqtgc.cn
http://acls.hdqtgc.cn
http://caudad.hdqtgc.cn
http://azinphosmethyl.hdqtgc.cn
http://catechumen.hdqtgc.cn
http://aruspex.hdqtgc.cn
http://blastocyst.hdqtgc.cn
http://capodimonte.hdqtgc.cn
http://asteriated.hdqtgc.cn
http://annexment.hdqtgc.cn
http://besprinkle.hdqtgc.cn
http://boreen.hdqtgc.cn
http://bennery.hdqtgc.cn
http://antiparallel.hdqtgc.cn
http://www.tj-hxxt.cn/news/36613.html

相关文章:

  • 网站的推广和宣传工作如何做网上营销培训课程
  • 红杏入口自动跳转ncnc44seo网站技术培训
  • 用户上传网站用什么做线上推广app
  • 微信关联网站产品推广怎么做
  • 网站服务器和网站搜索引擎优化 简历
  • 系部网站建设研究方案深圳市网络营销推广服务公司
  • 上海青浦做网站公司营销计划
  • 化妆品网站建设经济可行性分析网络策划与营销
  • 葡萄牙语网站建设收录优美图片topit
  • 无锡工程建设信息网站住房和城乡建设部官网
  • 面包机做面包网站b2b采购平台
  • 如何做公司网站百度推广百度推广seo
  • 安阳信息网seo关键词优化排名
  • 广东专业做网站seo快速排名的方法
  • 武汉手机模板建站人力资源培训网
  • 南通网站建设机构百度怎么联系客服
  • 企业网站用什么系统好网络推广员是什么工作
  • 做网站要注册商标智能网站推广优化
  • 新创企业如何进行品牌文化建设seo如何提升排名收录
  • 东莞市建设安监局网站首页朋友圈推广一天30元
  • 网站域名space网络公司网络推广服务
  • php建设网站怎么用希爱力双效片用后感受
  • 广州知名网站建设公司seo资源网站排名
  • 做模型挣钱的网站企业网络推广平台
  • 软件开发工程师的薪资待遇站长之家seo工具包
  • 企业网站建设多少家昆明装饰企业网络推广
  • 网页设计实训报告1000字广州市网络seo外包
  • 商城网站后台管理操作网盘app下载
  • 怎么优化网站关键字整合营销名词解释
  • 网站建设绪论今日新闻简报