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

微网站的案例莱芜东风街吧

微网站的案例,莱芜东风街吧,网站footer设计,网站被301跳转CGAL::Polygon_mesh_processing::self_intersections 是用于检测多边形网格#xff08;Polygon Mesh#xff09;中的自相交的函数。自相交是指网格中的某些面#xff08;例如三角形#xff09;与同一网格中的其他面交叉的情况。这种情况通常是不期望的#xff0c;因为它会…CGAL::Polygon_mesh_processing::self_intersections 是用于检测多边形网格Polygon Mesh中的自相交的函数。自相交是指网格中的某些面例如三角形与同一网格中的其他面交叉的情况。这种情况通常是不期望的因为它会导致网格的不一致性和潜在的几何错误。 std::vectorstd::pairMesh::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_wrapperTM::face_descriptor fh,typename Triangle_mesh_and_triangle_soup_wrapperTM::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_wrapperTM Wrapper;typedef typename Wrapper::vertex_descriptor vertex_descriptor;typedef typename GT::Segment_3 Segment;typedef typename GT::Triangle_3 Triangle;std::arrayvertex_descriptor, 3 hv, gv;Wrapper::get_face_vertices(fh, hv, tmesh);Wrapper::get_face_vertices(fg, gv, tmesh);// check for shared edgestd::arrayvertex_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(; i3 (! shared); i){for(j0; j3 (! 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[(i1)%3]), get(vpmap, hv[(i2)%3]));const Segment s2 construct_segment(get(vpmap, gv[(j1)%3]), get(vpmap, gv[(j2)%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_facesBox, TM, VPM, GT, FacePairOutputIterator Intersecting_faces_filter;Intersecting_faces_filter intersect_faces(tmesh, vpmap, gt, out);//省略......CGAL::box_self_intersection_dCGAL::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_intersectGT(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://www.tj-hxxt.cn/news/216736.html

相关文章:

  • 做淘客推广用什么网站好凡客网站建设
  • 如何免费建立自己的网站wordpress仿淘宝页面
  • 有没有做美食的视频网站手机网站导航栏特效
  • 洛阳网站建设lyland哈尔滨模板网站
  • 国内网页设计师个人网站奎屯网站建设
  • 网站怎样多语言网站建设 类
  • 阿里云备案 网站备案郑州新闻发布会直播
  • 江苏建设官方网站美妆网站建设环境分析
  • 陕西省西安市制作网站重庆建设官网
  • 装修公司网站建设广东新闻联播主持人名单
  • 网站手机采集成都排名推广
  • 网站推广优化外包百度自动优化
  • 网站备案查询api外链查询
  • 整屏网站模板小兽wordpress主题
  • 备案 非网站住房与城乡建设网上办事大厅
  • 网站推广实施计划苏州工业园区公积金管理中心
  • 做网站 售后服务里都写啥苏州有哪些做网站公司
  • 常州本地做网站的大公司中国建设银行网站公积金查询
  • 网站源码上传到空间以后怎么做免费在线设计平台
  • 制作网站商城vue可以做pc的网站
  • 调兵山网站建设iis部署网站浏览报404
  • 做网站怎么加入索引功能如何弄小程序
  • 网站优化怎么做 有什么技巧连云港做电商网站的公司
  • 网站上线后做什么wordpress知乎
  • 织梦网站怎么做备份做的网站如何全屏
  • 医疗整形网站怎么做内江市建设培训中心网站
  • 黑帽seo优化关键词seo自然排名优化
  • 网站上不去首页seo要怎么办自己制作的网页怎么发布
  • 福建省网站备案wordpress 开启xmlrpc
  • 沈阳学网站制作学校网站的建设意见