Rpolyhedra v0.2.6

0

Monthly downloads

0th

Percentile

Polyhedra Database

A polyhedra database scraped from various sources as R6 objects and 'rgl' visualizing capabilities.

Readme

Rpolyhedra

Polyhedra database scraped from public available sources using R6 objects and 'rgl' visualizing capabilities.

Release Usage Development

| minimal R version | Travis | | CRAN

How to get started

install.packages("Rpolyhedra")

How to get started (Development version)

Install the R package using the following commands on the R console:

install.packages(c("futile.logger", "rgl", "stringr", "R6", "testthat", "devtools"))
devtools::install_github("qbotics/Rpolyhedra")
library(Rpolyhedra)
# if want to switch to fullDB in user filespace, it will download the full database
switchToFullDatabase()

A simple example of 5 regular polyhedra

To get started execute the following commands:

polyhedra.2.draw <- getAvailablePolyhedra(source = "netlib")[1:5]
n <- length(polyhedra.2.draw)
polyhedron.colors <- rainbow(n)
polyhedron.scale <- 5

open3d()
par3d(FOV = 1)
rgl.bg( sphere =FALSE, fogtype = "none", color=c("black"))
rgl.viewpoint(theta = 0,phi=0,zoom=0.8,fov=1)
i <- 1
for (polyhedron.name in polyhedra.2.draw) {
  polyhedron <- getPolyhedron(source = "netlib", polyhedron.name)
  current.angle <- i/n * 2 * pi
  shape.rgl <- polyhedron$getRGLModel(1, c(polyhedron.scale * sin(current.angle),
                                           polyhedron.scale * cos(current.angle),
                                           0))
  shade3d(shape.rgl, color = polyhedron.colors[i])
  i <- i + 1
}

sources

netlib

Includes 142 polyhedra definitions. The PHD format was created to describe the geometric polyhedron definitions derived mathematically by Andrew Hume and by the Kaleido program of Zvi Har'El.

PHD files were generated using poly2 library (no longer mantained). Althought the code is available, specific programming skills are required to run it.

PDH files can be found in extdata/www.netlib.org/polyhedra/index.html

Dmccooey

Includes 767 polyhedra definitions. The polyhedra database built by David Mccooey has an open format which has been scraped to feed RPolyhedra database

dmccooney files can be found in extdata/dmccooey.com/polyhedra/

Troubleshooting

devtools

Ubuntu

apt-get install libcurl4-openssl-dev

Windows

run end user CRAN version

OSX brew

brew install openssl

After, in R:

install.packages("devtools")

rgl

Ubuntu

sudo apt-get install r-cran-rgl

Functions in Rpolyhedra

Name Description
PolyhedronTestTaskEdgesConsistency.class PolyhedronTestTaskEdgesConsistency
initDataDirEnvironment initDataDirEnvironment
getPackageEnvir getPackageEnvir
setUserEnvir setUserEnvir
isCompatiblePolyhedraRDS isCompatiblePolyhedraRDS()
getPreloadedDataFilename getPreloadedDataFilename
switchToFullDatabase switchToFullDatabase()
getPackageVersion getPackageVersion
copyFilesToExtData copyFilesToExtData
scrapePolyhedraSources scrapePolyhedraSources()
downloadRPolyhedraSupportingFiles downloadRPolyhedraSupportingFiles
getPolyhedraRDSPath getPolyhedraRDSPath
getPercentilPolyhedraQuant getPercentilPolyhedraQuant returns polyhedra quantity of parameter percentil
getPolyhedraObject getPolyhedraObject
getDataEnv getDataEnv
getAvailablePolyhedra getAvailablePolyhedra()
getDataDir getDataDir
checkDatabaseVersion checkDatabaseVersion
checkVertices checkVertices()
ScraperLedger.class ScraperLedger
polyhedronToXML polyhedronToXML()
scrapePolyhedra scrapePolyhedra()
selectDataEnv selectDataEnv
getAvailableSources getAvailableSources()
getDatabaseVersion getDatabaseVersion
getUserEnvir getUserEnvir
getEnvironmentFilepath getEnvironmentFilepath
maxWithoutNA maxWithoutNA Function that returns NA if all elements are NA, and the max value not NA, if not.
getUserSpace getUserSpace
updatePolyhedraDatabase updatePolyhedraDatabase
norm norm calculates norm of a vector
setDataDirEnvironment setDataDirEnvironment
setPackageEnvir setPackageEnvir
PolyhedronStateDefined.class Polyhedron State Defined
PolyhedronScraperConfigurationNetlib.class PolyhedronScraperConfigurationNetlib
PolyhedraDatabase.class PolyhedraDatabase
PolyhedronScraperConfiguration.class PolyhedronScraperConfiguration
PolyhedronState.class Polyhedron State
Rpolyhedra Rpolyhedra
PolyhedronTestTaskScrape.class PolyhedronTestTaskScrape
Polyhedron.class Polyhedron
PolyhedronTestTask.class PolyhedronTestTask
PolyhedronScraperConfigurationDmccoey.class PolyhedronScraperConfigurationDmccoey
PolyhedronStateNetlibScraper.class Polyhedron State Netlib Scraper
PolyhedronStateDmccoeyScraper.class Polyhedron State Dmccoey Scraper
getGitCommit getGitCommit get the last git commit sha
getPackageDB getPackageDB
getPackageDir getPackageDir
getPolyhedron getPolyhedron()
No Results!

Vignettes of Rpolyhedra

Name
Rpolyhedra.Rmd
No Results!

Last month downloads

Details

Type Package
License MIT + file LICENSE
Encoding UTF-8
LazyData true
RoxygenNote 6.0.1
VignetteBuilder knitr
Collate 'xml-lib.R' 'polyhedra-lib.R' 'ledger-lib.R' 'db-lib.R' 'zzz.R'
BugReports https://github.com/qbotics/Rpolyhedra/issues
NeedsCompilation no
Packaged 2018-07-10 16:18:37 UTC; kenarab
Repository CRAN
Date/Publication 2018-07-10 16:50:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/Rpolyhedra)](http://www.rdocumentation.org/packages/Rpolyhedra)