博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OpenMesh 删除网格顶点
阅读量:6973 次
发布时间:2019-06-27

本文共 1129 字,大约阅读时间需要 3 分钟。

 

OpenMesh 提供了 函数来实现从网格中删除顶点,在删除掉顶点的同时,所有与该顶点相连的边也同时被删除。

OpenMesh 中给的顶点删除函数声明如下:

void OpenMesh::PolyConnectivity::delete_vertex(VertexHandle _vh, bool _delete_isolated_vertices = true)

Mark vertex and all incident edges and faces deleted.

Items marked deleted will be removed by garbageCollection().

Attention: Needs the attribute for vertices, edges and faces.

 

需要注意的是,在删除几何元素前,需要获取网格顶点、边和面的状态属性,并在删除结束后释放。所有正确的删除网格顶点的代码如下:

 

MyMesh mesh;vector
delete_vh; //删除顶点的集合if (!mesh.has_vertex_status()) mesh.request_vertex_status();if (!mesh.has_face_status()) mesh.request_face_status();if (!mesh.has_edge_status()) mesh.request_edge_status();for (auto vit=mesh.vertices_begin(); vit!=mesh.vertices_end(); vit++){ if (find(delete_vh.begin(), delete_vh.end(), vit.handle()) ==delete_vh.end()) { mesh.delete_vertex(vit.handle(), true); }}mesh.garbage_collection();if (mesh.has_vertex_status()) mesh.release_vertex_status();if (mesh.has_face_status()) mesh.release_face_status();if (mesh.has_edge_status()) mesh.release_edge_status();

 

转载于:https://www.cnblogs.com/VVingerfly/p/4661871.html

你可能感兴趣的文章
IOS(CGGeometry)几何类方法总结
查看>>
Quart2D setNeedsDisplay
查看>>
Android TextView点击效果
查看>>
GIX4中懒加载
查看>>
数据仓库专题(1)-数据仓库生命周期模型
查看>>
[华为机试练习题]43.在字符串中找出连续最长的数字串
查看>>
LogCat大量Unexpected value from nativeGetEnabledTags: 0
查看>>
一分钟了解阿里云产品:补丁管理
查看>>
区间调度问题
查看>>
一键U盘启动快捷方式
查看>>
阿里云容器服务体验: 部署 ShellPays 条码支付整合服务平台 -- (一)系统概要与环境准备...
查看>>
diff corp's HBA and multipath
查看>>
页面平滑滚动
查看>>
UIImagePickController打开闪光模式拍照瞬间锁屏crash
查看>>
nodejs项目部署到腾讯云详细步骤
查看>>
PHP 代码调试跟踪工具 Ytrace
查看>>
Go并发调用的超时处理
查看>>
Flutter初探
查看>>
python发送邮件
查看>>
拼?还是熬?一次发散且零散的创业心得分享
查看>>