Construct an N-dimensional lattice grid
Usage
fm_lattice_Nd(x = NULL, ...)
# S3 method for class 'matrix'
fm_lattice_Nd(x = NULL, dims = NULL, values = NULL, ...)
# S3 method for class 'data.frame'
fm_lattice_Nd(x = NULL, ...)
# S3 method for class 'list'
fm_lattice_Nd(x = NULL, dims = NULL, ...)
# S3 method for class 'fm_bbox'
fm_lattice_Nd(x = NULL, dims = NULL, ...)
# S3 method for class '`NULL`'
fm_lattice_Nd(x = NULL, ..., dims = NULL)
Arguments
- x
list
,data.frame
,matrix
,fm_bbox
orNULL
. If a list of vectors,as.matrix(expand.grid(x))
is used to create a full grid coordinates.data.frame
andmatrix
input is assumed to follow the same ordering convention as the output ofexpand.grid()
. of length N of vectors or grid matrices of coordinate values. List vector values are sorted before use.- ...
Passed on to submethods
- dims
numeric; the size of the grid of dimension
length(dims)
- values
list of grid axis values
Value
An fm_lattice_Nd
object with elements
- dims
integer vector
- values
the grid coordinate axis values
- loc
matrix of constructed grid coordinates
Methods (by class)
fm_lattice_Nd(`NULL`)
: Ignores theNULL
x
and creates a lattice based onvalues
(if non-NULL) anddims
unit hypercube lattice grid withdims
dimensions.
See also
Other object creation and conversion:
fm_as_fm()
,
fm_as_lattice_2d()
,
fm_as_lattice_Nd()
,
fm_as_mesh_1d()
,
fm_as_mesh_2d()
,
fm_as_mesh_3d()
,
fm_as_segm()
,
fm_as_sfc()
,
fm_as_tensor()
,
fm_lattice_2d()
,
fm_mesh_1d()
,
fm_mesh_2d()
,
fm_segm()
,
fm_simplify()
,
fm_tensor()
Author
Finn Lindgren finn.lindgren@gmail.com
Examples
(lattice <- fm_lattice_Nd(
list(
seq(0, 1, length.out = 3),
seq(0, 1, length.out = 4),
seq(0, 1, length.out = 2)
)
))
#> fm_lattice_Nd object:
#> Manifold: R3
#> Dimensions: 3 x 4 x 2
#> Bounding box: (0,1) x (0,1) x (0,1)
#> Basis d.o.f.: 24
if (requireNamespace("geometry", quietly = TRUE)) {
(mesh <- fm_delaunay_3d(lattice$loc))
}
#> fm_mesh_3d object:
#> Manifold: R3
#> V / E / T / Tet: 24 / 84 / 100 / 36
#> Euler char.: 4
#> Bounding box: (0,1) x (0,1) x (0,1)
#> Basis d.o.f.: 24