Converts MULTIPOLYGON Z features into a 3D OBJ model

save_multipolygonz_to_obj(sfobj, filename, swap_yz = FALSE)

Arguments

sfobj

sf object with MULTIPOLYGON Z geometry,

filename

Filename of the OBJ to save the 3D model to.

swap_yz

Default `TRUE`., Whether to swap and Y and Z axes. (Y axis is vertical in rayshader coordinates, but data is often provided with Z being vertical).

Examples

#Convert the built-in Washington Monument MULTIPOLYGON Z data to an OBJ file
obj_temp = tempfile(fileext=".obk")
save_multipolygonz_to_obj(washington_monument_multipolygonz, obj_temp, swap_yz=TRUE)
#Render with rgl
rgl::open3d()
render_obj(filename=obj_temp, xyz=matrix(c(0,0,0),ncol=3), color="red")
render_camera(theta=30,phi=40)