-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
72 lines (56 loc) · 2.37 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# doolkit
<!-- badges: start -->
<!-- badges: end -->
The doolkit package provides functions to explore the topography of 3d triangle meshes. It was developed with dental surfaces in mind, but could be applied to any triangle mesh of class 'mesh3d'. The package aims to group all the methods associated to dental topography within the same toolkit. New methods could be included and shall be introduced in later versions of the package.
## Installation
You can install the released version of doolkit from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("doolkit")
```
## Example
```{r example}
library(doolkit)
#Import surfaces
#PLY <- Rvcg::vcgImport(choose.files(), updateNormals = TRUE, clean = TRUE, silent = TRUE)
PLY <- dkpongo$OES
#Computation
Area <- round(Rvcg::vcgArea(PLY), digits = 2)
#...relief
Gamma <- round(rfi(PLY, method = "Guy"), digits = 2)
Rfi <- round(rfi(PLY, method = "Ungar"), digits = 2)
Lrfi <- round(rfi(PLY, method = "Boyer"), digits = 2)
Slope <- round(mean(slope(PLY)), digits = 2)
#...sharpness
ARC <- arc(PLY)
Arc <- round(mean(ARC), digits = 3)
Parc <- round(mean(ARC[ARC >= 0]), digits = 3)
Narc <- round(mean(ARC[ARC < 0]), digits = 3)
Dne <- round(dne(PLY, total = TRUE), digits = 2)
#...complexity
Opcr <- round(opcr(PLY)$opcr, digits = 1)
#...shape indices
FormFactor <- round(shape.index(PLY)$FormFactor, digits = 3)
Elongation <- round(shape.index(PLY)$Elongation, digits = 3)
K <- round(shape.index(PLY)$K, digits = 3)
#Maps
#...relief
dkmap(dkpongo$OES, doolkit::elev(dkpongo$OES), col = "elev", legend.lab = "Elevation (mm)")
dkmap(dkpongo$OES, doolkit::slope(dkpongo$OES), col.levels = 9, col = "slope", legend.lab = "Slope (degrees)", min.range = 0, max.range = 90)
#...orientation
dkmap(dkpongo$OES, orient(dkpongo$OES), col.levels = 8, col = "orient", legend.lab = "Orientation (degrees)",legend.type = "pie", min.range = 0, max.range = 360)
#...sharpness
dkmap(dkpongo$OES, doolkit::arc(dkpongo$OES), col = "arc", legend.lab = "ARC", min.range = -20, max.range = 20, col.levels = 15)
dkmap(dkpongo$OES, doolkit::dne(dkpongo$OES), col = "dne", legend.lab = "DNE", legend.type = "log")
```