% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vis_volume.R
\name{mesh.slice.intersection}
\alias{mesh.slice.intersection}
\title{Compute intersection of a triangular surface mesh with an axis-aligned plane.}
\usage{
mesh.slice.intersection(surface, axis, slice_crs_coord)
}
\arguments{
\item{surface}{an \code{fs.surface} instance with vertices in CRS space (0-based), as produced by \code{\link[fsbrain]{mesh.ras2crs}}.}

\item{axis}{integer, 1, 2, or 3. The axis perpendicular to the slice plane (1=sagittal, 2=coronal, 3=axial in CRS convention).}

\item{slice_crs_coord}{numeric scalar, the coordinate along \code{axis} where the slice plane is located. In CRS space (0-based).}
}
\value{
a list of 2×2 numeric matrices. Each matrix represents one line segment with rows \verb{[start, end]} and columns \verb{[axis_val_1, axis_val_2]} giving the coordinates in the two axes orthogonal to the slice axis, in 0-based CRS units. Returns an empty list if no triangles intersect the plane.
}
\description{
For a given axis and coordinate, finds all triangles that straddle the plane and computes the line segment where each crossing triangle intersects the plane. The input surface must have vertices in the same coordinate space as the slice plane definition (typically 0-based CRS).
}
\keyword{internal}
