Openmesh Delete mesh vertices

Source: Internet
Author: User

Openmesh provides the Delete_vertex () function to remove vertices from the grid, and all edges connected to the vertex are deleted at the same time as the vertices are deleted.

The vertex deletion function in the Openmesh official document is declared as follows:

void Openmesh::P olyconnectivity::d Elete_vertex (Vertexhandle _VH, bool _delete_isolated_vertices = TRUE)

Mark Vertex and all incident edges and faces deleted.

Items marked deleted is removed by Garbagecollection ().

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

It is important to note that before you delete a geometry element, you need to get the state properties of the mesh vertices, edges, and polygons, and release them after the deletion is complete. the code for all the correct delete mesh vertices is as follows:

Mymesh Mesh;vector<MyMesh::VertexHandle> DELETE_VH;//Delete A collection of verticesif(!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 ();

Openmesh Delete mesh vertices

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.