Generic function that extracts an isosurface from a volumetric scalar
field. Currently implemented for objects of class sdf_volume
(returned by signed_distance_function()).
Usage
extract_isosurface(x, isovalue = 0, ...)
# S3 method for class 'sdf_volume'
extract_isosurface(x, isovalue = 0, ...)
# Default S3 method
extract_isosurface(x, isovalue = 0, ...)See also
Other sdf_transforms:
sdf_volume,
signed_distance_function()
Examples
if (rlang::is_installed("rgl")) {
f <- system.file("extdata", "torus.stl", package = "vespa")
mesh <- read_stl(f)
torus_sdf <- signed_distance_function(mesh, base_resolution = 32L, padding = 3L)
torus_fat <- extract_isosurface(torus_sdf, isovalue = .3)
rgl::plot3d(torus_fat)
torus_shrink <- extract_isosurface(torus_sdf, isovalue = -.15)
rgl::plot3d(torus_shrink)
}
#> SDF grid: 141 × 141 × 38 — 755,478 voxels, ~5.8 Mb
3D plot