split_pts: Split pointcloud by plane

split_ptsR Documentation

Split pointcloud by plane

Description

[Experimental]

Splits the input coordinates by a 3D plane. This function produces identical results to cutSpace, but should run substantially faster.

Usage

split_pts(coords, p)

Arguments

coords

A matrix-like object with at least 3 columns representing N x 3 XYZ coordinates. Additional columns will be ignored.

p

A 3x3 matrix-like object with coordinates defining a plane, one per row.

Value

A list of two logical vectors of length N, reporting if the coordinate falls above the plane, or not (upr), and if the coordinate falls below the plane, or not (lwr). These two vectors are not exact mirrors of each other since some coordinates may fall on the plane.

Author(s)

Cornel M. Pop

See Also

cutSpace

Examples

library(rgl)
data(demoFlake2)
mesh.o <- Morpho::pcAlign(demoFlake2$mesh)
mpts <- t(mesh.o$vb)
p <- data.frame(x = c(0, 1, 1),
                y = c(0, 1, 0.5),
                z = c(0, 1, 0))
res <- split_pts(mpts, p)
points3d(mpts[res$upr, 1:3], color="red")
points3d(mpts[!res$upr, 1:3], color="blue")

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