| Title: | Polyhedra Database |
|---|---|
| Description: | A polyhedra database scraped from various sources as R6 objects and 'rgl' visualizing capabilities. |
| Authors: | Alejandro Baranek [aut, com, cre, cph], Leonardo Belen [aut, com, cph], qbotics [cph], Barret Schloerke [rev], Lijia Yu [rev] |
| Maintainer: | Alejandro Baranek <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.5.6 |
| Built: | 2025-11-25 06:59:25 UTC |
| Source: | https://github.com/ropensci/Rpolyhedra |
A polyhedra database scraped from various sources as R6 objects and 'rgl' visualizing capabilities.
A polyhedra database scraped from:
http://paulbourke.net/dataformats/phd/: PHD files as R6 objects and 'rgl' visualizing capabilities. The PHD format was created to describe the geometric polyhedra definitions derived mathematically <https://netlib.org/polyhedra/> by Andrew Hume and by the Kaleido program of Zvi Har'El.
http://dmccooey.com/Polyhedra/: Polyhedra text datafiles.
Maintainer: Alejandro Baranek [email protected] [compiler, copyright holder]
Authors:
Leonardo Belen [email protected] [compiler, copyright holder]
Other contributors:
qbotics [email protected] [copyright holder]
Barret Schloerke [email protected] [reviewer]
Lijia Yu [email protected] [reviewer]
Useful links:
Report bugs at https://github.com/ropensci/Rpolyhedra/issues
Returns a configured logger with threshold according r6 object. This function is usually called in class constructors
genLogger(r6.object)genLogger(r6.object)
r6.object |
an r6.object |
ken4rab
Gets the list of names of available polyhedra and its status in the polyhedra database, which can be later called with getPolyhedron
getAvailablePolyhedra(sources, search.string)getAvailablePolyhedra(sources, search.string)
sources |
A string vector containing the source, which can be obtained from getAvailableSources(). |
search.string |
A search string |
polyhedra names vector
getAvailableSources
# gets all polyhedra in the database available.polyhedra <- getAvailablePolyhedra() # returns all polyhedra from a given source, in this case, netlib available.netlib.polyhedra <- getAvailablePolyhedra(sources = "netlib") # search within the polyhedron names cube <- getAvailablePolyhedra(sources = "netlib", search.string = "cube") cube# gets all polyhedra in the database available.polyhedra <- getAvailablePolyhedra() # returns all polyhedra from a given source, in this case, netlib available.netlib.polyhedra <- getAvailablePolyhedra(sources = "netlib") # search within the polyhedron names cube <- getAvailablePolyhedra(sources = "netlib", search.string = "cube") cube
Gets the list of names of available sources in database to be used later as references to the package.
getAvailableSources()getAvailableSources()
sources string vector, which can be obtained from getAvailableSources()
getAvailablePolyhedra, getPolyhedron
# gets all sources in the database available.sources <- getAvailableSources() # returns all polyhedra from all sources available.polyhedra <- getAvailablePolyhedra(sources = available.sources) # search within the polyhedron names from all sources cubes <- getAvailablePolyhedra( sources = available.sources, search.string = "cube" ) cubes# gets all sources in the database available.sources <- getAvailableSources() # returns all polyhedra from all sources available.polyhedra <- getAvailablePolyhedra(sources = available.sources) # search within the polyhedron names from all sources cubes <- getAvailablePolyhedra( sources = available.sources, search.string = "cube" ) cubes
Returns the configured lgr of an r6 object. If the object don't have a lgr or is not initialized returns an error
getLogger(r6.object)getLogger(r6.object)
r6.object |
an r6.object |
ken4rab
Return the polyhedra database handler.
getPolyhedraObject()getPolyhedraObject()
.polyhedra
PolyhedraDatabase
Gets a polyhedron from the database. It returns an R6 Class with all its characteristics and functions. The object returned, of type Polyhedron, allows to the user to get access to all the functionality provided.
getPolyhedron(source = "netlib", polyhedron.name)getPolyhedron(source = "netlib", polyhedron.name)
source |
string vector, which can be obtained from getAvailableSources() |
polyhedron.name |
a valid name of a polyhedron in the database. Current names can be found with getAvailablePolyhedra() |
polyhedron R6 object
getAvailablePolyhedra, getAvailableSources
tetrahedron <- getPolyhedron( source = "netlib", polyhedron.name = "tetrahedron" ) # returns name of polyhedra tetrahedron$getName() # polyhedron state tetrahedron.state <- tetrahedron$getState() # Johnson symbol and Schlafli symbol tetrahedron.state$getSymbol() # vertex data.frame tetrahedron.state$getVertices() # List of faces of solid representation (3D) tetrahedron.state$getSolid() # List of faces of net representation (2D) tetrahedron.state$getNet()tetrahedron <- getPolyhedron( source = "netlib", polyhedron.name = "tetrahedron" ) # returns name of polyhedra tetrahedron$getName() # polyhedron state tetrahedron.state <- tetrahedron$getState() # Johnson symbol and Schlafli symbol tetrahedron.state$getSymbol() # vertex data.frame tetrahedron.state$getVertices() # List of faces of solid representation (3D) tetrahedron.state$getSolid() # List of faces of net representation (2D) tetrahedron.state$getNet()
loggerSetupFile
loggerSetupFile(log.file, default.threshold = "info", append = TRUE)loggerSetupFile(log.file, default.threshold = "info", append = TRUE)
log.file |
log path for logging file |
default.threshold |
threshold for setting root. Default = "info" |
append |
if set to FALSE, cleanup all previous logs |
kenarab
mutate_cond
mutate_cond(.data, condition, ..., envir = parent.frame())mutate_cond(.data, condition, ..., envir = parent.frame())
.data |
data frame to apply the mutate |
condition |
condition to conditionally apply mutate |
... |
mutation function |
envir |
environment to apply condition |
Scrapes all polyhedra in data folder to save a representation which
is accessible by the final users upon call to getPolyhedron().
versionversion of database file
polyhedra.rds.filepath of rds database file
sources.configSources configuration for scraping different sources
ledgerrr ledger of scraping process
loggerclass logger
new()
Create a new PolyhedraDatabase object.
PolyhedraDatabase$new()
A new 'PolyhedraDatabase' object.
getVersion()
get the version of the current object.
PolyhedraDatabase$getVersion()
Database version
configPolyhedraRDSPath()
sets the path of the RDS object
PolyhedraDatabase$configPolyhedraRDSPath()
Database version
existsSource()
Determines if the source exists on the database
PolyhedraDatabase$existsSource(source)
sourcesource description
boolean value
addSourceConfig()
add source.config to the database
PolyhedraDatabase$addSourceConfig(source.config)
source.configSourceConfig object able to scrape source polyhedra definitions
PolyhedraDatabase object
existsPolyhedron()
Determines if the database includes a polyhedron which name matches the parameter value
PolyhedraDatabase$existsPolyhedron(source = "netlib", polyhedron.name)
sourcesource description
polyhedron.namepolyhedron description
boolean value
getPolyhedraSourceDir()
gets polyhedra sources folder
PolyhedraDatabase$getPolyhedraSourceDir(source, create.dir = TRUE)
sourcesource description
create.dirif dir does not exists, create it
string with polyhedra sources path
getPolyhedronFilename()
gets the filename of the polyhedron matching parameter.
PolyhedraDatabase$getPolyhedronFilename(source, polyhedron.name, extension)
sourcesource description
polyhedron.namepolyhedron description
extensionextension of the polyhedron filename
string with polyhedron filename
getPolyhedron()
gets polyhedron object which name matches the parameter value
PolyhedraDatabase$getPolyhedron( source = "netlib", polyhedron.name, strict = FALSE )
sourcesource description
polyhedron.namepolyhedron description
stricthalts execution if polyhedron not found
Polyhedron object
addPolyhedron()
add polyhedron object to the database
PolyhedraDatabase$addPolyhedron( source = "netlib", source.filename, polyhedron, overwrite = FALSE, save.on.change = FALSE )
sourcesource description
source.filenamefilename of the polyhedron source definition
polyhedronpolyhedron object
overwriteoverwrite exiting definition
save.on.changesaves Database state after operation
Polyhedron object
configPolyhedraSource()
Process parameter filenames using source.config parameter
PolyhedraDatabase$configPolyhedraSource( source.config, source.filenames = NULL, max.quant = 0, save.on.change = FALSE )
source.configsource configuration for scraping files
source.filenamesfilenames of the polyhedron source definition
max.quantmaximum filenames to process
save.on.changesaves Database state after operation
Modified 'PolyhedraDatabase' object.
saveRDS()
saveRDS
PolyhedraDatabase$saveRDS(save.on.change = TRUE)
save.on.changesaves Database state after operation
saveRDS return status
cover()
Cover objects and applies covering.code parameter
PolyhedraDatabase$cover( mode, sources = names(self$sources.config), covering.code, polyhedra.names = NULL, max.quant = 0, save.on.change = FALSE, seed = NULL )
modecovering mode. Available values are "scrape.queued", "scrape.retry","skipped", "test"
sourcessources names
covering.codecode for applying in covering
polyhedra.namespolyhedra names to cover (optional)
max.quantmaximum numbers of polyhedra to cover
save.on.changesaves Database state after operation
seedseed for deterministic random generator
A list with resulting objects covered
scrape()
Scrape polyhedra queued sources
PolyhedraDatabase$scrape( mode = "scrape.queued", sources = names(self$sources.config), max.quant = 0, time2scrape.source = 30, save.on.change = FALSE, skip.still.queued = FALSE )
modecovering mode. Available values are "scrape.queued", "scrape.retry","skipped", "test"
sourcessources names
max.quantmaximum numbers of polyhedra to cover
time2scrape.sourcemaximum time to spend scraping each source
save.on.changesaves Database state after operation
skip.still.queuedFlag unscraped files with status 'skipped“
covering.codecode for applying in covering
polyhedra.namespolyhedra names to cover (optional)
A list with resulting objects covered
testRR()
testRR
PolyhedraDatabase$testRR(sources = names(self$sources.config), max.quant = 0)
sourcessources names
max.quantmaximum numbers of polyhedra to cover
A list with resulting objects tested
generateTestTasks()
generate Test tasks for selected polyhedra
PolyhedraDatabase$generateTestTasks( sources = names(self$sources.config), polyhedra.names = NULL, TestTaskClass, max.quant = 0 )
sourcessources names
polyhedra.namespolyhedra names to cover (optional)
TestTaskClassan R6 TestTaskClass class
max.quantmaximum numbers of polyhedra to cover
A list with resulting TestTasks generated
schedulePolyhedraSources()
Schedules polyhedra sources for scraping
PolyhedraDatabase$schedulePolyhedraSources(
sources.config = getPackageEnvir(".available.sources"),
source.filenames = NULL,
max.quant = 0,
save.on.change = FALSE
)sources.configsources configurations for scraping files
source.filenamesfilenames of the polyhedron source definition
max.quantmaximum filenames to process
save.on.changesaves Database state after operation
Modified 'PolyhedraDatabase' object.
getAvailableSources()
Returns available sources in current database
PolyhedraDatabase$getAvailableSources()
A vector with names of available sources
getAvailablePolyhedra()
Retrieves all polyhedron within the source those names match with search.string
PolyhedraDatabase$getAvailablePolyhedra( sources = self$getAvailableSources(), search.string = NULL, ignore.case = TRUE )
sourcessources names
search.stringstring for matching polyhedron names
ignore.caseignore case in search string
A list with resulting objects covered
clone()
The objects of this class are cloneable with this method.
PolyhedraDatabase$clone(deep = FALSE)
deepWhether to make a deep clone.
Polyhedron container class, which is accessible by the final users upon call
file.idPolyhedron file.id
statePolyhedron state
loggerclass logger
new()
Create a polyhedronState object
Polyhedron$new(file.id, state = NULL)
file.idthe file id
statepolyhedron state object
A new Polyhedron object.
scrapeNetlib()
scrape Netlib polyhedron definition
Polyhedron$scrapeNetlib(netlib.p3.lines)
netlib.p3.linesvector with netlib definition lines
A new PolyhedronStateDefined object.
scrapeDmccooey()
scrape Dmccooey polyhedron definition
Polyhedron$scrapeDmccooey(polyhedra.dmccooey.lines)
polyhedra.dmccooey.linesvector with Dmccooey definition lines
A new PolyhedronStateDefined object.
deserialize()
deserialize a polyhedron state definition
Polyhedron$deserialize(serialized.polyhedron)
serialized.polyhedrona serialized version of a polyhedron state
A new PolyhedronStateDefined object.
getName()
get Polyhedron name
Polyhedron$getName()
string with polyhedron name
getState()
Gets polyhedron state
Polyhedron$getState()
A new PolyhedronState object.
getSolid()
Gets a solid definition
Polyhedron$getSolid()
A list of vertex vectors composing polyhedron faces.
isChecked()
checks Edges consistency
Polyhedron$isChecked()
A boolean value
getRGLModel()
Return an 'rgl' model with an optional transformation described by transformation.matrix parameter
Polyhedron$getRGLModel(transformation.matrix = NULL)
transformation.matrixtransformation matrix parameter
An tmesh3d object
exportToXML()
exports an XML definition of current polyhedron
Polyhedron$exportToXML()
A character object with the XML definition
getErrors()
returns the errors found when processing current polyhedron
Polyhedron$getErrors()
a data.frame with polyhedron errors
checkProperties()
check properties of current polyhedron
Polyhedron$checkProperties(expected.vertices, expected.faces)
expected.verticesexpected vertices number
expected.facesexpected faces number
Unmodified polyhedron object
clone()
The objects of this class are cloneable with this method.
Polyhedron$clone(deep = FALSE)
deepWhether to make a deep clone.
ken4rab
This abstract class provide the basis from which every polyhedron state class derivate.
sourcepolyhedron definition source
file.idpolyhedron file id
errorsErrors string
loggerclass logger
new()
Create a polyhedronState object
PolyhedronState$new(source, file.id)
sourcethe source file
file.idthe file id
A new PolyhedronState object. '@description Adds an error to the error string and log it as info
addError()
PolyhedronState$addError(current.error)
current.errorthe error to add
scrape()
Scrapes the polyhedra folder files
PolyhedronState$scrape()
getName()
Get Polyhedron name
PolyhedronState$getName()
string with polyhedron name
getSolid()
Returns the object corresponding to the solid
PolyhedronState$getSolid()
checkEdgesConsistency()
Checks edge consistency
PolyhedronState$checkEdgesConsistency()
applyTransformationMatrix()
Apply transformation matrix to polyhedron
PolyhedronState$applyTransformationMatrix(transformation.matrix)
transformation.matrixthe transformation matrix to apply to the polyhedron
buildRGL()
Creates a 'rgl' representation of the object
PolyhedronState$buildRGL(transformation.matrix)
transformation.matrixthe transformation matrix to apply to the polyhedron
exportToXML()
Gets an XML representation out of the polyhedron object
PolyhedronState$exportToXML()
clone()
The objects of this class are cloneable with this method.
PolyhedronState$clone(deep = FALSE)
deepWhether to make a deep clone.
ken4rab
Polyhedron State scraped and defined
Rpolyhedra::PolyhedronState -> PolyhedronStateDefined
file.idpolyhedron filename in original
sourcepolyhedron definition source (netlib|dmccooey)
namepolyhedron name (netlib|dmccooey)
symbolthe eqn(1) input for two symbols separated by a tab; the Johnson symbol, and the Schlafli symbol (netlib)
dualthe name of the dual polyhedron optionally followed by a horizontal tab and the number of the dual (netlib)
sfacespolyhedron solid face list (netlib)
sverticespolyhedron solid vertices list (netlib)
verticesPolyhedron vertices list (netlib|dmccooey)
vertices.centeredcentered vertices for applying transformation matrices
netpolyhedron 2D net model with vertices defined for a planar representation (netlib)
solidpolyhedron list of edges which generate a solid (netlib|dmccooey)
hingesPolyhedron hinge list (netlib)
dihDih attribute (netlib)
edgespolyhedron edges (netlib|dmccooey)
transformation.matrixtransformation matrix for calculations and visualizing polyhedron
new()
object initialization routine
PolyhedronStateDefined$new( source, file.id, name, vertices, solid, net = NULL, symbol = "", dual = NULL, sfaces = NULL, svertices = NULL, hinges = NULL, dih = NULL, normalize.size = TRUE )
sourcethe library to use
file.ididentifier of the definition file.
namethe polyhedron name
verticesthe vertices
solidthe solid object
netthe net
symbolthe symbol
dualwhether it is dual or not
sfacesthe solid faces
sverticesthe solid vertices
hingesthe hinges
dihthe dih
normalize.sizewhether it has to normalize the size or not
A new PolyhedronStateDefined object.
scrape()
scrape polyhedron. As the state is defined this functions do nothing
PolyhedronStateDefined$scrape()
current object
saveToJson()
saves the state to a JSON file
PolyhedronStateDefined$saveToJson(pretty = FALSE)
prettywhether json output is pretty or not
a json object
getName()
get Polyhedron name
PolyhedronStateDefined$getName()
string with polyhedron name
getSymbol()
get Polyhedron symbol
PolyhedronStateDefined$getSymbol()
string with polyhedron symbol
adjustVertices()
adjust polyhedron Vertices
PolyhedronStateDefined$adjustVertices(normalize.size = TRUE)
normalize.sizewhether it has to normalize the size or not
modified PolyhedronStateDefined object.
getVertices()
Get the polyhedron state
PolyhedronStateDefined$getVertices(solid = FALSE)
solidtoggles the production of solid vertices.
getNet()
Gets the net property
PolyhedronStateDefined$getNet()
getSolid()
Gets the solid property
PolyhedronStateDefined$getSolid()
inferEdges()
Infer edges
PolyhedronStateDefined$inferEdges(force.recalculation = FALSE)
force.recalculationforces the recalculation of the edges
checkEdgesConsistency()
Checks edges consistency
PolyhedronStateDefined$checkEdgesConsistency()
triangulate()
Triangulates the polyhedron
PolyhedronStateDefined$triangulate(force = FALSE)
forceforces the triangulation.
getConvHull()
Gets the convex hull
PolyhedronStateDefined$getConvHull( transformation.matrix = self$transformation.matrix, vertices.id.3d = private$vertices.id.3d )
transformation.matrixthe transformation matrix
vertices.id.3dthe vertices ids
the convex hull
calculateMassCenter()
Calculates the center of mass.
PolyhedronStateDefined$calculateMassCenter( vertices.id.3d = private$vertices.id.3d, applyTransformation = TRUE )
vertices.id.3dthe vertices ids
applyTransformationdoes it need to apply transformations?
getNormalizedSize()
Gets the normalized size
PolyhedronStateDefined$getNormalizedSize(size)
sizethe object's size
getTransformedVertices()
Gets the transformed vertices
PolyhedronStateDefined$getTransformedVertices( vertices = self$vertices.centered, transformation.matrix = self$transformation.matrix )
verticesinput vertices
transformation.matrixthe transformation matrix
resetTransformationMatrix()
Resets the transformation matrix
PolyhedronStateDefined$resetTransformationMatrix()
applyTransformationMatrix()
Apply transformation matrix to polyhedron
PolyhedronStateDefined$applyTransformationMatrix(transformation.matrix)
transformation.matrixthe transformation matrix to apply to the polyhedron
an applied transformation.matrix
buildRGL()
Build 'rgl'
PolyhedronStateDefined$buildRGL(transformation.matrix = NULL)
transformation.matrixthe transformation matrix
exportToXML()
Exports the object to XML format
PolyhedronStateDefined$exportToXML()
expectEqual()
Determines if a polyhedron is equal to this one.
PolyhedronStateDefined$expectEqual(polyhedron)
polyhedronthe polyhedron to compare to.
serialize()
Serialize the object.
PolyhedronStateDefined$serialize()
clone()
The objects of this class are cloneable with this method.
PolyhedronStateDefined$clone(deep = FALSE)
deepWhether to make a deep clone.
ken4rab
Polyhedron state for deserialize from database
Rpolyhedra::PolyhedronState -> PolyhedronStateDeserializer
serialized.polyhedronpolyhedron definition serialized
Rpolyhedra::PolyhedronState$addError()Rpolyhedra::PolyhedronState$applyTransformationMatrix()Rpolyhedra::PolyhedronState$buildRGL()Rpolyhedra::PolyhedronState$checkEdgesConsistency()Rpolyhedra::PolyhedronState$exportToXML()Rpolyhedra::PolyhedronState$getName()Rpolyhedra::PolyhedronState$getSolid()new()
Initialize PolyhedronStateDeserializer object
PolyhedronStateDeserializer$new(serialized.polyhedron)
serialized.polyhedrona serialized polyhedron
A new PolyhedronStateDeserializer object.
scrape()
Generates a PolyhedronStateDefined from a serialized polyhedron
PolyhedronStateDeserializer$scrape()
A new PolyhedronStateDefined object.
clone()
The objects of this class are cloneable with this method.
PolyhedronStateDeserializer$clone(deep = FALSE)
deepWhether to make a deep clone.
ken4rab
Scrapes polyhedra from a dmccooey file format
Rpolyhedra::PolyhedronState -> PolyhedronStateDmccooeyScraper
regexp.values.namesregexp for scraping values names
regexp.rnregexp for scraping real numbers
regexp.valuesregexp for scraping values
regexp.vertexregexp for scraping vertices
regexp.facesregexp for scraping faces
polyhedra.dmccooey.linesdmccooey polyhedra definition lines
labels.maplabels map where values are
valueslabels map where values are
verticesspecification
vertices.replaced3D values
facesdefinition
new()
Initialize Dmccooey scraper
PolyhedronStateDmccooeyScraper$new(file.id, polyhedra.dmccooey.lines)
file.ididentifier of the definition file.
polyhedra.dmccooey.linesraw Dmccooey definition file lines
A new PolyhedronStateDmccooeyScraper object.
setupRegexp()
setupRegexp for Dmccooey definition
PolyhedronStateDmccooeyScraper$setupRegexp()
This PolyhedronStateDmccooeyScraper object with regexp defined.
scrapeValues()
scrape values from Dmccooey definition
PolyhedronStateDmccooeyScraper$scrapeValues(values.lines)
values.linesvalues definitions in Dmccooey source
This PolyhedronStateDmccooeyScraper object with values defined.
scrapeVertices()
scrape polyhedron vertices from definition
PolyhedronStateDmccooeyScraper$scrapeVertices(vertices.lines)
vertices.linesvertices definitions in Dmccooey source
This PolyhedronStateDmccooeyScraper object with faces defined.
scrapeFaces()
scrape polyhedron faces from definition
PolyhedronStateDmccooeyScraper$scrapeFaces(faces.lines)
faces.linesface
This PolyhedronStateDmccooeyScraper object with faces defined.
scrape()
scrape Dmccooey polyhedron definition
PolyhedronStateDmccooeyScraper$scrape()
A new PolyhedronStateDefined object.
getName()
get Polyhedron name
PolyhedronStateDmccooeyScraper$getName()
string with polyhedron name
applyTransformationMatrix()
Apply transformation matrix to polyhedron
PolyhedronStateDmccooeyScraper$applyTransformationMatrix(transformation.matrix)
transformation.matrixthe transformation matrix to apply to the polyhedron
buildRGL()
Creates a 'rgl' representation of the object
PolyhedronStateDmccooeyScraper$buildRGL(transformation.matrix)
transformation.matrixthe transformation matrix to apply to the polyhedron
exportToXML()
serializes object in XML
PolyhedronStateDmccooeyScraper$exportToXML()
clone()
The objects of this class are cloneable with this method.
PolyhedronStateDmccooeyScraper$clone(deep = FALSE)
deepWhether to make a deep clone.
ken4rab
Scrapes polyhedra from a PHD file format.
Rpolyhedra::PolyhedronState -> PolyhedronStateNetlibScraper
netlib.p3.linesThe path to the PHD files
labels.rowsLabels - row of appearance
labels.mapLabels - Map of content
errorsthe errors found
new()
Initializes the object, taking the file.id and PDH file as parameters
PolyhedronStateNetlibScraper$new(file.id, netlib.p3.lines)
file.idthe file id
netlib.p3.linesthe lines to add
A new PolyhedronStateNetlibScraper object.
extractRowsFromLabel()
Extracts data from the label, taking the label number and the expected label as parameters
PolyhedronStateNetlibScraper$extractRowsFromLabel(label.number, expected.label)
label.numberthe label number
expected.labelthe expected label
getLabels()
get Labels from current netlib file description
PolyhedronStateNetlibScraper$getLabels()
a list containing labels from netlib file description
scrapeNet()
scrape Net Model from netlib format
PolyhedronStateNetlibScraper$scrapeNet(net.txt, offset = 0)
net.txta vector containing net model in netlib format
offsetin numbering vertices
a list containing a net model
extractCFOutBrackets()
Remove brackets for current field content
PolyhedronStateNetlibScraper$extractCFOutBrackets(x)
xa string containing brackets
value
scrapeVertices()
scrape vertices described in netlib format
PolyhedronStateNetlibScraper$scrapeVertices(vertices.txt)
vertices.txtvector containing netlib format vertices
data.frame containing netlib vertices
setupLabelsOrder()
setupLabelsOrder
PolyhedronStateNetlibScraper$setupLabelsOrder()
vertices.txtvector containing netlib format vertices
data.frame containing netlib vertices
getDataFromLabel()
Get data from label specified as parameter
PolyhedronStateNetlibScraper$getDataFromLabel(label)
labelthe label to get data from
value
getName()
get Polyhedron name
PolyhedronStateNetlibScraper$getName()
string with polyhedron name
scrape()
scrape Netlib polyhedron definition
PolyhedronStateNetlibScraper$scrape()
A new PolyhedronStateDefined object.
applyTransformationMatrix()
Apply transformation matrix to polyhedron
PolyhedronStateNetlibScraper$applyTransformationMatrix(transformation.matrix)
transformation.matrixthe transformation matrix to apply to the polyhedron
buildRGL()
Creates a 'rgl' representation of the object
PolyhedronStateNetlibScraper$buildRGL(transformation.matrix)
transformation.matrixthe transformation matrix to apply to the polyhedron
exportToXML()
serializes object in XML
PolyhedronStateNetlibScraper$exportToXML()
clone()
The objects of this class are cloneable with this method.
PolyhedronStateNetlibScraper$clone(deep = FALSE)
deepWhether to make a deep clone.
ken4rab
Gets an XML representation out of the polyhedron object
polyhedronToXML(polyhedron.state.defined, is.transformed.vertices = TRUE)polyhedronToXML(polyhedron.state.defined, is.transformed.vertices = TRUE)
polyhedron.state.defined |
the polyhedron to get a representation from |
is.transformed.vertices |
flag which states if vertices are in original position or transformationMatrix applied |
an XML document, ready to be converted to String with XML::saveXML()
# get the representation of a cube (netlib library) XML::saveXML(polyhedronToXML(getPolyhedron("netlib", "cube")$state))# get the representation of a cube (netlib library) XML::saveXML(polyhedronToXML(getPolyhedron("netlib", "cube")$state))
Gets polyhedra objects from text files of different sources, scheduling and scraping using predefined configurations.
scrapePolyhedra( scrape.config, source.filenames = NULL, sources.config = getUserEnvir(".available.sources"), logger = lgr )scrapePolyhedra( scrape.config, source.filenames = NULL, sources.config = getUserEnvir(".available.sources"), logger = lgr )
scrape.config |
predefined configuration for scraping |
source.filenames |
if not null specify which source filenames to scrape |
sources.config |
the sources that will be used by the function |
logger |
logger for inheriting threshold from calling class/function |
polyhedra db object
Scrapes polyhedra objects from text files of different sources, in order to make them available to the package.
scrapePolyhedraSources(sources.config = getUserEnvir(".available.sources"), max.quant.config.schedule = 0, max.quant.scrape = 0, time2scrape.source = 30, source.filenames = NULL, retry.scrape = FALSE, logger = lgr)scrapePolyhedraSources(sources.config = getUserEnvir(".available.sources"), max.quant.config.schedule = 0, max.quant.scrape = 0, time2scrape.source = 30, source.filenames = NULL, retry.scrape = FALSE, logger = lgr)
sources.config |
the sources that will be used by the function |
max.quant.config.schedule |
number of files to schedule |
max.quant.scrape |
number of files scrape |
time2scrape.source |
time applied to scrape source |
source.filenames |
if not null specify which source filenames to scrape |
retry.scrape |
should it retry scrape? |
logger |
logger for inheriting threshold from calling class/function |
polyhedra db object
Prompts user for changing database to fulldb in user filespace. Also, allows the user to switch back to the package database, which is a minimal one for testing purposes.
switchToFullDatabase(env = NA, logger = lgr)switchToFullDatabase(env = NA, logger = lgr)
env |
The environment to run on, can be PACKAGE, |
logger |
logger for inheriting threshold from calling class/function HOME or NA. If NA, it asks the user for a an Environment. |
.data.env