mesh_tmap: Generate a thickness map of an oriented mesh

View source: R/mesh_thicknessMap.R

mesh_tmapR Documentation

Generate a thickness map of an oriented mesh

Description

This generates a thickness map of an un-split mesh (i.e., we don't know the surfaces) by assigning the mesh vertices to a grid of a given resolution and measuring thickness in each grid cell. Currently the thickness is measured by simply computing the maximum distance between vertices assigned to a given grid cell, so it is important to make sure the grid cells are of a reasonable size given the mesh resolution (i.e., not too small). Setting the ld.cutoff parameter to a small value can help ensure this is the case.

Usage

mesh_tmap(mesh.o, base.res, ld.cutoff)

Arguments

mesh.o

An oriented mesh3d object

base.res

Base resolution requested for the thickness map, in mesh units. This resolution will be used only if the number of cells containing less than 5 values is fewer than the limit specified by the ld.cutoff parameter. Otherwise the resolution will be increased in .1 increments until the condition is met.

ld.cutoff

Threshold value (0-1) used to determine the maximum percentage of grid cells that may have fewer than 5 mesh vertices assigned to them. Above this value the resolution of the map will be lowered (i.e. the resolution value will go up, resulting in larger cells).

Value

A list with the following elements:

res

Base resolution requested for the thickness map.

tmap

Thickness map. A data frame with the following columns: GDIM1, GDIM2, thickness, xpos, ypos, xpos.n, ypos.n.

TODO

Implement option to measure using ray tracing.

Note

  1. For an explanation of the GDIM1 and GDIM2 columns in the output thickness map, see the documentation for the addGridInfo function.

  2. The xpos and ypos columns give the coordinates of the top right hand corner of the cell where the thickness was measured.

  3. The xpos.n and ypos.n columns contain the coordinates from the xpos and ypos columns centered on (x = 0, y = 0) and normalized to a maximum distance of 1 from the origin (i.e., x = 0, y = 0).


cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.