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

See also

Other Projections: normal(), project()

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.0413, y:0.00134>  <x:0.11, y:0.000257>   <x:0.0744, y:0.000922>
#>  [4] <x:0.0941, y:0.000916> <x:0.105, y:0.00102>   <x:0.0107, y:0.000421>
#>  [7] <x:0.106, y:0.00126>   <x:0.146, y:0.00014>   <x:0.0724, y:0.000587>
#> [10] <x:0.0228, y:0.000737>