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.4 |
Built: | 2024-08-19 05:33:39 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
Scrapes all polyhedra in data folder to save a representation which
is accessible by the final users upon call to getPolyhedron()
.
version
version of database file
polyhedra.rds.file
path of rds database file
sources.config
Sources configuration for scraping different sources
ledger
rr ledger of scraping process
logger
class 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)
source
source description
boolean value
addSourceConfig()
add source.config to the database
PolyhedraDatabase$addSourceConfig(source.config)
source.config
SourceConfig 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)
source
source description
polyhedron.name
polyhedron description
boolean value
getPolyhedraSourceDir()
gets polyhedra sources folder
PolyhedraDatabase$getPolyhedraSourceDir(source, create.dir = TRUE)
source
source description
create.dir
if 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)
source
source description
polyhedron.name
polyhedron description
extension
extension 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 )
source
source description
polyhedron.name
polyhedron description
strict
halts 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 )
source
source description
source.filename
filename of the polyhedron source definition
polyhedron
polyhedron object
overwrite
overwrite exiting definition
save.on.change
saves 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.config
source configuration for scraping files
source.filenames
filenames of the polyhedron source definition
max.quant
maximum filenames to process
save.on.change
saves Database state after operation
Modified 'PolyhedraDatabase' object.
saveRDS()
saveRDS
PolyhedraDatabase$saveRDS(save.on.change = TRUE)
save.on.change
saves 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 )
mode
covering mode. Available values are "scrape.queued", "scrape.retry","skipped", "test"
sources
sources names
covering.code
code for applying in covering
polyhedra.names
polyhedra names to cover (optional)
max.quant
maximum numbers of polyhedra to cover
save.on.change
saves Database state after operation
seed
seed 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 )
mode
covering mode. Available values are "scrape.queued", "scrape.retry","skipped", "test"
sources
sources names
max.quant
maximum numbers of polyhedra to cover
time2scrape.source
maximum time to spend scraping each source
save.on.change
saves Database state after operation
skip.still.queued
Flag unscraped files with status 'skipped“
covering.code
code for applying in covering
polyhedra.names
polyhedra names to cover (optional)
A list with resulting objects covered
testRR()
testRR
PolyhedraDatabase$testRR(sources = names(self$sources.config), max.quant = 0)
sources
sources names
max.quant
maximum 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 )
sources
sources names
polyhedra.names
polyhedra names to cover (optional)
TestTaskClass
an R6 TestTaskClass class
max.quant
maximum 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.config
sources configurations for scraping files
source.filenames
filenames of the polyhedron source definition
max.quant
maximum filenames to process
save.on.change
saves 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 )
sources
sources names
search.string
string for matching polyhedron names
ignore.case
ignore 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)
deep
Whether to make a deep clone.
Polyhedron container class, which is accessible by the final users upon call
file.id
Polyhedron file.id
state
Polyhedron state
logger
class logger
new()
Create a polyhedronState object
Polyhedron$new(file.id, state = NULL)
file.id
the file id
state
polyhedron state object
A new Polyhedron object.
scrapeNetlib()
scrape Netlib polyhedron definition
Polyhedron$scrapeNetlib(netlib.p3.lines)
netlib.p3.lines
vector with netlib definition lines
A new PolyhedronStateDefined object.
scrapeDmccooey()
scrape Dmccooey polyhedron definition
Polyhedron$scrapeDmccooey(polyhedra.dmccooey.lines)
polyhedra.dmccooey.lines
vector with Dmccooey definition lines
A new PolyhedronStateDefined object.
deserialize()
deserialize a polyhedron state definition
Polyhedron$deserialize(serialized.polyhedron)
serialized.polyhedron
a 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.matrix
transformation 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.vertices
expected vertices number
expected.faces
expected faces number
Unmodified polyhedron object
clone()
The objects of this class are cloneable with this method.
Polyhedron$clone(deep = FALSE)
deep
Whether to make a deep clone.
ken4rab
This abstract class provide the basis from which every polyhedron state class derivate.
source
polyhedron definition source
file.id
polyhedron file id
errors
Errors string
logger
class logger
new()
Create a polyhedronState object
PolyhedronState$new(source, file.id)
source
the source file
file.id
the 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.error
the 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.matrix
the transformation matrix to apply to the polyhedron
buildRGL()
Creates a 'rgl' representation of the object
PolyhedronState$buildRGL(transformation.matrix)
transformation.matrix
the 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)
deep
Whether to make a deep clone.
ken4rab
Polyhedron State scraped and defined
Rpolyhedra::PolyhedronState
-> PolyhedronStateDefined
file.id
polyhedron filename in original
source
polyhedron definition source (netlib|dmccooey)
name
polyhedron name (netlib|dmccooey)
symbol
the eqn(1) input for two symbols separated by a tab; the Johnson symbol, and the Schlafli symbol (netlib)
dual
the name of the dual polyhedron optionally followed by a horizontal tab and the number of the dual (netlib)
sfaces
polyhedron solid face list (netlib)
svertices
polyhedron solid vertices list (netlib)
vertices
Polyhedron vertices list (netlib|dmccooey)
vertices.centered
centered vertices for applying transformation matrices
net
polyhedron 2D net model with vertices defined for a planar representation (netlib)
solid
polyhedron list of edges which generate a solid (netlib|dmccooey)
hinges
Polyhedron hinge list (netlib)
dih
Dih attribute (netlib)
edges
polyhedron edges (netlib|dmccooey)
transformation.matrix
transformation 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 )
source
the library to use
file.id
identifier of the definition file.
name
the polyhedron name
vertices
the vertices
solid
the solid object
net
the net
symbol
the symbol
dual
whether it is dual or not
sfaces
the solid faces
svertices
the solid vertices
hinges
the hinges
dih
the dih
normalize.size
whether 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
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.size
whether it has to normalize the size or not
modified PolyhedronStateDefined object.
getVertices()
Get the polyhedron state
PolyhedronStateDefined$getVertices(solid = FALSE)
solid
toggles 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.recalculation
forces the recalculation of the edges
checkEdgesConsistency()
Checks edges consistency
PolyhedronStateDefined$checkEdgesConsistency()
triangulate()
Triangulates the polyhedron
PolyhedronStateDefined$triangulate(force = FALSE)
force
forces the triangulation.
getConvHull()
Gets the convex hull
PolyhedronStateDefined$getConvHull( transformation.matrix = self$transformation.matrix, vertices.id.3d = private$vertices.id.3d )
transformation.matrix
the transformation matrix
vertices.id.3d
the vertices ids
the convex hull
calculateMassCenter()
Calculates the center of mass.
PolyhedronStateDefined$calculateMassCenter( vertices.id.3d = private$vertices.id.3d, applyTransformation = TRUE )
vertices.id.3d
the vertices ids
applyTransformation
does it need to apply transformations?
getNormalizedSize()
Gets the normalized size
PolyhedronStateDefined$getNormalizedSize(size)
size
the object's size
getTransformedVertices()
Gets the transformed vertices
PolyhedronStateDefined$getTransformedVertices( vertices = self$vertices.centered, transformation.matrix = self$transformation.matrix )
vertices
input vertices
transformation.matrix
the transformation matrix
resetTransformationMatrix()
Resets the transformation matrix
PolyhedronStateDefined$resetTransformationMatrix()
applyTransformationMatrix()
Apply transformation matrix to polyhedron
PolyhedronStateDefined$applyTransformationMatrix(transformation.matrix)
transformation.matrix
the transformation matrix to apply to the polyhedron
an applied transformation.matrix
buildRGL()
Build 'rgl'
PolyhedronStateDefined$buildRGL(transformation.matrix = NULL)
transformation.matrix
the transformation matrix
exportToXML()
Exports the object to XML format
PolyhedronStateDefined$exportToXML()
expectEqual()
Determines if a polyhedron is equal to this one.
PolyhedronStateDefined$expectEqual(polyhedron)
polyhedron
the 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)
deep
Whether to make a deep clone.
ken4rab
Polyhedron state for deserialize from database
Rpolyhedra::PolyhedronState
-> PolyhedronStateDeserializer
serialized.polyhedron
polyhedron 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.polyhedron
a 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)
deep
Whether to make a deep clone.
ken4rab
Scrapes polyhedra from a dmccooey file format
Rpolyhedra::PolyhedronState
-> PolyhedronStateDmccooeyScraper
regexp.values.names
regexp for scraping values names
regexp.rn
regexp for scraping real numbers
regexp.values
regexp for scraping values
regexp.vertex
regexp for scraping vertices
regexp.faces
regexp for scraping faces
polyhedra.dmccooey.lines
dmccooey polyhedra definition lines
labels.map
labels map where values are
values
labels map where values are
vertices
specification
vertices.replaced
3D values
faces
definition
new()
Initialize Dmccooey scraper
PolyhedronStateDmccooeyScraper$new(file.id, polyhedra.dmccooey.lines)
file.id
identifier of the definition file.
polyhedra.dmccooey.lines
raw 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.lines
values definitions in Dmccooey source
This PolyhedronStateDmccooeyScraper object with values defined.
scrapeVertices()
scrape polyhedron vertices from definition
PolyhedronStateDmccooeyScraper$scrapeVertices(vertices.lines)
vertices.lines
vertices definitions in Dmccooey source
This PolyhedronStateDmccooeyScraper object with faces defined.
scrapeFaces()
scrape polyhedron faces from definition
PolyhedronStateDmccooeyScraper$scrapeFaces(faces.lines)
faces.lines
face
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.matrix
the transformation matrix to apply to the polyhedron
buildRGL()
Creates a 'rgl' representation of the object
PolyhedronStateDmccooeyScraper$buildRGL(transformation.matrix)
transformation.matrix
the 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)
deep
Whether to make a deep clone.
ken4rab
Scrapes polyhedra from a PHD file format.
Rpolyhedra::PolyhedronState
-> PolyhedronStateNetlibScraper
netlib.p3.lines
The path to the PHD files
labels.rows
Labels - row of appearance
labels.map
Labels - Map of content
errors
the errors found
new()
Initializes the object, taking the file.id and PDH file as parameters
PolyhedronStateNetlibScraper$new(file.id, netlib.p3.lines)
file.id
the file id
netlib.p3.lines
the 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.number
the label number
expected.label
the 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.txt
a vector containing net model in netlib format
offset
in numbering vertices
a list containing a net model
extractCFOutBrackets()
Remove brackets for current field content
PolyhedronStateNetlibScraper$extractCFOutBrackets(x)
x
a string containing brackets
value
scrapeVertices()
scrape vertices described in netlib format
PolyhedronStateNetlibScraper$scrapeVertices(vertices.txt)
vertices.txt
vector containing netlib format vertices
data.frame containing netlib vertices
setupLabelsOrder()
setupLabelsOrder
PolyhedronStateNetlibScraper$setupLabelsOrder()
vertices.txt
vector containing netlib format vertices
data.frame containing netlib vertices
getDataFromLabel()
Get data from label specified as parameter
PolyhedronStateNetlibScraper$getDataFromLabel(label)
label
the 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.matrix
the transformation matrix to apply to the polyhedron
buildRGL()
Creates a 'rgl' representation of the object
PolyhedronStateNetlibScraper$buildRGL(transformation.matrix)
transformation.matrix
the 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)
deep
Whether 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