Title: | What the Package Does (one line, title case) |
---|---|
Description: | What the package does (one paragraph). |
Authors: | Michael Sumner [aut, cre] |
Maintainer: | Michael Sumner <[email protected]> |
License: | GPL-3 |
Version: | 0.0.0.9000 |
Built: | 2024-11-24 04:55:06 UTC |
Source: | https://github.com/hypertidy/pfft |
Build triangles from PATH
edge_RTriangle(x, ...)
edge_RTriangle(x, ...)
x |
PATH |
... |
arguments passed to 'RTriangle::triangulate' |
Input edges in the form of 'silicate::PATH' and return a RTriangle object.
RTriangle triangulation
data("minimal_mesh", package = "silicate") library(RTriangle) mm <- silicate::PATH(minimal_mesh) plot(edge_RTriangle(mm), asp = 1) plot(edge_RTriangle(mm, D= TRUE), asp = 1)
data("minimal_mesh", package = "silicate") library(RTriangle) mm <- silicate::PATH(minimal_mesh) plot(edge_RTriangle(mm), asp = 1) plot(edge_RTriangle(mm, D= TRUE), asp = 1)
(This function probably belongs in spex). Find the extent of all paths within an object.
extents(x)
extents(x)
x |
Object with paths |
The ‘path_' identifier is included, but won’t be of use without an existing 'PATH' object. The path order is implicit as per the gibble geometry map.
a dataframe of object and extent values (xmin, xmax, ymin, ymax)
data("minimal_mesh", package = "silicate") extents(minimal_mesh)
data("minimal_mesh", package = "silicate") extents(minimal_mesh)
Build a map of triangles to paths (polygon ring)
path_triangle_map(x, RTri)
path_triangle_map(x, RTri)
x |
PATH object |
RTri |
RTriangle triangulation |
data frame mapping triangles to their containing paths
data("minimal_mesh", package = "silicate") p <- silicate::PATH(minimal_mesh) tr <- edge_RTriangle(p) path_triangle_map(p, tr) library(ggplot2) library(dplyr) library(purrr) ggplot(path_triangle_map(p, tr) %>% inner_join(reduce(p[c("path", "path_link_vertex", "vertex")], inner_join))) + geom_polygon(aes(x_, y_, fill = path_)) + facet_wrap(~path_)
data("minimal_mesh", package = "silicate") p <- silicate::PATH(minimal_mesh) tr <- edge_RTriangle(p) path_triangle_map(p, tr) library(ggplot2) library(dplyr) library(purrr) ggplot(path_triangle_map(p, tr) %>% inner_join(reduce(p[c("path", "path_link_vertex", "vertex")], inner_join))) + geom_polygon(aes(x_, y_, fill = path_)) + facet_wrap(~path_)