MEPP2 Project
|
The Helloworld example introduces how to define and use a generic filter on a mesh.
In particular, this tutorial filter illustrates the following features :
Then this also illustrates
Trying out MEPP2 can thus be simply achieved by copying the code of this example and start experiencing/hacking with it.
This generic example is instantiated for the following mesh data structures:
Notice that all the above versions only differ by the respective data structures (AIF, OpenMesh, CGAL::Surface_mesh, CGAL::Polyhedron...) that they respectively instantiate. Yet they share the exact same generic filter code.
The following code snippets assume that Mesh
is a given type for a mesh.
The definition of the Geometry Traits type is obtained by instantiating it with the considere Mesh
type. For convenience in the following code the geometry related types are then extracted from the obtained traits.
Having at hand an instance of the geometry proves to produce more compact and readeable code (as opposed to using global wrapping templated function instantiated with the Geometry type):
Notice that the gt
object must be bound to some mesh instance.
Using points is done as follows
The basic manipulations of Vectors are as follows
Operations on Vectors are as follows
Operations blending the usage of Vectors and Points
Eventually addition and substractions of Vectors and Points
Refer to the Geometry processing API page for the complete list of authorized expressions related to the geometry.
The following code snippet illustrates how to "walk" on the vertices geometries of a given mesh:
See also Examples/Generic/Helloworld/helloworld_filter.hpp for a complete example.