new SunPath3D( [config])
Creates a new 3D WebGL Sun-path diagram instance.
Parameters:
| Name | Type | Argument | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object |
<optional> |
An optional configuration object. |
||||||||||||
Properties of
|
|||||||||||||||
| Name | Type | Argument | Description |
|---|---|---|---|
sunPos |
PD.SolarPosition |
<optional> |
An optional solar position calculator to use. |
detailed |
boolean |
<optional> |
A static diagram sits over the whole model and does not move with the current level. |
Extends
- THREE.Group
Members
-
:boolean
detailed
-
A static diagram sits over the whole model and does not move with the current level.
Type
- boolean
-
:THREE.LineSegments
linesAnnualPaths
-
The line segment mesh displaying monthly Sun-path lines.
Type
- THREE.LineSegments
-
:THREE.LineSegments|null
linesBaseDiagram
-
The line segment mesh displaying the base diagram.
Type
- THREE.LineSegments | null
-
:THREE.LineSegments
linesDailyPath
-
The line segment mesh displaying the daily Sun-path line.
Type
- THREE.LineSegments
-
:THREE.LineSegments
linesSunDirection
-
The line segment mesh displaying an arrow directly at the Sun.
Type
- THREE.LineSegments
-
:THREE.Mesh
meshAnnualPathRange
-
The surface mesh showing the sky area the sun passes through over the year.
Type
- THREE.Mesh
-
:THREE.Mesh
meshBaseDiagram
-
The surface mesh showing the angles and tick lines around the base diagram.
Type
- THREE.Mesh
-
:THREE.Mesh
meshSunPosition
-
The surface mesh for a small sphere displaying the position of the Sun.
Type
- THREE.Mesh
-
:boolean
showCurrentSunPosition
-
Determines visibility of the current sun position indicators.
Type
- boolean
-
:PD.SolarPosition
sunPos
-
An internal solar position calculator, defaults to null.
When this property is
null, the shared static solar position calculator provided byPD.SunPathManagerwill be used. If assigned its own solar position calculator instance, that will be used to scale, translate and rotate its meshes into position rather than reflecting current site conditions.If you set this property anytime after creating the Sun-path diagram, make sure you call the
PD.SunPath3D#rebuildmethod to instantiate any changes.Type
Methods
-
createExportableMesh(exporter)
-
Creates a new
THREE.Meshinstance that is better suited for export using standard THREE.JS exporters.This method is detected and used by the
PD.File.exportGeometrymethod to replace this object with the returned mesh when exporting the model.SunPath3D instances are not well suited for direct export via THREE as they share multiple static meshes and a custom shader that discards any geometry that falls below the Z=0 plane. As no standard geometry export formats support custom GLSL shaders, a direct export will include the entire uncut geometry.
As a result, this method creates a set of new geometry that manually trim away any geometry below the Z=0 plane. This means creating new buffer attributes for the freshly trimmed geometry and associating it with new exportable material definitions that match the custom shader.
Parameters:
Name Type Description exporterPD.File.ExportOptions The exporter settings.
Returns:
Returns a new mesh that can be exported.
- Type
- THREE.Mesh | null
-
dispose()
-
Cleans up the sun-path and removes all event listeners.
NOTE: Only call this method when the sun-path is no longer needed and you wish to free all its resources.
-
rebuild()
-
Performs a complete update of the diagram.
This method updates the diagram to reflect the current date, time and location. As the diagram is composed of multiple meshes that are rotated, translated and scaled into place, the actual updating does not required much overhead at all.
Returns:
Returns this Sun-path instance to support method chaining.
- Type
- PD.SunPath3D
-
set(config)
-
Sets the date/time/location of the Sun-path diagram and updates it.
Parameters:
Name Type Description confignumber A configuration object.
Properties of
config:Name Type Argument Description latitudenumber <optional>
An optional terrestrial latitude, in decimal degrees (-90 to 90).
longitudenumber <optional>
An optional terrestrial longitude, in decimal degrees (-180 to 180).
timezonenumber <optional>
An optional local time zone at the location, in decimal hours (-14 to +14).
northAnglenumber <optional>
An optional angle between North and the +Y axis, clockwise in decimal degrees (-180 to 180).
dayOfYearnumber <optional>
The ordinal index of the day of the year (0 - 364/365).
timeOfDaynumber <optional>
The time of day in decimal hours (0 - 24).
Returns:
Returns this Sun-path manager to support method chaining.
- Type
- PD.SunPath3D
-
setDateTime(dateTime)
-
Sets the date/time of the Sun-path diagram and updates it.
Parameters:
Name Type Description dateTimePD.DateTime | object A date/time configuration object.
Properties of
dateTime:Name Type Argument Description dayOfYearnumber <optional>
The ordinal index of the day of the year (0 - 364/365).
timeOfDaynumber <optional>
The time of day in decimal hours (0 - 24).
Returns:
Returns this Sun-path instance to support method chaining.
- Type
- PD.SunPath3D
-
setLocation(location)
-
Sets the location of the Sun-path diagram and updates it.
Parameters:
Name Type Description locationPD.Location | object A location configuration object.
Properties of
location:Name Type Argument Description latitudenumber <optional>
An optional terrestrial latitude, in decimal degrees (-90 to 90).
longitudenumber <optional>
An optional terrestrial longitude, in decimal degrees (-180 to 180).
timezonenumber <optional>
An optional local time zone at the location, in decimal hours (-14 to +14).
northAnglenumber <optional>
An optional angle between North and the +Y axis, clockwise in decimal degrees (-180 to 180).
Returns:
Returns this Sun-path manager to support method chaining.
- Type
- PD.SunPath3D
-
updateOnDateChange()
-
Update the daily Sun-path line whenever the date changes.
-
updateOnLocationChange()
-
Update the main diagram whenever the site location or north offset angle changes.
-
updateOnTimeChange()
-
Update the Sun position indicator whenever the time changes.