adtree2qsm: Transform an adTree output into a QSM file, simplifies it and...

View source: R/adtree2qsm.R

adtree2qsmR Documentation

Transform an adTree output into a QSM file, simplifies it and computes tree volume and DBH

Description

Transform an adTree output into a QSM file, simplifies it and computes tree volume and DBH

Usage

adtree2qsm(mesh, min_diameter = 0.02)

Arguments

mesh

a mesh3d class object build from a .obj output from adTree.

min_diameter

numeric. The minimum diameter to keep in the qsm and mesh

Value

a simplidfied mesh, a qsm object (i.e. a set of cylinders with startxyz, endxyz, ID, radius and length), the estimates for DBH, tree volume, tree total length and volume and legth by 5cm diameter class

Examples


# import the obj file output from adTree
file = system.file("extdata", "adtree_qsm.obj", package="lidUrb")
mesh = Morpho::obj2mesh(file)

# plot the original mesh
rgl::open3d()
rgl::shade3d(mesh,col="black",add=T)

# transform the adTree mesh into a qsm file, simplify the mesh and compute
# some woody structure features
qsm = lidUrb::adtree2qsm(mesh)

# plot the simplified mesh
rgl::open3d()
rgl::shade3d(qsm$mesh,col="black",add=T)

# plot simplified mesh with colored by cylinder ID
rgl::open3d()
rgl::shade3d(qsm$mesh,col=rep(qsm$qsm$cyl_ID,each=20),meshColor = "faces",add=T)

# woodu structure features
qsm$DHB
qsm$Volume
qsm$Length
qsm$Diameter_class


Blecigne/lidUrb documentation built on Feb. 19, 2024, 9:12 a.m.