Skip to contents

Compute information for assigning points to the vertices of the covering triangle

Usage

fm_vertex_projection(points, mesh)

Arguments

points

A SpatialPointsDataFrame, sf, tibble, or list object

mesh

An fm_mesh_2d object

Value

SpatialPointsDataFrame, sf, tibble, or list of mesh vertices with projected data attached

Examples

head(fm_vertex_projection(list(loc = fmexample$loc), fmexample$mesh))
#> # A tibble: 6 × 4
#>   weight .block .vertex loc[,"X"] [,"Y"] [,"Z"]
#>    <dbl>  <int>   <int>     <dbl>  <dbl>  <dbl>
#> 1 0.306       1      84     0.294 -1.26       0
#> 2 0.0477      1      85    -1.22   2.45       0
#> 3 0.0831      1      88    -2.50  -0.254      0
#> 4 1.11        1      89    -0.574 -1.00       0
#> 5 0.0253      1      97     0.419 -0.434      0
#> 6 0.0355      1     103    -1.49  -0.250      0
head(fm_vertex_projection(fmexample$loc_sf, fmexample$mesh))
#> # A tibble: 6 × 4
#>   weight .block .vertex loc[,"X"] [,"Y"] [,"Z"]
#>    <dbl>  <int>   <int>     <dbl>  <dbl>  <dbl>
#> 1 0.306       1      84     0.294 -1.26       0
#> 2 0.0477      1      85    -1.22   2.45       0
#> 3 0.0831      1      88    -2.50  -0.254      0
#> 4 1.11        1      89    -0.574 -1.00       0
#> 5 0.0253      1      97     0.419 -0.434      0
#> 6 0.0355      1     103    -1.49  -0.250      0