Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision c2ea6fbae2634487a33181bb44d1508b19a4507c authored by Jan Möbius on 23 November 2022, 15:04:04 UTC, committed by Jan Möbius on 23 November 2022, 15:04:04 UTC
Merge branch 'fix_calc_normal_for_edges' into 'master'
Fix calc_normal for edges

See merge request OpenMesh/OpenMesh!325
2 parent s 3f328cd + 121ff40
  • Files
  • Changes
  • 2d0c205
  • /
  • Doc
  • /
  • tutorial_07b.docu
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:c2ea6fbae2634487a33181bb44d1508b19a4507c
directory badge
swh:1:dir:83d80ecaf3ffe2b50dfbe0365d52d7add12e01b8
content badge
swh:1:cnt:73a83b2b74fce0e18b0c442fcbeb42ce316f7480

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
tutorial_07b.docu
/** \page tutorial_07b Deleting geometry elements

This small example shows how to remove faces and vertices from a mesh.

We basically use the geometry created in \ref tutorial_01.

If we want our mesh class to be able to remove vertices, faces or edges
we have to extend the default traits for our mesh class.
Vertices, faces and (half-)edges need the OpenMesh::Attributes::Status attribute
which is used to hold the flag "deleted" if an element is deleted.

Instead of defining the required attributes via traits on compile-time, it is possible to request
attributes dynamically on run-time by requesting them.
In this example, we want to delete faces, edges and vertices, therefore requesting the status attribute is required.
\note You have to request attributes before you use them, if you don't enable them via traits.

\dontinclude delete_geometry.cc
\skipline // the request 
\until mesh.request_vertex_status();

After having created the geometry of the cube one can delete faces and vertices
by simply calling delete_vertices() (delete_faces() or delete_edges() respectively).

Note that there is actually no way to directly delete halfedges since they are automatically
affected when the parent edge is marked as deleted!

The status whether an element is marked as deleted can be requested by

\code
mesh.status(handle).deleted();  // true if element handle is marked as deleted
                                // false otherwise
\endcode

where handle is either a vertex-, edge- or face-handle.

In this example we delete all faces except one and the corresponding vertices.
The code looks like this

\dontinclude delete_geometry.cc
\skipline // Delete face 0
\until mesh.delete_vertex(vhandle[3], false);

Now the deleted faces and vertices are marked as "deleted" internally.
Call garbage_collection() to definitely remove them from memory.

\dontinclude delete_geometry.cc
\skipline // Delete all
\until mesh.garbage_collection();

The full source code of the example:

\include delete_geometry.cc

**/
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API