IdfGeometry | R Documentation |
IdfGeometry
is an abstraction of a collection of geometry in an Idf. It
provides more detail methods to query geometry properties, update geometry
vertices and visualize geometry in 3D using the
rgl package.
idf_geometry(parent, object = NULL)
parent |
A path to an IDF file or an Idf object. |
object |
A character vector of valid names or an integer
vector of valid IDs of objects to extract. If |
An IdfGeometry
object.
new()
Create an IdfGeometry
object
IdfGeometry$new(parent, object = NULL)
parent
A path to an IDF file or an Idf object.
object
A character vector of valid names or an integer
vector of valid IDs of objects to extract. If NULL
, all
objects in geometry classes will be extracted.
An IdfGeometry
object.
\dontrun{ # example model shipped with eplusr from EnergyPlus v8.8 path_idf <- system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr") # v8.8 # create from an Idf object idf <- read_idf(path_idf, use_idd(8.8, "auto")) geom <- idf$geometry() geom <- IdfGeometry$new(idf) # create from an IDF file geom <- idf_geometry(path_idf) geom <- IdfGeometry$new(path_idf) }
parent()
Get parent Idf object
IdfGeometry$parent()
$parent()
returns the parent Idf object of current IdfGeometry
object.
An Idf object.
\dontrun{ geom$parent() }
rules()
Get global geometry rules
IdfGeometry$rules()
$rules()
returns global geometry rules.
An Idf object.
\dontrun{ geom$rules() }
convert()
Convert simple geometry objects
IdfGeometry$convert(type = c("surface", "subsurface", "shading"))
type
A character vector giving what types of simplified
geometries should be converted. Should be a subset of
"surface"
, "subsurface"
and "shading"
. Default is set to
all of them.
EnergyPlus provides several classes that allow for simplified entry
of geometries, such as Wall:Exterior
, Window
and etc.
$convert()
will generate detailed vertices from simplified geometry
specifications and replace the original object with its corresponding
detailed class, including:
BuildingSurface:Detailed
FenestrationSurface:Detailed
Shading:Site:Detailed
Shading:Building:Detailed
Shading:Zone:Detailed
The modified Idf object.
\dontrun{ geom$convert() }
coord_system()
Convert vertices to specified coordinate systems
IdfGeometry$coord_system(detailed = NULL, simple = NULL, daylighting = NULL)
detailed, simple, daylighting
A string specifying the coordinate
system for detailed geometries, simple (rectangular surface)
geometries, and daylighting reference points. Should be one of
"relative"
, "world"
and "absolute"
. "absolute"
is the
same as "world"
and converted to it.
$coord_system()
converts all vertices of geometries into specified
coordinate systems, e.g. from world to relative, and vice versa.
Besides, it also updates the GlobalGeometryRules
in parent Idf
accordingly.
The modified Idf object.
\dontrun{ geom$coord_system("world", "world", "world") }
round_digits()
Round digits on geometry vertices
IdfGeometry$round_digits(digits = 4L)
digits
An integer giving the number of decimal places to be
used. Default: 4
.
$round_digits()
performs number rounding on vertices of detailed
geometry object vertices, e.g. BuildingSurface:Detailed
,
FenestrationSurface:Detailed
and etc.
$round_digits()
may be useful for clean up IDF files generated
using OpenStudio which often gives vertices with long trailing
digits.
The modified Idf object.
\dontrun{ geom$round_digits() }
area()
Get area
IdfGeometry$area(class = NULL, object = NULL, net = FALSE)
class
A character vector of valid geometry class names.
Default: NULL
.
object
A character vector of valid names or an integer
vector of valid IDs of targeting objects.
Default: NULL
.
net
If TRUE
, the gross area is returned. If FALSE
, the net
area is returned. Default: FALSE
.
$area()
returns the area of surfaces in square meters.
A data.table::data.table()
of 6 columns:
id
: Integer type. Object IDs.
name
: Character type. Object names.
class
: Character type. Class names.
zone
: Character type. Zone names that specified objects belong to.
space
: Character type. Space names that specified objects belong to.
type
: Character type. Surface types.
area
: Numeric type. Surface Area in m2.
\dontrun{ geom$area() }
azimuth()
Get azimuth
IdfGeometry$azimuth(class = NULL, object = NULL)
class
A character vector of valid geometry class names.
Default: NULL
.
object
A character vector of valid names or an integer
vector of valid IDs of targeting objects.
Default: NULL
.
$azimuth()
returns the azimuth of surfaces in degree.
A data.table::data.table()
of 6 columns:
id
: Integer type. Object IDs.
name
: Character type. Object names.
class
: Character type. Class names.
zone
: Character type. Zone names that specified objects belong to.
space
: Character type. Space names that specified objects belong to.
type
: Character type. Surface types.
azimuth
: Numeric type. Azimuth in degree.
\dontrun{ geom$azimuth() }
tilt()
Get tilt
IdfGeometry$tilt(class = NULL, object = NULL)
class
A character vector of valid geometry class names.
Default: NULL
.
object
A character vector of valid names or an integer
vector of valid IDs of targeting objects.
Default: NULL
.
$tilt()
returns the tilt of surfaces in degree.
A data.table::data.table()
of 6 columns:
id
: Integer type. Object IDs.
name
: Character type. Object names.
class
: Character type. Class names.
zone
: Character type. Zone names that specified objects belong to.
space
: Character type. Space names that specified objects belong to.
type
: Character type. Surface types.
tilt
: Numeric type. Azimuth in degree.
\dontrun{ geom$tilt() }
view()
View 3D geometry
IdfGeometry$view( new = FALSE, render_by = "surface_type", wireframe = TRUE, x_ray = FALSE, axis = TRUE )
new
If TRUE
, a new rgl window will be open using
rgl::open3d()
. If FALSE
, existing rgl window will be
reused if possible. Default: FALSE
.
render_by
A single string specifying the way of rendering the geometry. Possible values are:
"surface_type"
: Default. Render the model by surface type model.
Walls, roofs, windows, doors, floors, and shading surfaces will
have unique colors.
"boundary"
: Render the model by outside boundary condition. Only
surfaces that have boundary conditions will be rendered with a
color. All other surfaces will be white.
"construction"
: Render the model by surface constructions.
"zone"
: Render the model by zones assigned.
"space"
: Render the model by spaces assigned.
"normal"
: Render the model by surface normal. The outside face of
a heat transfer face will be rendered as white and the inside face
will be rendered as red.
wireframe
If TRUE
, the wireframe of each surface will be
shown. Default: TRUE
.
x_ray
If TRUE
, all surfaces will be rendered translucently.
Default: FALSE
.
axis
If TRUE
, the X, Y and Z axes will be drawn at the
global origin. Default: TRUE
.
$view()
uses the rgl
package to visualize the IDF geometry in 3D in a similar way as
OpenStudio.
$view()
returns an IdfViewer object which can be used to further
tweak the viewer scene.
In the rgl window, you can control the view using your mouse:
Left button: Trackball
Right button: Pan projection.
Wheel: Zoom
For more detailed control on the scene, see IdfViewer.
An IdfViewer object
\dontrun{ idf$view() idf$view(render_by = "zone") idf$view(new = TRUE, render_by = "construction") }
print()
Print an IdfGeometry
object
IdfGeometry$print()
The IdfGeometry
itself, invisibly.
\dontrun{ geom$print() }
Hongyuan Jia
Idf class
## ------------------------------------------------
## Method `IdfGeometry$new`
## ------------------------------------------------
## Not run:
# example model shipped with eplusr from EnergyPlus v8.8
path_idf <- system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr") # v8.8
# create from an Idf object
idf <- read_idf(path_idf, use_idd(8.8, "auto"))
geom <- idf$geometry()
geom <- IdfGeometry$new(idf)
# create from an IDF file
geom <- idf_geometry(path_idf)
geom <- IdfGeometry$new(path_idf)
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$parent`
## ------------------------------------------------
## Not run:
geom$parent()
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$rules`
## ------------------------------------------------
## Not run:
geom$rules()
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$convert`
## ------------------------------------------------
## Not run:
geom$convert()
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$coord_system`
## ------------------------------------------------
## Not run:
geom$coord_system("world", "world", "world")
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$round_digits`
## ------------------------------------------------
## Not run:
geom$round_digits()
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$area`
## ------------------------------------------------
## Not run:
geom$area()
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$azimuth`
## ------------------------------------------------
## Not run:
geom$azimuth()
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$tilt`
## ------------------------------------------------
## Not run:
geom$tilt()
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$view`
## ------------------------------------------------
## Not run:
idf$view()
idf$view(render_by = "zone")
idf$view(new = TRUE, render_by = "construction")
## End(Not run)
## ------------------------------------------------
## Method `IdfGeometry$print`
## ------------------------------------------------
## Not run:
geom$print()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.