# \donttest{
data("URI1_tooth")
require(morphomap)
require(Morpho)
require(rgl)
Enamel<-URI1_tooth$mesh1
Dentin<-URI1_tooth$mesh2
Pulp<-URI1_tooth$mesh3
outline<-URI1_tooth$outline
set<-URI1_tooth$set
#Unrolling the crown
AlignMeshes<-ToothAlignment(mesh1=Enamel,mesh2=Dentin,mesh3=Pulp,set,outline,analyse = "c")
#Virtual sectioning dentine-pulp
External<-AlignMeshes$almesh1$mesh
Internal<-AlignMeshes$almesh2$mesh
#Define 16 cross-sections from the 30% to the 90% along the crown
Core<-ToothCore(External,Internal,num.points = 1000,num.sect =16,
bio.len = AlignMeshes$length,start=0.3,end=0.9)
plot3d(morphomapArray2matrix(Core$"out3D"),aspect=FALSE,xlab="x",ylab="y",zlab="z")
plot3d(morphomapArray2matrix(Core$"inn3D"),aspect=FALSE,add=TRUE)
wire3d(AlignMeshes$almesh2$mesh,col="white")
wire3d(AlignMeshes$almesh1$mesh,col="violet")
#Unrolling the rooth
AlignMeshes<-ToothAlignment(mesh1=Enamel,mesh2=Dentin,mesh3=Pulp,set,outline,analyse = "r")
#Virtual sectioning dentine-pulp
External<-AlignMeshes$almesh2$mesh
Internal<-AlignMeshes$almesh3$mesh
#Define 16 cross-sections from the 10% to the 50% along the root
Core<-ToothCore(External,Internal,num.points = 1000,num.sect =16,
bio.len = AlignMeshes$length,start=0.1,end=0.5)
plot3d(morphomapArray2matrix(Core$"out3D"),aspect=FALSE,xlab="x",ylab="y",zlab="z")
plot3d(morphomapArray2matrix(Core$"inn3D"),aspect=FALSE,add=TRUE)
wire3d(AlignMeshes$almesh3$mesh,col="red")
wire3d(AlignMeshes$almesh2$mesh,col="lightblue")
wire3d(AlignMeshes$almesh1$mesh,col="white")
# }
Run the code above in your browser using DataLab