Description Usage Arguments Value See Also Examples
View source: R/simplification.R
Implementation of a mesh simplification strategy for a surface mesh with associated distributed data. The algorithm works by iteratively collapsing an edge into an internal point. The selection of the edge to contract at each iteration is driven by a cost functional, which measures the loss of geometrical accuracy and data information associated with the collapse. For a detailed description of the algorithm, please refer to:
Dassi, F., Ettinger, B., Perotto, S., Sangalli, L.M. (2015),
A mesh simplification strategy for a spatial regression analysis over the cortical surface of the brain,
Applied Numerical Mathematics, Vol. 90, pp. 111-131.
The whole (computing-intensive) procedure is carried out at the C++ level, thus ensuring high-performance. In detail, the function relies on the class RcppSimplification
- a wrapper for the template class simplification<Triangle, MeshType::DATA, DataGeo>
provided by the C++ library meshsimplification
. Methods of class RcppSimplification
are exposed to R through the API supplied by the Rcpp and RcppEigen packages.
1 | simplify.mesh.2.5D(mesh,target,loc=NULL,val=NULL,wgeom=1/3,wdisp=1/3,wequi=1/3,file='')
|
mesh |
A
|
target |
Number of nodes which the mesh should feature at the end of the simplification process. In other terms, |
loc |
#data-by-3 vector with data locations; default is NULL, i.e. data locations are assumed to coincide with the mesh vertices. |
val |
#data-by-1 vector with the observations associated with each data point; default is NULL. |
wgeom |
Weight for the geometric component of the edge cost function; default is 1/3. Note that the all weights should be positive and sum up to one. |
wdisp |
Weight for the data displacement component of the edge cost function; default is 1/3. Note that the all weights should be positive and sum up to one. |
wequi |
Weight for the data equidistribution component of the edge cost function; default is 1/3. Note that the all weights should be positive and sum up to one. |
file |
String specifying the path to the location where the simplified mesh will be stored; the following file formats are supported:
Text files are assumed to be structured as the AVS UCD ASCII files (.inp extension).
If |
A list equipped with the following fields:
mesh
: the simplified mesh as an instance of class mesh.2.5D
; the order of the output mesh coincides with the order of the input mesh;
simplifier
: the object of class RcppSimplification
used within the function to carry out the simplification procedure at the C++ level. This object is returned since eases (and speeds up) the extraction of useful information about the mesh, which are not directly made available by mesh.2.5D
or which may rely on the connectivities of the mesh itself, as, e.g., the list of edges (see get.edges
);
locations
: #data-by-3 matrix holding the location of each data point over the simplified mesh;
qoi
: vector listing the quantity of information associated with each triangle in the simplified mesh; see get.quantity.of.information
for a rigorous definition of the quantity of information.
plot.mesh.2.5D
, import.mesh.2.5D
1 2 3 4 5 6 7 8 | ## Import the mesh of a pawn
data(pawn_250)
## Simplify the mesh down to 200 nodes; assume the components of the
## edge cost functions are equally weighted and that the data locations
## coincide with the vertices of the mesh
out1 <- simplify.mesh.2.5D(mesh, 200)
## Resume the simplification procedure, reducing the mesh down to 150 nodes
out2 <- simplify.mesh.2.5D(out1$mesh, 150, out1$locations)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.