R/geometry.R
Find the points on a plane that are intersected by an object
intersect_plane.neuron
finds the place where a neuron intersection
intersect_plane(x, plane, ...) # S3 method for default intersect_plane(x, plane, ...) # S3 method for neuron intersect_plane(x, plane, closestpoint = NULL, ...)
x | A neuron, set of line segments or other data - see details. |
---|---|
plane | A plane, specified by the 4 coeffients of the plane equation
(see |
... | Additional arguments passed to methods |
closestpoint | Used to define the closest hit when there are multiple |
A Nx3 matrix of the X,Y,Z positions of the intersections (NA when there is no intersection)
Other geometry: plane_coefficients
## Find plane coefficients # point on plane cent=c(250.4987, 95.73561, 140.2052) # vector normal to plane vec=c(0.7709581, 0.03417276, -0.411977) plc=plane_coefficients(cent, vec) ## intersect with plane ip=intersect_plane(Cell07PNs[[1]], plc) plot(Cell07PNs[[1]], WithNodes=FALSE)points(ip[1], ip[2], pch=19, cex=2, col='red')# NOT RUN { plot3d(Cell07PNs[[1]], col='grey', WithNodes=FALSE) spheres3d(matrix(ip, ncol=3), col='red', rad=2) planes3d(plc[,1:3], d=plc[,'d']) # }