as.mesh3d.ashape3d
converts an
alphashape3d::ashape3d
object into a nat/rgl compatible
mesh3d
surface
Note that this provides a link to the Rvcg package
# S3 method for ashape3d as.mesh3d(x, tri_to_keep = 2L, ...) # S3 method for hxsurf as.mesh3d(x, Regions = NULL, material = NULL, drop = TRUE, ...)
x | Object to convert to mesh3d |
---|---|
tri_to_keep | Which alphashape triangles to keep (expert use only - see
|
... | Additional arguments for methods |
Regions | Character vector or regions to select from |
material | rgl materials such as |
drop | Whether to drop unused vertices (default TRUE) |
a mesh3d
object which can be plotted and
manipulated using rgl
and nat
packages.
An alpha shape is a generalisation of a convex hull enclosing a set of points. Unlike a convex hull, the resultant surface can be partly concave allowing the surface to more closely follow the set of points.
In this implementation, the parameter alpha is a scale factor with units of length that defines a spatial domain. When alpha is larger the alpha shape approaches the convex hull; when alpha is smaller the alpha shape has a greater number of faces / vertices i.e. it follows the points more closely.
as.mesh3d
, tmesh3d
,
as.hxsurf
, read.hxsurf
Other hxsurf: as.hxsurf
,
materials
, plot3d.hxsurf
,
read.hxsurf
, subset.hxsurf
,
write.hxsurf
library(alphashape3d)#>#>#>#> #>#> #> #> #>plot(kcs20.a)#> Device 1 : alpha = 10# convert to mesh3d kcs20.mesh=as.mesh3d(kcs20.a) # check that all points are inside mesh all(pointsinside(kcs20, kcs20.mesh))#> [1] TRUE#> [1] TRUE