Applies Loop subdivision to the scene (or selected meshes).

subdivide_mesh(
  scene,
  id = NA,
  subdivision_levels = 2,
  simple = FALSE,
  normals = TRUE,
  verbose = FALSE
)

Arguments

scene

The scene to subdivide.

id

Default NA, all shapes. The index of which shape to subdivide.

subdivision_levels

Default 1. Number of Loop subdivisions to be applied to the mesh.

simple

Default FALSE. Whether to use simple subdivision, which does not change the appearance of the mesh but does create a finer mesh.

normals

Default TRUE. Whether to calculate subdivided vertex normals.

verbose

Default FALSE.

Value

Scene with shape added.

Examples

if(run_documentation()) {
#Subdivide the included R mesh
obj_mesh(r_obj(),position=c(-0.5,0,0)) |> 
  add_shape(subdivide_mesh(obj_mesh(r_obj(),position=c(0.5,0,0)),
                           subdivision_levels = 2)) |> 
  rasterize_scene(light_info = directional_light(direction=c(0.2,0.5,1)),fov=13)
}
#> Setting `lookat` to: c(-0.00, 0.00, 0.00)