data("horse_mesh", package = "stelfi") metrics <- meshmetrics(horse_mesh) str(metrics)
Returned is an sf
object with the following geometric attributes of the user supplied Delaunay triangulation
V1
, V2
, and V3
corresponding vertices of mesh
matches mesh$graph$tv
;ID
, numeric triangle id;angleA
, angleB
, and angleC
, the interior angles;circumcircle_R
(\eqn{R});incircle_r
($r$);c\_Ox, c\_Oy
);i\_Ox, i\_Oy
);radius_edge
$\frac{R}{l_{min}}$, where $l_{min}$ is the minimum edge length;radius_ratio
$\frac{r}{R}$;area
, area ($A$);quality
a measure of "quality" defined as $\frac{4\sqrt{3}|A|}{\Sigma_{i = 1}^3 L_i^2}$,
where $L_i$ is the length of edge $i$.
A triangle's circumcircle (circumscribed circle) is the unique circle that passes through each of its three vertices. A triangle's incircle (inscribed circle) is the largest circle that can be contained within it (i.e., touches it's three edges).
To plot each triangle's metric of choice simply change the fill
aesthetic. Simply a tool to identify "bad" triangles in the mesh.
ggplot(metrics, aes(fill = area)) + geom_sf() + theme_void()
ggplot(metrics, aes(fill = radius_edge)) + geom_sf() + theme_void()
ggplot(metrics, aes(fill = quality)) + geom_sf() + theme_void()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.