{"id":18722597,"url":"https://github.com/mdsumner/mesh2d","last_synced_at":"2025-11-11T05:30:20.974Z","repository":{"id":72211587,"uuid":"294676474","full_name":"mdsumner/mesh2d","owner":"mdsumner","description":"2D analogues for some rgl plotting functions (for base graphics)","archived":false,"fork":false,"pushed_at":"2020-09-11T12:22:53.000Z","size":113,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T12:17:02.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdsumner.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-11T11:24:43.000Z","updated_at":"2022-05-16T00:29:16.000Z","dependencies_parsed_at":"2023-02-24T05:30:42.968Z","dependency_job_id":null,"html_url":"https://github.com/mdsumner/mesh2d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fmesh2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fmesh2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fmesh2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fmesh2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdsumner","download_url":"https://codeload.github.com/mdsumner/mesh2d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239587244,"owners_count":19663892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:42:11.481Z","updated_at":"2025-11-11T05:30:20.755Z","avatar_url":"https://github.com/mdsumner.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\r\noutput: github_document\r\neditor_options: \r\n  chunk_output_type: console\r\n---\r\n\r\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\r\n\r\n```{r, include = FALSE}\r\nknitr::opts_chunk$set(\r\n  collapse = TRUE,\r\n  comment = \"#\u003e\",\r\n  fig.path = \"man/figures/README-\",\r\n  out.width = \"100%\"\r\n)\r\n```\r\n\r\n# mesh2d\r\n\r\n\u003c!-- badges: start --\u003e\r\n\u003c!-- badges: end --\u003e\r\n\r\nThe goal of mesh2d is to provide plotting helpers analogous to some rgl functions. \r\n\r\nCurrently \r\n\r\n* `segments2d`\r\n* `triangles2d`\r\n* `quads2d`\r\n\r\n## Installation\r\n\r\nYou can install the dev version of mesh2d from github with\r\n\r\n``` r\r\n## install.packages(\"remotes\")\r\nremotes::install_github(\"mdsumner/mesh2d\")\r\n```\r\n\r\n## Example\r\n\r\n```{r}\r\nlibrary(mesh2d)\r\nquads2d(runif(12), runif(12), border = hcl.colors(3), lwd = 5, col = c(\"grey\", \"firebrick\", \"dodgerblue\"), alpha = 0.5)\r\n\r\n\r\ntriangles2d(rnorm(99), rnorm(99), col = gray.colors(33), add = FALSE)\r\nsegments2d(sort(rnorm(50)), rnorm(50), col = hcl.colors(10), add = FALSE, lwd = 15)\r\n```\r\n\r\n```{r}\r\nqm \u003c- quadmesh::quadmesh(volcano)\r\n\r\nxx \u003c- qm$vb[1, qm$ib]\r\nyy \u003c- qm$vb[2, qm$ib]\r\nquads2d(jitter(xx, 1.1), jitter(yy, 1.2), col = colourvalues::color_values(t(volcano)), add = FALSE)\r\n\r\n\r\ntm \u003c- anglr::as.mesh3d(raster::raster(volcano), max_triangles = 1500)\r\n\r\nxx \u003c- tm$vb[1, tm$it]\r\nyy \u003c- tm$vb[2, tm$it]\r\ntriangles2d(xx, yy, col = colourvalues::color_values(colMeans(matrix(tm$vb[3, tm$it], 3))), add = FALSE)\r\n\r\n\r\n## same as in rgl (but without the per-vertex colour)\r\n#rgl::triangles3d(xx, yy, tm$vb[3, tm$it], color = colourvalues::colour_values(tm$vb[3, ]))\r\n```\r\n\r\n\r\n## Code of Conduct\r\n  \r\n  Please note that the mesh2d project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Fmesh2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdsumner%2Fmesh2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Fmesh2d/lists"}