3 dimensional geometries can be converted to 2 dimensions by mapping them to a plane. Not all 3 dimensional geometries can be converted to 2 dimensions as it requires for them to have a 2 dimensional counterpart. This rules out iso cubes, planes, and tetrahedrons. Spheres are a special case that will get converted to circles with the same radius. As no ellipsoid geometry exist the plane of circles is ignored and mapping a 3D circles thus creates a 2D circle of the same radius irrespective of the supporting plane of the circle.

map_to(x, target)

Arguments

x

A vector of geometries to project or map

target

A vector of planes

Value

A vector of geometries in 2 dimensions

Examples

# Map a 3D point cloud to a plane defined by three random points p <- point(sample(10), sample(10), sample(10)) support <- p[sample(10, 3)] map_to(p, plane(support[1], support[2], support[3]))
#> <2D points [10]> #> [1] <x:-0.354, y:0.00526> <x:-0.349, y:0.0117> <x:-0.0236, y:0.0106> #> [4] <x:-0.0802, y:0.00159> <x:-0.17, y:0.00882> <x:-0.066, y:0.00472> #> [7] <x:-0.241, y:0.00825> <x:-0.212, y:0.00177> <x:-0.292, y:0.00336> #> [10] <x:-0.17, y:0.00767>