Provides tools and utilities to support building modelling and analysis.
The PD namespace forms the core infrastructure for any interactive application that displays, edits and/or interacts with the BIM classes. It provides global state, actions, events and undo/redo, as well as a wide range of utilities for working with WebGL and front-end frameworks such as Vue, React, Knockpout and Enyo. It also provides a range of fundamental geometry creation, mesh generation, scene visualisation and user interaction management tools.
Classes
- Animation
- AxisArray
- BRep
- Base
- CAD
- CSG
- Calculate
- CalculateOnIdle
- Capsule
- ClipPt2D
- Clipboard
- Clipper
- ConnectionData
- Cursor
- Cursors
- Curve
- DateTime
- DateTimeIterator
- DateTimeRange
- DaySchedule
- Dimensions
- Easing
- Enumerator
- EnumeratorMap
- EquationParser
- EventDispatcher
- File
- Font
- GlobalActions
- GlobalEvents
- GlobalState
- GlobalUndo
- GlobalView
- Grid2D
- GridCell
- GridLines
- GridMesh
- HUDController
- HUDItem
- IndexDB
- Indexer
- Interaction
- InteractionEvent
- Interactive
- Legend
- LineFont
- LineMesh
- LocalCoordinates
- LocalDB
- Location
- MatrixArray
- MeshBuilder
- MeshFactory
- ModelManager
- Mouse
- MouseArrow
- NURBSSurface
- NurbsSurfaceArray
- OCC
- Occlusion
- Octree
- OctreeHelper
- OctreeNode
- ParamGroup
- ParamType
- Parameter
- Path
- PathPoint
- PerezSky
- PlaneArray
- Point
- PolyMesh
- Polygon
- Polyhedron
- Polyline
- PouchDB
- QuaternionArray
- RandomNumberCache
- RectMesh
- Registry
- Rotator
- SVG
- ScaledVector
- SceneEditor
- SceneManager
- SceneViewer
- Schedule
- Selection
- SelectionFrustum
- SelectionHandler
- SelectionManager
- SelectionMap
- SelectionSet
- Shading
- ShadowPlane
- Shape
- Shell
- SkyDome
- Snapper
- SolarPosition
- Solid
- SphericalOcclusion
- SunPath2D
- SunPath3D
- SunPathManager
- Tesselator
- Text
- ThickLineMesh
- ThrottledCallback
- TimeZones
- Triangle
- UndoAction
- UndoActions
- UndoObject
- Units
- UserModeHandler
- Utils
- VectorArray
- VectorFont
- Vertex
- Video
- View
- ViewAngles
- ViewController
- ViewData
- ViewOrbital
- VolumeArray
- WeatherData
Members
-
ALIGN <static, readonly>
-
Defines a set of positional alignment values.
These values are also bit-wise flags that can be used in bit operations. As a result, this object provides a number of methods to check components of a value for just the horizontal (left, center, right) or vertical (bottom, middle, top) components.
Properties:
Name Type Default Description NONEnumber 0 No alignment, use absolute positioning.
LEFTnumber 1 Horizontally align item to the left.
CENTERnumber 2 Horizontally align item to center.
RIGHTnumber 4 Horizontally align item to the right.
BOTTOMnumber 8 Vertically align item to bottom extent.
MIDDLEnumber 16 Vertically align item to middle.
TOPnumber 32 Vertically align item to top extent.
BOT_LEFTnumber 9 Align item to bottom-left corner.
Contains bit flags for
BOTTOMandLEFT.BOT_CENTERnumber 10 Align item to bottom-center edge.
Contains bit flags for
BOTTOMandCENTER.BOT_RIGHTnumber 12 Align item to bottom-right corner.
Contains bit flags for
BOTTOMandRIGHT.MID_LEFTnumber 17 Align item to middle-left edge.
Contains bit flags for
MIDDLEandLEFT.MID_CENTERnumber 18 Align item to middle-center point.
Contains bit flags for
MIDDLEandCENTER.MID_RIGHTnumber 20 Align item to middle-right edge.
Contains bit flags for
MIDDLEandRIGHT.TOP_LEFTnumber 33 Align item to top-left corner.
Contains bit flags for
TOPandLEFT.TOP_CENTERnumber 34 Align item to top-center edge.
Contains bit flags for
TOPandCENTER.TOP_RIGHTnumber 36 Align item to top-right corner.
Contains bit flags for
TOPandRIGHT.isTopfunction Determines if the given alignment contains the TOP bit flag.
isMiddlefunction Determines if the given alignment contains the MIDDLE bit flag.
isBottomfunction Determines if the given alignment contains the BOTTOM bit flag.
isLeftfunction Determines if the given alignment contains the LEFT bit flag.
isCenterfunction Determines if the given alignment contains the CENTER bit flag.
isRightfunction Determines if the given alignment contains the RIGHT bit flag.
computeFromUVfunction Compute alignment from relative fractional UV coordinates.
_UPPERnumber 64 For 3D application, refers to the maximum Z value.
_MIDWAYnumber 128 For 3D application, refers to the midway between minimum and maximum Z value.
isUpperfunction Determines if the Z-Axis alignment is UPPER.
useUpperfunction Determines if the given alignment contains the UPPER bit flag.
isMidwayfunction Determines if the given alignment contains the MIDWAY bit flag.
useMidwayfunction Determines if the given alignment contains the MIDWAY bit flag.
useLowerfunction Determines if the given alignment contains the MIDWAY bit flag.
getAsOptionListRetrieve enumerators as an array of {name, value} objects compatible with a
PD.ParamTypeoptions list.getParamTypefunction Retrieve a selectable enumerator list as a
PD.ParamTypefrom global cache. -
ANIMATION <static, readonly>
-
Enumerates the various states of an animation affecting an elements' geometry.
Properties:
Name Type Default Description DELETEDnumber -99 Indicates that an animation was present, but was recently deleted.
NONEnumber -1 Indicates that no animation is present.
PAUSEDnumber 0 Indicates that an animation present but paused.
PLAYINGnumber 1 Indicates that an animation is present and currently playing.
-
ATTRIB <static, readonly>
-
Enumerates some standard public/private attribute keys.
Attribute keys are used by the
attributemap on entities and points to locate stored data. The aim of using an attribute map instead of properties on the object is to both allow the end user to add arbitrary data to things in the model, and to allow objects to store dynamic data without affecting the low level shape of the object in the code optimiser.Any attribute key that starts with a '$' sign indicates private or volatile data that is not included when attributes are saved. All other keys are saved when converted to JSON.
Properties:
Name Type Default Description REF_POSstring $refPos Stores a reference position for an activity or animation.
This is used by
PD.Pointto store its original position just prior to an interactive transformation. It is also used byBIM.Levelto store the level's original starting position at the beginning of a dynamic animation.SELECTEDstring $selected Stores whether or not a point is in the current selection set.
JUNCTIONstring $junction Stores a parent junction that generated a point.
CURVE_IDstring $curveId Stores the ID of the curve that a point belongs to.
NORMALstring normal Stores a normal direction vector on a point.
TANGENTstring tangent Stores a tangent direction vector on a point.
BINORMALstring binormal Stores a binormal direction vector on a point.
UVstring uv Stores a UV texture coordinate on a point.
COLORstring color Stores a a colour value for a point.
ALIGNMENTstring alignment Stores the alignment of junction inner/outer boundaries relative to its path.
FIXED_NORMALstring $fixedNormal Stores whether or not the normal direction vector of a point is fixed so should not be set when calculating smooth normals.
APERTURE_CURVE_PATHstring $apertureCurvePath Stores a path that defines the shape of an aperture as it follows its host junction's curved path.
APERTURE_PATH_CACHEstring $aperturePathCache Stores a path point cache for regenerating an aperture's own path as it follows its host junction's curved path.
CONNECT_DATAstring $connectData Stores start/end connections between column/post/landing profiles.
VIRTUAL_JUNCTIONSstring $vrtJunctions Stores an array of virtual junctions added to a junction.
LINKED_JUNCTIONstring $trackJunction Stores a junction that is being tracked by another junction.
REL_POSstring relPos Stores the relative position of a control node in local junction coordinates.
SMOOTHstring smooth Stores the distance from the first/last junction to a control node.
WEIGHTstring weight Stores the relative weighting of a control node.
-
AXIS <static, readonly>
-
Enumerates the major cartesian axis.
This is different from the component indexes of coordinate arrays as it needs to differentiate between positive and negative directions in each axis.
Properties:
Name Type Default Description NONEnumber 0 No axis specified, or use the default.
X_POSnumber 1 The positive X-axis, or the YZ plane pointing towards +X (East).
X_NEGnumber -1 The negative X-axis, or the YZ plane pointing towards -X (West).
Y_POSnumber 2 The positive Y-axis, or the XZ plane pointing towards +Y (North).
Y_NEGnumber -2 The negative Y-axis, or the XZ plane pointing towards -Y (South).
Z_POSnumber 3 The positive Z-axis, or the XY plane pointing towards +Z (Up).
Z_NEGnumber -3 The negative Z-axis, or the XY plane pointing towards -Z (Down).
VECTORnumber 99 Indicates that a custom vector is used.
This value is typically only used by custom cursors to indicate that movement is restricted to a non-cartesian axis.
PERSPECTIVEnumber 100 Indicates a perspective view.
isXfunction Whether or not the given axis is either
X_POSorX_NEG.isYfunction Whether or not the given axis is either
Y_POSorY_NEG.isZfunction Whether or not the given axis is either
Z_POSorZ_NEG.isCartesianAxisfunction Whether or not the given axis is X, Y or Z.
isOrthoOrPerspectivefunction Whether or not the given axis is NONE or PERSPECTIVE.
isParallelfunction Whether or not the two axis are parallel (+/-).
getAsOptionListfunction Retrieve enumerators as an array of {name, value} objects compatible with a
PD.ParamTypeoptions list.getParamTypefunction Retrieve a selectable enumerator list as a
PD.ParamTypefrom global cache. -
CAP <static, readonly>
-
Enumerates the different extrusion end caps.
This value can also be used as bitwise flags to test for
TOPandBOTTOM. The static functionshasTop()andhasBottom()can be used for that, where a single value can be used to store none, either or both.Properties:
Name Type Default Description NONEnumber 0 Don't add a cap to the extrusion.
TOPnumber 1 Add a top cap to the extrusion.
BOTTOMnumber 2 Add a bottom cap to the extrusion.
BOTHnumber 3 Add a top and bottom cap to the extrusion.
hasTopfunction Determines if the given cap includes the TOP bit flag.
hasBottomfunction Determines if the given cap includes the BOTTOM bit flag.
-
:boolean
CLOSED <static>
-
An alias for
trueto make some polygon/polyline method calls more readable.Type
- boolean
-
CONDUCTIVITY <static, readonly>
-
Provides tools to convert between different thermal conductivity units.
Properties:
Name Type Default Description WATTS_PER_METRE_KELVINnumber 20 The identifier for watts per metre-Kelvin (W/(m-K)).
BTU_PER_HOUR_FOOT_FAHRENHEITnumber 21 The identifier for BTU per hour-foot-Fahrenheit (BTU/(h-ft-F)).
toWattsPerMetreKelvinfunction Converts a thermal conductivity value to watts per metre-kelvin (W/(m-K)).
fromWattsPerMetreKelvinfunction Converts a thermal conductivity value from watts per metre-kelvin (W/(m-K)).
convertBetweenfunction Converts a thermal conductivity value between the two given units.
getNamefunction Retrieves the name of the given specific volume units.
Based on the given units, this method returns one of the following string values: 'Cubic Meters per Kilogram' or 'Cubic Feet per Pound'.
getAbbrevfunction Retrieves the abbreviation of the given specific volume units.
Based on the given units, this method returns one of the following string values: 'W/(m-K)' or 'BTU/(h-ft-F)'.
getUnitsFromAbbrevfunction Retrieves the specific volume units identifier from the given abbreviation.
Parses the abbreviations 'W/(m-K)' or 'BTU/(h-ft-F)' into the appropriate unit ID,
-
CSG_OP <static>
-
The different types of constructive solid geometry to apply to shapes.
Properties:
Name Type Description UNIONnumber Union together all child masses into a single bounded volume.
SUBTRACTnumber Subtract the volume of each subsequent child mass from the first child mass.
INTERSECTnumber Intersect the volumes of each child mass to find the common volume.
-
CURSOR <static, readonly>
-
Enumerates the different cursor types.
Properties:
Name Type Default Description POINTnumber 0 Unrestricted movement in all 3 dimensions. Has a UV manipulator at the centre of the cursor and arrows in each of the +/-U, +/-V and +/-W directions. The plane of movement varies between UV, VW and UW based on the 3D view angle.
PLANEnumber 1 Movement is restricted to an arbitrary 3D plane. Has a UV manipulator at the centre of the cursor and arrows in each of the +/-U and +/-V directions.
VECTORnumber 2 Movement is restricted to an arbitrary 3D vector. Has arrows in only the +/-U directions.
RECTnumber 3 Used to edit the position, width and height of an arbitrarily oriented 3D rectangle. Movement is restricted to the plane of orientation of the rectangle. Has a UV manipulator at the centre of the cursor and arrows at the rectangle extents in the +/-U and +/-V directions to control width and height.
RECT_CORNERSnumber 4 Used to edit the position, width and height of an arbitrarily oriented 3D rectangle. Movement is restricted to the plane of orientation of the rectangle. Has a UV manipulator at the centre of the cursor and arrows at the rectangle extents in the +/-U and +/-V directions to control width and height.
BOXnumber 5 Used to edit the position, width, depth and height of an arbitrarily oriented 3D bounding box. Has a UV manipulator at the centre of the cursor and arrows at the bounding box extents in the +/-U, +/-V and+/- W directions to control width, depth and height. The position has unrestricted movement in all 3 dimensions and the plane of movement varies between UV, VW and UW based on the 3D view angle.
SECTIONnumber 6 Typically used to manipulate section planes. Movement is restricted to the 3D vector normal to the section plane. Has a single manipulator offset from the centre of the cursor, shaped as an architectural section symbol.
CAPTURE_ALLnumber 100 Typically used to capture and react to input from the entire scene canvas.
-
CURSOR_STYLE <static, readonly>
-
Enumerates the different cursor styles.
Properties:
Name Type Default Description IMAGEnumber -1 Use a texture atlas to display cursor manipulators.
LIGHTnumber 0 A white background with red outlines.
GRAYnumber 1 A dark gray background with white outlines.
DARKnumber 2 A black background with light gray outlines.
ORANGEnumber 3 A bright orange background with deep orange outlines.
DARK_ORANGEnumber 4 A transparent deep orange background with bright orange outlines.
LIGHT_REDnumber 5 A transparent light background with red outlines.
DARK_REDnumber 6 A transparent dark background with red outlines.
REDnumber 7 A red background with white outlines.
getAsOptionListfunction Retrieve cursor styles as a
PD.ParamTypeoptions list. -
CURVE <static, readonly>
-
Enumerates the various types of available curve.
Properties:
Name Type Default Description OFFSETnumber -1 Defines a curve that is offset from another curve.
Offset curves are typically created when an offset
PD.Pathis created from aBIM.Path.NONEnumber 0 Defines a straight line with no curvature.
ARCnumber 1 A circular curve that goes through the first control point.
QUADRATICnumber 2 A Quadratic Bezier curve that is governed by a single control point.
CUBICnumber 3 A Cubic Bezier curve that is governed by two control points.
NURBSnumber 4 A NURBS curve that passes through the midpoint of a line joining each control point.
-
DIMENSION <static, readonly>
-
Enumerates the different types of length dimension formats.
Properties:
Name Type Default Description DEFAULTnumber 0 Show default units.
METRIC_MMnumber 1 Show dimensions in integer millimeters.
METRIC_SInumber 2 Show dimensions in decimal meters.
IMPERIALnumber 3 Show dimensions in feet, inches and sixteenths.
_unitsPD.DIMENSION 1 Stores the preferred format for displaying dimensions.
useImperialboolean false Whether or not imperial dimensions are currently being used.
mmToMetresConverts a distance in millimetres to metres.
mm2ToMetres2Converts an area in square millimetres to square metres.
mm3ToMetres3Converts a volume in cubic millimetres to cubic metres.
metersToFeetConverts a distance in metres to decimal feet.
metersToInchesConverts a distance in metres to decimal inches.
metersToMillimetersConverts a distance in metres to millimetres.
feetToMetersConverts a distance in decimal feet to metres.
feetToMillimetersConverts a distance in decimal feet to mm.
feetToInchesConverts a distance in decimal feet to decimal inches.
inchesToMetersConverts a distance in decimal inches to metres.
inchesToMillimetersConverts a distance in decimal inches to mm.
inchesToFeetConverts a distance in decimal inches to decimal feet.
-
DISPLAY <static, readonly>
-
Enumerates the types of model display mode.
Properties:
Name Type Default Description FLOORPLANnumber 0 Displays detailed geometry with wall thickness and openings.
SPATIALnumber 1 Displays only the space volumes on the current level.
LEVELnumber 2 Display the current level as a 3D model with walls and openings.
BUILDINGnumber 3 Displays the whole building as a full 3D model.
_MAXnumber 3 The maximum allowed value.
toStringfunction Converts a display type value to a string identifier.
fromStringfunction Parses a string into a valid display type value.
-
DRAG_ACTION <static>
-
Enumerates different types of pointer button drag actions.
Each action also has an alternate mode set by holding down the SHIFT and CTRL|ALT|META keys when first clicking the pointer button in the canvas. The alternate mode for rotating and zooming it is adjusting the field of view, and for panning it is zooming in/out.
Once you have set the action or alternate mode, pressing any of the modifier keys will also change its magnitude, with SHIFT resulting in a larger speed/magnitude and CTRL|ALT|META a smaller speed/magnitude.
Properties:
Name Type Description NONEnumber Pointer button drag does not affect the view.
ROTATEnumber Rotates a 3D view, pans a 2D drawing (ALT: FieldOfViewAngle(3D)/pan).
ZOOMnumber Zooms 2D and 3D views (ALT: FieldOfViewAngle(3D)).
PANnumber Pans 2D and 3D views (ALT: Zoom/FieldOfViewAngle(3D)).
-
DRAWING_TYPE <static>
-
Enumerates the different types of architectural drawing.
For more information on the different types of architectural drawing, see: https://www.archtoolbox.com/construction-document-sheet-numbers/.
Properties:
Name Type Description GENERALnumber Contains explanatory notes, symbols and legends.
PLANnumber Orthographic views taken from above and looking down, typically sectioned.
ELEVATIONnumber Orthographic views taken from the side looking horizontally.
SECTIONnumber Cut-away views where part(s) of the model are hidden, typically orthographic.
BLOW_UPnumber Large scale drawings including plans, elevations and sections that are not details.
DETAILnumber CLose-up of a small section of the model, typically showing how component assembly.
SCHEDULEnumber Detailed listings of materials, components or costs associated with the model.
USERDEFINED_1number Available for (re)definition bu by the user.
USERDEFINED_2number Available for (re)definition bu by the user.
DRAWING_3Dnumber Three dimensional perspective and/or orthographic drawings, renderings or photographs.
NOT_DEFINEDnumber The type is not defined so derive from view settings.
-
EASING <static>
-
Enumerates the range of available easing methods.
You can access the easing methods directly via the
PD.Easingstatic class, or use thePD.EASING.getEasingMethodmethod using a name or ordinal index.See https://easings.net/ for a visual representation of these easing functions.
Properties:
Name Type Description LINEARnumber No easing or acceleration.
IN_SINEnumber Sine function accelerating from zero to one.
OUT_SINEnumber Sine function decelerating from one to zero.
IN_OUT_SINEnumber Sine function accelerating from zero to one halfway, then decelerating back to zero.
IN_OUT_SINE_POWnumber Sine function accelerating until halfway, then decelerating with a power function (Math.pow) applied.
IN_QUADnumber Quadratic function (t^2) accelerating from zero to one.
OUT_QUADnumber Quadratic function (t^2) decelerating from one to zero.
IN_OUT_QUADnumber Quadratic function (t^2) accelerating until halfway, then decelerating.
IN_CUBICnumber Cubic function (t^3) accelerating from zero to one.
OUT_CUBICnumber Cubic function (t^3) decelerating from one to zero.
IN_OUT_CUBICnumber Cubic function (t^3) accelerating until halfway, then decelerating.
IN_QUARTnumber Quartic function (t^4) accelerating from zero to one.
OUT_QUARTnumber Quartic function (t^4) decelerating from one to zero.
IN_OUT_QUARTnumber Quartic function (t^4) accelerating until halfway, then decelerating.
IN_QUINTnumber Quintic function (t^5) accelerating from zero to one.
OUT_QUINTnumber Quintic function (t^5) decelerating from one to zero.
IN_OUT_QUINTnumber Quintic function (t^5) accelerating until halfway, then decelerating.
IN_EXPOnumber Exponential function (2^t) accelerating from zero to one.
OUT_EXPOnumber Exponential function (2^t) decelerating from one to zero.
IN_OUT_EXPOnumber Exponential function (2^t) accelerating until halfway, then decelerating.
IN_CIRCnumber Circular function accelerating from zero to one.
OUT_CIRCnumber Circular function decelerating from one to zero.
IN_OUT_CIRCnumber Circular function accelerating until halfway, then decelerating.
IN_BACKnumber Function with a bit of over-run at start.
OUT_BACKnumber Function with a bit of over-run at end.
IN_OUT_BACKnumber Function with a bit of over-run at start and end.
IN_BOUNCEnumber Bounce function accelerating from zero to one.
OUT_BOUNCEnumber Bounce function decelerating from one to zero.
IN_OUT_BOUNCEnumber Bounce function accelerating until halfway, then decelerating.
IN_WOBBLEnumber Function with a bit of an elastic jelly wobble at the start.
OUT_WOBBLEnumber Function with a bit of an elastic jelly wobble at the end.
IN_OUT_WOBBLEnumber Function with a bit of an elastic jelly wobble at the start and end.
OUT_ELASTICnumber Function with a bit of an elastic bounce at the end.
-
ENDCAP <static, readonly>
-
Enumerates the various ways to terminate a thick line.
Properties:
Name Type Default Description CLOSEDnumber 0 Join the end of the line back up with the start.
FLATnumber 1 Start/end the line flush with the start/end points.
SQUAREnumber 2 Project the start/end points out by half the width of the line.
TRIANGLEnumber 3 Add a 45 degree triangle to the end of the line.
ROUNDnumber 4 Add a semi-circle at each end with the same diameter as the line width.
-
ENTHALPY <static>
-
Provides tools to convert between enthalpy units.
The available enthalpy unit types are:
PD.ENTHALPY.JOULES_PER_KILOGRAM,PD.ENTHALPY.KILO_JOULES_PER_KILOGRAMandPD.ENTHALPY.BTU_PER_POUND.Properties:
Name Type Default Description JOULES_PER_KILOGRAMnumber 0 The identifier for Joules per kilogram (J/kg).
KILO_JOULES_PER_KILOGRAMnumber 1 The identifier for kilo-Joules per kilogram (kJ/kg).
BTU_PER_POUNDnumber 2 The identifier for British thermal units per pound (Btu/lb).
toJoulesPerKilogramConverts an enthalpy value to joules per kilogram (J/kg).
fromJoulesPerKilogramConverts an enthalpy value from joules per kilogram (J/kg).
convertBetweenfunction Converts an enthalpy value between the two given units.
getNamefunction Retrieves the name of the given enthalpy units.
Based on the given units, this method returns one of the following string values: 'Joules per Kilogram', 'kilo-Joules per Kilogram' or 'Btu per Pound'.
getAbbrevRetrieves the abbreviation of the given enthalpy units.
Based on the given units, this method returns one of the following string values: 'J/kg', 'kJ/kg' or 'Btu/lb'.
getUnitsFromAbbrevRetrieves the enthalpy units identifier from the given abbreviation.
Interprets the abbreviations 'J/kg', 'kJ/kg' or 'Btu/lb' into the identifiers
PD.ENTHALPY.JOULES_PER_KILOGRAM | KILO_JOULES_PER_KILOGRAM | BTU_PER_POUND. -
EVENT <static, readonly>
-
The different types of core events that can occur.
Events provide an arms-length way that the NLB Framework can communicate with custom classes and the user interface of its host application. It prevents framework data from being directly exposed to any bi-directional reactivity that the UI may use, whilst allowing the UI itself to pick and choose which events it will respond to.
It is important to note that this static class defines all of the core events used within the framework. Some of these will be global events that are broadcast by the static
PD.GlobalEventsclass, whilst some will be specific to a particular scene viewer or editor. The description of each event type should indicate whether it is a global event or not.Properties:
Name Type Default Description DARK_MODEstring !pd-darkMode A global event invoked when the applications colour theme changes.
This event is invoked whenever the user changes the app color theme between light and dark. This is typically done using the navigation bar dro-down menu, but it may also be called by a dynamic script.
The event handler is called with a single boolean argument, indicating whether or not the dark mode theme is now active.
DIMENSION_UNITSstring !pd-dimUnits A global event invoked when the preferred dimension units change.
This event occurs whenever the display units are changed between imperial and metric meters of millimeters. It is an opportunity for the UI to update any displayed values with the newly selected units.
The event handler is called with two arguments, the first being the newly selected numeric
PD.DIMENSION.unitsvalue and the second being a boolean flag indicating that dimensions changed to/from imperial. This flag is useful as surface area and volume calculations don't change between SI and MM, but do when switching between either of those and imperial.SITE_LOCATIONstring !pd-siteLoc A global event invoked when the site location is changed.
This event is invoked whenever the site latitude, longitude, timezone or north angle values change. It is an opportunity for the UI to update any visible location data. This event is always followed by a
SUN_POSITIONevent as the location change will invariable also affect the calculated sun position.The event handler is called with a single
PD.Locationargument.WEATHER_DATAstring !pd-weatherData A global event invoked when new weather data is loaded.
This event is invoked whenever the user loads new weather data. It is an opportunity for the UI to update any visible weather or station ID data. This event may also be followed by a
SITE_LOCATIONandSUN_POSITIONevent if the location changes as well.The event handler is called with a single
PD.WeatherDataargument.SUN_POSITIONstring !pd-sunPos A global event invoked when the current solar position changes.
This event is invoked whenever any of the date, time or location values change. It is an opportunity for the UI (as well as custom shadow, analysis and element classes) to react to date, time and location changes.
The handler is called with a single
PD.SolarPositionargument.SUNPATH_PROJECTIONstring !pd-sunPathProj A global event invoked when the
PD.GlobalState.sunPathProjectionvalue changes.This event exists to allow the model to update any currently displayed Sun-path diagrams.
The event handler is called with a single argument, being the new
PD.PROJECTIONvalue to use.SKY_DISTRIBUTIONstring !pd-skyDist A global event invoked when the current sky luminance distributions changes.
This event is invoked whenever the date, time, location, sky type or sky condition values change. It is an opportunity for the UI (as well as custom element classes) to react to changes in the sky distribution.
The handler is called with a single
PD.SkyDomeargument.DAYLIGHT_SCALE!pd-dayScale A global event invoked when the current daylight scale changes.
This event is typically invoked when a daylight calculation has just completed.
TRANSFORM_ORIGINstring !pd-xformOrigin A global event invoked when the framework or a script wants the host application to change the position the transform origin used by the rotate and scale functions.
This event exists to allow the UI to update its axial coordinate positions or other information dynamically as it is being interactively dragged.
The event handler is called with a single argument, being the
PD.Pointcontaining the new position that is currently being dragged by the cursor or set within a script.SET_PARAMETERstring !pd-setParam Invoked when the framework needs the UI to update a parameter value for the currently selected element, junction, aperture, level or component.
This event allows the framework to support any UI framework and any method of generating editable parameter lists.
The event handler is called with three (3) arguments, being the selection type as a
PD.SELECTEDvalue, the name of the parameter as a string, and the new value to set.CONTEXT_MENU_SHOWstring !pd-contextShow A global event invoked when the framework or a script wants the host application to show or move its context menu.
This event exists to enable users to both show the context menu and/or interactively drag it within the scene in order to prevent it obscuring some part of the model that they may be working on. The UI should respond by positioning and displaying the context menu or, if it is already displayed, repositioning it to the given page coordinates.
The event handler is called with two arguments, being numbers representing these new page coordinates, given in decimal pixels. Unless invoked from a script, these new coordinates will be those of the primary pointer's
pageXandpageYproperties as it is dragged within the web page.CONTEXT_MENU_HIDEstring !pd-contextHide A global event invoked when the framework or a script wants the host application to hide the context menu if it is currently displayed.
The event handler is called with no arguments.
CANVAS_SIZEstring !pd-canvasSize Invoked when a scene viewer's drawing canvas changes size.
The event handler is called by the affected
PD.SceneViewerwith two numeric arguments, being the new horizontal width and vertical height of the canvas in pixels.VIEW_SIZEstring !pd-viewSize Invoked when the model size changes in a scene viewer.
This event is an opportunity for the UI to react when the user zooms in or fits the view to a new model size. It is typically used to regenerate dynamically sized overlay widgets such as interactive cursors or dimension lines.
The event handler is called by the affected
PD.SceneViewerwith a single numeric argument, being the new model view size in model units.VIEW_CHANGEDstring !pd-viewChanged Invoked when the view parameters of a scene viewer changes.
This event is an opportunity for the UI to display dynamic view information such as camera angles, field of view, zoom level or camera/target position. It is invoked quite frequently during interactive view manipulations, so you may want to monitor
POINTER_DOWNevents to moderate your updates.The event handler is called by the affected
PD.SceneViewerwith a singlePD.ViewOrbitalargument.MODEL_CHANGEDstring !pd-modelChanged Invoked whenever the model geometry is regenerated.
This event is an opportunity for the UI and simulation elements to react to changes in the 3D model.
The event handler is called by the affected
PD.SceneViewerwith a singlePD.ModelManagerargument.WALKING_MODEstring !pd-walkingMode Invoked when the navigation mode in a scene viewer changes.
This event is an opportunity for the UI to update its state based on the scene's walk or orbit mode.
The event handler is called by the affected
PD.SceneViewerwith a single boolean argument, being true when entering walk mode and false when returning to orbit mode.POINTER_DOWNstring !pd-pointerDown Invoked when a scene editor primary pointer is pressed or released.
This event is an opportunity for the UI to react to primary pointer down and primary pointer release events in the main model canvas, which occur for any mouse, pen and touch pointers. The typical UI response is to hide, show or modify whatever information overlays it has that sit on top of the main canvas, or to trigger the display of more detailed cursor information.
The event handler is called by the affected
PD.SceneEditorwith a single boolean argument, indicating whether or not to the primary pointer was pressed (true) or released (false).CURSOR_MOVEDstring !pd-cursorMoved Invoked when the displayed 3D cursor position in a scene editor changes.
This event is an opportunity for the UI to dynamically display or react to the changing coordinates of the cursor as it is being dynamically dragged within the model. This method is distinct from the
JUNCTION_MOVEDevent as it is invoked for every action that involves movement of the cursor.The event handler is called by the affected
PD.SceneEditorwith a singlePD.Cursorargument.CLIPBOARDstring !pd-clipboard A global event invoked when the contents of the clipboard changes.
The event handler is called with a single argument, being the
PD.Clipboardthat invoked the event.CLIPBOARD_COPYstring !pd-clip-copy A global event invoked when the framework copies a non-text item to the clipboard.
This event is an opportunity for the UI to monitor copy requests and either manipulate the copied data or cancel the event.
The event handler is called with one argument, being an object with the following properties:
Property Type Description type string The type identifier used by the PD.Clipboard.getLocalTypemethod.source object The object to be copied, typically a subclass of BIM.Entity.json string The JSON formatted string generated from the object to be sent to the clipboard. cancel boolean A flag that allows you to cancel the event by setting to true.If your application does cancel the copy request by setting the
cancelproperty totrue, you should provide some reasonable feedback in the UI so the user knows what happened. You can use either thePD.GlobalActions.showGeneralWarningorPD.GlobalActions.showTransientStatusMessagemethods to do this, as shown in the example below.CLIPBOARD_PASTEstring !pd-clip-paste A global event invoked when the framework pastes an entity or other created object from the clipboard.
This event is an opportunity for the UI to monitor and potentially intercept paste events and either manipulate the pasted data or cancel the event entirely.
The event handler is called with one argument, being an object with the following properties:
Property Type Description source object The object about to be pasted, typically a subclass of BIM.Entity.cancel boolean A flag that allows you to cancel the event by setting to true.If your application does cancel the paste request by setting the
cancelproperty totrue, you should provide some reasonable feedback in the UI so the user knows what happened. You can use either thePD.GlobalActions.showGeneralWarningorPD.GlobalActions.showTransientStatusMessagemethods to do this, as shown in the example below.SHOW_WARNINGstring !pd-showWarning A global event invoked when the model needs to display transitory warning text.
This event occurs when the framework needs to display a warning message to the user. The UI should respond by displaying a transient warning message with the given text. When the
stateargument is false, it indicates that the issue has been resolved and the corresponding transient warning message should be removed or hidden.The event handler is called with a single string argument, being the warning message text to be displayed.
SHOW_MESSAGEstring !pd-showMessage A global event invoked when the model needs to display transitory message text.
This event occurs when the framework needs to display some general information to the user. The UI should respond by displaying a transient info message with the given text.
The event handler is called with one, two or three arguments. The first argument is a string containing the message to be displayed. The second argument is the preferred duration to display the message for, which defaults to 5000ms (5 seconds).
The third argument is also optional and indicates whether the message should replace the primary general message or just be added to the general message list. If a process just needs to issue a one-off notification, then it should either not include this argument or set it to false. This is because there may be several other asynchronous processes that are providing similar notifications and the user needs to be able to see them all. However, if a process is likely to generate multiple messages that need to supersede each other, then it should include this argument and set it to true.
CONFIRMstring !pd-showConfirm A global event invoked when the model wants the UI to display a prompt modal dialog.
This event occurs when the framework needs a Yes/No or OK/Cancel answer from the user. The UI should respond by displaying a modal dialog box with the given title and message. If the user selected Yes or OK, the callback method should be called. If the user cancels, the callback is not called.
The event handler is called with three arguments, the first being the action string to display as the title of the prompt, the second being the message string to display in the body of the dialog box, and the third being a callback function to be called if the user selects Yes/OK.
COPY_ELEM_DLGstring !pd-copyElemDlg A global event invoked when the model wants the UI to display the copy element modal dialog.
This event occurs during copy/paste and clone actions.
The event handler is called with a single argument, being an enumeration where a zero (0) value means duplicate the current selection, one (1) means paste from the internal clipboard and two (2) means paste from the system clipboard.
CANCEL_ACTIONstring !pd-cancelAction A global event invoked when the user clicks the
Cancelbutton next to the progress bar or pressed ESC key when thePD.GlobalState.progressBarValueis greater than zero.The event handler is called with no arguments.
APP_IS_BUSYstring !pd-appIsBusy A global event invoked when an operation needs to indicate an application-wide busy state.
The event handler is called with a single boolean argument for setting (true) or clearing (false) the busy state.
LEGEND_DATA_RANGEstring !pd-legendUpdate A global event invoked when a legend needs all its data elements to update its extents.
This event typically occurs just before and just after an area-based calculation. It is used to update the legend from the data range values of all visible elements sharing that legend.
The event handler is called with two arguments, being the legend that needs to be updated and a
{ min, max }range object.LEGEND_CHANGEDstring !pd-legendChanged A global event invoked when the display properties of a legend have changed.
The event handler is called with a single argument, being the legend whose display properties were changed by the user.
SIDE_PANEL_PINstring !pd-sidePanelPin A global event invoked when the side panel is pinned or unpinned.
The event handler is called with a single boolean argument, indicating whether the side panel is now pinned (true) or unpinned (false).
-
FACET <static, readonly>
-
Enumerates the various roles that a polygon or facet plays within a shell.
The
facetTypeproperty ofPD.PolygonandPD.BRep.Faceobjects allows the framework to assign and identify the role different facets play within a shell or surface. For example, when searching for adjacent faces between spaces, this makes it possible to quickly ignore mitred and/or filleted faces at corners and edges as well as those inserted as the surrounds of apertures. It also allows applications to more quickly search for, update and/or replace only facets of a particular type.Properties:
Name Type Default Description HIDDENnumber -1 Indicates that the facet should not be rendered by the element.
This is used to hide shell surfaces that have been visually replaced with an alternate, textured or other surface.
SURFACEnumber 0 A standard exposed surface of a shell.
EDGEnumber 1 Tags a facet as part of a chamfered, mitred or filleted edge.
JAMBnumber 2 Tags a facet as an extruded side, head or sill of an aperture within another facet.
FRAMEnumber 3 Tags a facet as a window or door frame element.
GLASSnumber 4 Tags a facet as a window pane or glazing surface.
TOPnumber 5 Tags a facet as the top of an extrusion.
BOTTOMnumber 6 Tags a facet as the bottom of an extrusion.
BUMPYnumber 85 Indicates that a facet has been replaced with a rough and irregular surface texture, typically stone.
FOLIAGEnumber 90 Tags a facet as part of the leaf area of a plant or canopy area of a tree.
TRUNKnumber 91 Tags a facet as art of the stem of a plant or the trunk of a tree.
CLIP_EDGEnumber 100 Tags a vertical facet a generated when clipped to the level boundary.
These facets are created from the clipped edges of terrain and roof surfaces, and are tagged for inclusion in the spatial adjacency calculations.
CUT_FILL_AREAnumber 101 Tags a horizontal facet used for cut/fill volume determination in terrains.
These facets are created when the angle of repose is applied to internal ground and mass elements, and the level boundary.
-
FACET_FLAGS <static, readonly>
-
Enumerates the various flags used by the
PD.BRep.Faceclass.NOTE: These are bitwise flags used to pack multiple booleans into a single value.
Properties:
Name Type Default Description CHANGEDnumber 1 Whether or not any contours have changed since last updated.
NOTE: This flag is not yet used but is reserved for future use.
IS_CURVEDnumber 2 Whether or not the surface is curved with triangles already generated.
NO_OUTLINEnumber 4 Whether or not the facet should not display its outline(s) when meshed.
This flag may be used
-
FILTER <static, readonly>
-
Enumerates which model features will be checked for interactive selection.
These are bitwise flags that can be combined for filtering interactive selection.
Properties:
Name Type Default Description NONEnumber 0 A unique characterisation of an empty selection index.
These are also bit-wise flags that can be used to store multiple options in a single number property.
POINTnumber 1 Check to select the closest point on a path.
PATHnumber 2 Check to select the closest linear or curved segment.
FACEnumber 4 Check to select the closest intersected face.
SHELLnumber 8 Check to select the closest whole shell.
ALLnumber 15 Check to select everything.
checkPointsfunction Determines whether the filter contain the
POINTbit flag.checkPathsfunction Determines whether the filter contain the
PATHbit flag.checkFacesfunction Determines whether the filter contain the
FACEbit flag.checkShellsfunction Determines whether the filter contain the
SHELLbit flag. -
FIT <static, readonly>
-
Enumerates the different object/view fit levels.
This is primarily used by view managers to fit the camera to their contents.
Properties:
Name Type Default Description CHECKnumber 0 Indicates a normal check for changed extents.
EXTENTSnumber 1 Indicates a deeper and more detailed check for changed extents.
VIEWnumber 2 Indicates a full check and fitting the view to visible objects.
-
FORMAT <static, readonly>
-
Enumerates a range of numeric display formats.
You can use this object to display and parse values in the given format using its static methods.
Properties:
Name Type Default Description NONEnumber -1 Value has no format.
DECIMALnumber 0 Formatted as a decimal number, such as
25.64.INTEGERnumber 1 Formatted as a integer number, such as
465.ORDINALnumber 2 Formatted as an ordinal with suffix, such as
1st,2nd,25th, etc.PERCENTAGEnumber 3 Formatted as percentage where 0 to 1 equals 0% to 100%.
ANGLEnumber 4 Formatted as an angle in degrees.
RAD2DEGnumber 5 Converted and formatted from radians to an angle in degrees.
LENGTHnumber 6 Formatted as a dimension in the current units, such as
1250,1.25,4' 1" 3/16, etc.LENGTH differs from DISTANCE and DIMENSION in that no units are appended to the displayed value.
DISTANCEnumber 7 Formatted as a distance in the current units, such as
1250mm,1.25m,4' 1" 3/16, etc.DISTANCE differs from LENGTH in that it appends the current units abbreviation to the output. DISTANCE differs from DIMENSION in that it is always interpreted as an absolute value.
DIMENSIONnumber 8 A special type of distance that parses and formats fractional values differently to absolute units.
DIMENSION differs from DISTANCE in that values between 0 and 1 are treated as fractional values relative to a reference length. For example, a ceiling height can be defined as 2400mm, or as 0.85 times the space height. DIMENSION differs from LENGTH in that it appends the current units abbreviation to the output.
METRESnumber 9 A special type of distance that is stored in metres rather than millimetres.
AREAnumber 10 Formats an area in square metres or square feet.
VOLUMEnumber 11 Formats an area in cubic metres or cubic feet.
DURATIONnumber 12 Formatted as a duration, such as
01:50or-06:42.TIME_ZONEnumber 13 Formatted as a time zone relative to UTC, such as
+8:00or-9:30.TIMEnumber 14 Formatted as a time of day in the range 0 to 24, such as
08:50or 22:30`.DATEnumber 15 Formatted as a day of the year in range 0 to 365/6, such as
01 Janor25 Jun.BOOLEANnumber 16 Formatted as a true/false value.
COLORnumber 17 Formatted as a CSS colour string in the form '#RRGGBB'.
HEAT_FLUX_DENSITYnumber 18 Formatted as a value in either W/m2 or BTU/hr/ft2.
MILLISECONDSnumber 19 Formatted as a time value in milliseconds.
CONDUCTIVITYnumber 20 Formatted as a value in either W/(m-K) or BTU/(h-ft-F).
DENSITYnumber 21 Formatted as a value in either kg/m3 or lb/ft3.
SPECIFIC_HEATnumber 22 Formatted as a value in either J/(kg-K) or BTU/(lb-F).
SIDESnumber 23 Formatted as a number of polygon sides, where <3 is 'Any'.
_MAXnumber 24 Defines the maximum allowable format number.
toStringfunction Format the given value as a string.
fromStringfunction Parses a string to a value in the given format, or a format type.
asDecimalfunction Format the given value as an decimal number string.
asIntegerfunction Format the given value as an integer string.
asOrdinalfunction Format the given value as an ordinal string, such as 1st, 2nd, 3rd, etc.
asPercentagefunction Format the given value as a percentage string.
asAnglefunction Format the given value in degrees as an angle string.
asRadiansToDegreesfunction Format the given value in radians as an angle string in degrees.
asDimensionfunction Format the given value as a dimension string without units.
asDistancefunction Format the given value as a distance string with units.
asMetresfunction Format the given value as a distance string in either metres or feet.
asDurationfunction Format the given value as a time duration string.
asTimeZonefunction Format the given value as a time-zone offset string.
asTimefunction Format the given value as a 24Hr time string.
asDatefunction Format the given value as a date string.
asBooleanfunction Format the given value as a boolean string.
asColorfunction Format the given value as a CSS color string in the form '#RRGGBB'.
asHeatFluxDensityfunction Format the given heat flux density value in W/m2 or Btu/hr/ft2.
asMillisecondsfunction Format the given value in milliseconds with a 'ms' suffix.
asThermalConductivityfunction Format the given thermal conductivity value as W/(m-K) or BTU/(h-ft-F).
asDensityfunction Format the given density value as kg/m3 or lb/ft3.
asSpecificHeatfunction Format the given specific heat value as J/(kg-K) or BTU/(lb-F).
Example
PD.FORMAT.toString(PD.FORMAT.TIME, 15.75); // Result: '15:45' const time_of_day = PD.FORMAT.parseString(PD.FORMAT.DATE, '15:45'); // Result: 15.75 PD.FORMAT.toString(PD.FORMAT.DATE, 91); // Result: '01Apr' const day_of_year = PD.FORMAT.parseString(PD.FORMAT.DATE, '01Apr'); // Result: 91 const type_str = PD.FORMAT.toString(PD.FORMAT.PERCENTAGE); // Result: 'PERCENTAGE' const type PD.FORMAT.fromString(type_str); // Result: 3 (PD.FORMAT.PERCENTAGE)
-
:boolean
FORWARD <static>
-
An alias for
falseto make some polygon/polyline method calls more readable.Type
- boolean
-
GRID <static, readonly>
-
Enumerates the types of grid distribution.
Properties:
Name Type Default Description REGULARnumber 0 Distributes grid points orthogonally over an area.
HEXAGONnumber 1 Distributes grid points using a hexagonal grid.
-
:object
GlobalStateProxy <static>
-
This is a proxy to the application state properties in
PD.GlobalState. By default this is a direct reference toPD.GlobalState, however front-end frameworks can reassign this to create a reactive/observable version.Type
- object
-
:object
GlobalViewProxy <static>
-
This is a proxy to the application view properties in
PD.GlobalView. By default this is a direct reference toPD.GlobalView, however front-end frameworks can reassign this to create a reactive/observable version.Type
- object
-
HUMIDITY_RATIO <static, readonly>
-
Provides tools to convert between different humidity ratio units.
Properties:
Name Type Default Description KILOGRAMS_PER_KILOGRAMnumber 120 The identifier for kilograms of water per kilogram of dry air (kg/kg).
GRAMS_PER_KILOGRAMnumber 121 The identifier for grams of water per kilogram of dry air (g/kg).
POUNDS_PER_POUNDnumber 122 The identifier for pounds of water per pound of dry air (lb/lb).
GRAINS_PER_POUNDnumber 123 The identifier for grains of water per pound of dry air (gr/lb).
toKilogramsPerKilogramfunction Converts a humidity ratio value from the given units to Celsius.
fromKilogramsPerKilogramfunction Converts a humidity ratio value in kilograms per kilogram to the given units.
convertBetweenfunction Converts a humidity ratio value between the two given units.
getNamefunction Retrieves the name of the given humidity ratio units.
Based on the given units, this method returns one of the following string values: 'Kilograms per Kilogram', 'Grams per Kilogram', 'Pounds per Pound' or 'Grains per Pound'.
getAbbrevfunction Retrieves the abbreviation of the given humidity ratio units.
Based on the given units, this method returns one of the following string values: 'kg/kg', 'g/kg', 'lb/lb' or 'gr/lb';
getUnitsFromAbbrevfunction Retrieves the humidity ratio units identifier from the given abbreviation.
Parses the abbreviations 'kg/kg', 'g/kg', 'lb/lb' or 'gr/lb' into the appropriate unit ID,
-
JOIN <static, readonly>
-
Enumerates the different types of joints between path segments.
Properties:
Name Type Default Description INLINEnumber -1 Defines a colinear join that does not change direction.
This line type does not need or use any control data.
LINEARnumber 0 Join to next point with a straight lines.
This line type does not need or use any control data.
CHAMFERnumber 1 Joins incoming and outgoing lines with a straight chamfer.
The size of the chamfer is controlled by either the join
sizeoroffsetattribute value. If set, thesizevalue will override anoffsetvalue when calculating the chamfer. When updated, these joins will add aninConnectpoint property to theattribobject storing the start position of the chamfer and anoutConnectpoint property for its end.Always use the
getInPos()andgetOutPos()methods to obtain the connection points of a joint, which will automatically useinConnectandoutConnectwhenever appropriate.FILLETnumber 2 Join incoming and outgoing lines with a circular fillet.
The radius of the fillet is governed by the
radiusattribute value. When updated, these joins will add 'radius andcenterpoint properties to theattribobject, as well asinConnectto indicate the start of the fillet andoutConnectfor the end.Always use the
getInPos()andgetOutPos()methods to obtain the connection points of a joint, which will automatically useinConnectandoutConnectwhenever appropriate.ARCnumber 3 Join the previous and next points with an arc that passes through this point.
The center and radius of the arc are calculated automatically to pass through this point as well as the in and out connections of the previous and next. When updated, these joins will add 'radius and
centerpoint properties to theattribobject, as well asinConnectto indicate the start of the fillet andoutConnectfor the end.Always use the
getInPos()andgetOutPos()methods to obtain the connection points of a joint, which will automatically useinConnectandoutConnectwhenever appropriate.BEZIERnumber 4 Join the previous and next points with a Bezier curve that passes through this point.
The nature of the resulting curve is governed by the presence or absence of incoming and outgoing control points, as well as the
isSmoothand/orisSymmetricalproperties of each involved joint.BSPLINEnumber 5 Sets this join as a B-Spline curve control point.
_MAXnumber 5 The maximum allowed value.
toStringfunction Converts a join type value to a string identifier.
fromStringfunction Parses a string into a valid join type value.
-
KEY <static, readonly>
-
Enumerates the keyboard keys that control increment/decrement values.
Properties:
Name Type Default Description NONEnumber 0 Applies a minor increment to the value, typically
5 * step.SHIFTnumber 16 Applies a major increment to the value, typically
50 * step.CONTROLnumber 17 Applies the smallest step increment to the value.
-
MANIPULATOR <static, readonly>
-
Enumerates the different cursor manipulator types.
Properties:
Name Type Default Description BOXnumber 0 A simple box manipulator.
+----------+ / /| +----------+ | | | | | | + | |/ +----------+MARKERnumber 1 A simple diamond marker manipulator.
_+_ _/ \\_ _/ \ \_ _/ \ \_ +-----------+---+ \_ / _/ \_ / _/ \_ /_/ '+'SQUAREnumber 2 A square drag indicator located at the center of the cursor.
+ - - - - - - - - - - - - - + : : : : : : : | : : ---x--- : : | : : : : : : : + - - - - - - - - - - - - - +ARROWnumber 3 A directional arrow drag indicator offset by a vector from the cursor.
6 : = : = 3- - - -2 = : /: = : / : = : / : | = : / ; ---X--- 5 : / : | = : / : = :/ : = 0- - - -1 = : = : = 4TOUCHnumber 4 An simple circle drag indicator offset from the cursor for touch-based manipulation.
, - ~ ' ~ - , , ' ' , , , , , , | , , ---x--- , , | , , , , , , , ' ' - , _ _ _ , 'SPIKEDnumber 5 A spiked circle center drag indicator located at the center of a rect/box cursor.
+ / \ , - ' ' - , , ' ' , , _ = _ , , _ ' ' _ , __-' . | . '-__ * __ = ---x--- = __ * ', '_ | _' ,' , . _ _ . , , '=' , , , ' ' - , _ _ , - ' \ / +SECTIONnumber 6 An arrow-on-a-circle drag indicator for manipulating section planes/lines, located at the center of the cursor.
+ : = : = , - ~ : ~ - , = , ' : ' , , : ,= , : , = , | , = , ---x--- , + , | , = , : , = , : ,= , : , ' ' - , _ : _ , '= : = : = +ROTATORnumber 7 A large circular rotation indicator oriented on an axis and located at the center of the cursor.
-
MODE <static, readonly>
-
Enumerates the types of interactive user edit modes.
Properties:
Name Type Default Description NONEnumber 0 Completely disable interaction.
EDITnumber 1 Click-select and edit elements on the model.
ADDnumber 2 Add path points and junctions to a new element.
MEASUREnumber 3 Allow user to position and drag a dimension line.
RECTnumber 4 Allow user to position and drag the background image or a ground grid.
MOVEnumber 5 Translate the current selection set.
ROTATEnumber 6 Rotate the current selection set.
SCALEnumber 7 Scale the current selection set.
ORIGINnumber 8 Set the position of an arbitrary point within the model.
SHELLnumber 9 Select and edit
PD.Shellgeometry.DRAG_DROPnumber 10 Interactively drag elements and components over the top of other elements and components.
WORK_PLANEnumber 11 Interactively position and orient a temporary working plane.
CAPTUREnumber 100 Captures all user interaction in the model canvas.
-
MOUSE_BTN <static>
-
Enumerates the different types of mouse/pointer button.
Properties:
Name Type Description NONEnumber No mouse/pointer button pressed.
LEFTnumber The left/primary mouse/pointer button pressed.
MIDDLEnumber The middle/secondary mouse/pointer button pressed.
RIGHTnumber The right/tertiary mouse/pointer button pressed.
-
:boolean
OPEN <static>
-
An alias for
falseto make some polygon/polyline method calls more readable.Type
- boolean
-
PATH <static, readonly>
-
Enumerates the different default shapes for interactive path generation.
Properties:
Name Type Default Description POLYGONALnumber 0 The path is generated by linking each point with linear segments.
RECTANGULARnumber 1 The path is generated by creating a rectangle between two points.
CIRCULARnumber 2 The path is generated by creating a circle between two points.
-
POINT_FLAGS <static, readonly>
-
Enumerates the various flags used by points and curves within a path.
NOTE: These are bitwise flags used to pack multiple booleans into a single value.
As a building model is very likely to contain many thousands of path points being able to store multiple boolean settings in a single integer is at least a small saving. It also helps a little when undoing, redoing and copying.
Properties:
Name Type Default Description CHANGEDnumber 1 Whether the junction's properties have changed since last update.
CONCAVEnumber 2 Whether the cross-product is inverted compared to others in the path.
VIRTUALnumber 4 Whether the junction was added dynamically rather than manually by the user.
VARIABLE_WIDTHnumber 8 Whether material changes are gradual or sudden (step).
COLINEARnumber 16 Whether or not the junction is colinear with its previous and next path points.
EXTERNALnumber 32 Whether or not the junction's segment is adjacent to the outside.
SMOOTHnumber 128 Whether or not the junction's curve maintains a smooth change in direction.
When set to
true, any curve will smoothly transition the path direction using control points that can only move along the tangent between incoming and outgoing vectors. When false, control points can move unrestricted.SYMMETRICnumber 256 Whether or not the magnitude of smooth control points are reflected equally.
FILLETnumber 512 Whether or not to truncate acute angles using a fillet instead of a mitre.
END_PLANEnumber 1024 Whether or not the junction starts/end at a specific plane when part of an open path.
When set to
true, any path generation will check the in/out vector and use it to generate an end plane to intersect offset profiles with. -
POLY_FLAGS <static, readonly>
-
Enumerates the various flags used in polylines, polyloops and polygons, as well as their path subclasses.
NOTE: These are bitwise flags used to pack multiple booleans into a single value.
As a building model is very likely to contain thousands of paths, lines and loops, being able to store multiple boolean settings in a single integer is at least a small saving. It also helps a little when undoing and copying.
Properties:
Name Type Default Description CHANGEDnumber 1 Whether or not any contours have changed since last updated.
CLOSEDnumber 2 Whether or not each contour line loops back to its starting vertex.
POLYGONnumber 4 Whether or not the contours form a single closed polygon with holes.
RECTnumber 8 Whether or not the polygon is rectilinear.
PLANARnumber 16 Whether or not all vertices lie in the same plane.
CURVEDnumber 32 Whether or not the surface is curved with triangles already generated.
CHANGINGnumber 64 Whether or not the polygon is currently being dynamically edited.
OUTLINEnumber 128 Whether or not the polygon should include any outline(s) when meshed.
SURFACEnumber 256 Whether or not the polygon should include any surface(s) when meshed.
VERTICALnumber 512 Whether or not to keep the plane normal and up-vector always vertical.
CONCAVEnumber 1024 Whether or not any part of the polyline is concave.
ATTRIBnumber 2048 Whether or not the polyline needs its attributes updated.
HAS_CURVESnumber 4096 Whether or not a path has one or more curved segments.
-
PREFIX <static, readonly>
-
Enumerates the various units prefixes.
Units prefixes are applied to very large or very small values to make them more human-readable. Examples of prefixes are MegaWatts (MW: 1,000,000 Watts), Kilometres (km: 1000 metres), millimetre (mm: 1e-3 metres) and PicoOhm (po: 1e-12 Ohm). This utility class provided an enumeration and some static methods for handling such prefixes.
Properties:
Name Type Default Description PETAnumber 7 The identifier for 1e15.
TERAnumber 6 The identifier for 1e12.
GIGAnumber 5 The identifier for 1e9.
MEGAnumber 4 The identifier for 1e6.
KILOnumber 3 The identifier for 1e3.
HECTOnumber 2 The identifier for 100.
DECAnumber 1 The identifier for 10.
NONEnumber 0 The identifier for no prefix.
DECInumber -1 The identifier for 0.1.
CENTInumber -2 The identifier for 0.01.
MILLInumber -3 The identifier for 1e-3.
MICROnumber -4 The identifier for 1e-6.
NANOnumber -5 The identifier for 1e-9.
PICOnumber -6 The identifier for 1e-12.
FEMTOnumber -7 The identifier for 1e-15.
getScaleFactorfunction Returns the scale factor for units with the given prefix.
const scale = PD.PREFIX.getScaleFactor(PD.PREFIX.NANO);
The
prefixargument is an integer value, as follows:No. Prefix Name Factor 7 Peta (P) PD.PREFIX.PETA 1e-15 6 Tera (T) PD.PREFIX.TERA 1e-12 5 Giga (G) PD.PREFIX.GIGA 1e-9 4 Mega (M) PD.PREFIX.MEGA 1e-6 3 Kilo (k) PD.PREFIX.KILO 1e-3 2 Hecto (h) PD.PREFIX.HECTO 1e-2 1 Deca (da) PD.PREFIX.DECA 1e-1 0 None PD.PREFIX.NONE 1.0 -1 Deci (d) PD.PREFIX.DECI 1e1 -2 Centi (c) PD.PREFIX.CENTI 1e2 -3 Milli (m) PD.PREFIX.MILLI 1e3 -4 Micro (μ) PD.PREFIX.MICRO 1e6 -5 Nano (n) PD.PREFIX.NANO 1e9 -6 Pico (p) PD.PREFIX.PICO 1e12 -7 Femto (f) PD.PREFIX.FEMTO 1e15 toStringfunction Returns the prefix string for units with the given prefix.
const units = 'W/h'; const value = 2322319362.6; const prefix = PD.PREFIX.GIGA; const scale = PD.PREFIX.getScaleFactor(prefix); console.log((scale * value).toFixed(3) + ' ' + PD.PREFIX.toString(prefix) + units); >> "2.322 GW/h"
The
prefixargument is an integer value, as follows:No. Prefix Name Factor 7 Peta (P) PD.PREFIX.PETA 1e-15 6 Tera (T) PD.PREFIX.TERA 1e-12 5 Giga (G) PD.PREFIX.GIGA 1e-9 4 Mega (M) PD.PREFIX.MEGA 1e-6 3 Kilo (k) PD.PREFIX.KILO 1e-3 2 Hecto (h) PD.PREFIX.HECTO 1e-2 1 Deca (da) PD.PREFIX.DECA 1e-1 0 None PD.PREFIX.NONE 1.0 -1 Deci (d) PD.PREFIX.DECI 1e1 -2 Centi (c) PD.PREFIX.CENTI 1e2 -3 Milli (m) PD.PREFIX.MILLI 1e3 -4 Micro (μ) PD.PREFIX.MICRO 1e6 -5 Nano (n) PD.PREFIX.NANO 1e9 -6 Pico (p) PD.PREFIX.PICO 1e12 -7 Femto (f) PD.PREFIX.FEMTO 1e15 -
PREFIX <static, readonly>
-
Enumerates the various units prefixes.
Units prefixes are applied to very large or very small values to make them more human-readable. Examples of prefixes are MegaWatts (MW: 1,000,000 Watts), Kilometres (km: 1000 metres), millimetre (mm: 1e-3 metres) and PicoOhm (po: 1e-12 Ohm). This utility class provided an enumeration and some static methods for handling such prefixes.
Properties:
Name Type Default Description PETAnumber 7 The identifier for 1e15.
TERAnumber 6 The identifier for 1e12.
GIGAnumber 5 The identifier for 1e9.
MEGAnumber 4 The identifier for 1e6.
KILOnumber 3 The identifier for 1e3.
HECTOnumber 2 The identifier for 100.
DECAnumber 1 The identifier for 10.
NONEnumber 0 The identifier for no prefix.
DECInumber -1 The identifier for 0.1.
CENTInumber -2 The identifier for 0.01.
MILLInumber -3 The identifier for 1e-3.
MICROnumber -4 The identifier for 1e-6.
NANOnumber -5 The identifier for 1e-9.
PICOnumber -6 The identifier for 1e-12.
FEMTOnumber -7 The identifier for 1e-15.
getScaleFactorfunction Returns the scale factor for units with the given prefix.
const scale = PD.PREFIX.getScaleFactor(PD.PREFIX.NANO);
The
prefixargument is an integer value, as follows:No. Prefix Name Factor 7 Peta (P) PD.PREFIX.PETA 1e-15 6 Tera (T) PD.PREFIX.TERA 1e-12 5 Giga (G) PD.PREFIX.GIGA 1e-9 4 Mega (M) PD.PREFIX.MEGA 1e-6 3 Kilo (k) PD.PREFIX.KILO 1e-3 2 Hecto (h) PD.PREFIX.HECTO 1e-2 1 Deca (da) PD.PREFIX.DECA 1e-1 0 None PD.PREFIX.NONE 1.0 -1 Deci (d) PD.PREFIX.DECI 1e1 -2 Centi (c) PD.PREFIX.CENTI 1e2 -3 Milli (m) PD.PREFIX.MILLI 1e3 -4 Micro (μ) PD.PREFIX.MICRO 1e6 -5 Nano (n) PD.PREFIX.NANO 1e9 -6 Pico (p) PD.PREFIX.PICO 1e12 -7 Femto (f) PD.PREFIX.FEMTO 1e15 toStringfunction Returns the prefix string for units with the given prefix.
const units = 'W/h'; const value = 2322319362.6; const prefix = PD.PREFIX.GIGA; const scale = PD.PREFIX.getScaleFactor(prefix); console.log((scale * value).toFixed(3) + ' ' + PD.PREFIX.toString(prefix) + units); >> "2.322 GW/h"
The
prefixargument is an integer value, as follows:No. Prefix Name Factor 7 Peta (P) PD.PREFIX.PETA 1e-15 6 Tera (T) PD.PREFIX.TERA 1e-12 5 Giga (G) PD.PREFIX.GIGA 1e-9 4 Mega (M) PD.PREFIX.MEGA 1e-6 3 Kilo (k) PD.PREFIX.KILO 1e-3 2 Hecto (h) PD.PREFIX.HECTO 1e-2 1 Deca (da) PD.PREFIX.DECA 1e-1 0 None PD.PREFIX.NONE 1.0 -1 Deci (d) PD.PREFIX.DECI 1e1 -2 Centi (c) PD.PREFIX.CENTI 1e2 -3 Milli (m) PD.PREFIX.MILLI 1e3 -4 Micro (μ) PD.PREFIX.MICRO 1e6 -5 Nano (n) PD.PREFIX.NANO 1e9 -6 Pico (p) PD.PREFIX.PICO 1e12 -7 Femto (f) PD.PREFIX.FEMTO 1e15 -
PRESSURE <static, readonly>
-
Provides tools to convert between different pressure units.
Properties:
Name Type Default Description PASCALnumber 130 The identifier for Pascal (Pa).
KILOPASCALnumber 131 The identifier for kilo-Pascal (Pa).
MILLIMETERS_MERCURYnumber 132 The identifier for millimeters of mercury (mmHg).
INCHES_MERCURYnumber 133 The identifier for inches of mercury (inHg).
POUNDS_PER_SQUARE_INCHnumber 134 The identifier for pounds per square inch (Psi).
ATMOSPHERESnumber 135 The identifier for Atmospheres (atm).
BARnumber 136 The identifier for barometric pressure (bar).
toPascalfunction Converts a pressure value from the given units to Pascal (Pa).
fromPascalfunction Converts a temperature value in Pascal to the given units.
convertBetweenfunction Converts a pressure value between the two given units.
getNamefunction Retrieves the name of the given humidity ratio units.
Based on the given units, this method returns one of the following string values: 'Pascal', 'kilo-Pascal', 'Millimeters Mercury', 'Inches Mercury', 'Pounds Force Per Square Inch', 'Atmospheres' or 'Bar'.
getAbbrevfunction Retrieves the abbreviation of the given humidity ratio units.
Based on the given units, this method returns one of the following string values: 'Pa', 'kPa', 'mmHg', 'inHg', 'Psi', 'atm', 'bar'.
getUnitsFromAbbrevfunction Retrieves the pressure units identifier from the given abbreviation.
Parses the abbreviations 'Pa', 'kPa', 'mmHg', 'inHg', 'Psi', 'atm', 'bar' into the appropriate unit ID,
-
PRIMITIVE <static, readonly>
-
Enumerates different types of WebGL primitives.
These are used by some mesh builder functions to help create complex geometry by simulating immediate mode that used to be available in legacy OpenGL. The
PD.PolyMeshandPD.MeshBuilderclasses provide an API that uses these primitive types to interpret vertex data in different ways.See the PD.PolyMesh
begin()method for more details on how to use these values and their vertex ordering requirements.Properties:
Name Type Default Description POINTSnumber 0 Treats each vertex as an independent point in space.
0 1 + + + 3 + 2LINESnumber 1 Treats each pair of vertices as an independent line segment.
0 1 +---------------+ +__ 3 ''--__ ''-+ 2LINE_LOOPnumber 2 Draws a connected group of line segments from the first vertex to the last, then back to the first.
0 1 +---------------+ | / +__ / 3 ''--__ / ''-+ 2LINE_STRIPnumber 3 Draws a connected group of line segments from the first vertex to the last.
0 1 +---------------+ / +__ / 3 ''--__ / ''-+ 2TRIANGLESnumber 4 Treats each triplet of vertices as an independent triangle.
1 3 5 + +--<--+ A: 0,1,2 |\_ \_ B | B: 3,4,5 | \_ \_ | | A \ \| +--<--+ + 0 2 4TRIANGLE_STRIPnumber 5 Creates a new triangle from each incremental triplet. When ordering vertices, all the odd vertices run along one edge and even vertices the other.
1 3 5 7 +-->--+-->--+--- + A: 0,1,2 |\_ B |\_ D |\_ B: 2,1,3 | \_ | \_ | \ C: 2,3,4 | A \| C \| D: 4,3,5 +--<--+--<--+--- + 0 2 4 6TRIANGLE_FANnumber 6 Creates triangles that fan out from a central point. A new triangle is created linking each each incremental pair to the very first vertex.
2 3 4 +-->--+-->--+ A: 0,1,2 |\_ B | C _/| B: 0,2,3 | \_ | _/ | C: 0,3,4 | A \|/ D | D: 0,4,5 +--<--+--<--+ 1 0 5QUADSnumber 7 Converts each quadruplet into two connected triangles. Each group of four vertices must run counter clockwise around the perimeter of the quad.
1 2 5 6 +-->--+ +-->--+ A: 0,1,2 | A _/| | C _/| B: 2,3,0 | _/ | | _/ | C: 4,5,6 |/ B | |/ D | D: 6,7,4 +--<--+ +--<--+ 0 3 4 7QUAD_STRIPnumber 8 Converts a strip of connected quads into a triangle strip. Vertex ordering is the same as a triangle strip, where odd vertices run along one edge and even vertices the other.
1 3 5 7 +-->--+-->--+--- + A: 0,1,2 |\_ B |\_ D |\_ B: 2,1,3 | \_ | \_ | \ C: 2,3,4 | A \| C \| D: 4,3,5 +--<--+--<--+--- + 0 2 4 6 -
PROJECTION <static, readonly>
-
Enumerates different types of 2D sun-path diagram projections.
These refer to some standard equations for converting 3D altitude angles to radius values within a 2D polar chart. The different methods allow the detail at the zenith or the horizon to be emphasised, or all altitudes equally.
Properties:
Name Type Default Description SPHERICALnumber 0 The enumeration for a spherical polar projection.
This projection corresponds to the 'Orthographic' projection described at https://en.wikipedia.org/wiki/Stereographic_projection.
EQUIDISTANTnumber 1 The enumeration for an equidistant polar projection.
This projection simply divides the polar diagram radius into divisions of equal altitude.
STEREOGRAPHICnumber 2 The enumeration for a stereographic polar projection.
This projection corresponds to the 'Stereographic' projection described at https://en.wikipedia.org/wiki/Stereographic_projection.
-
RECT_MODE <static, readonly>
-
Enumerates the types of interactive rectangle edit modes.
Properties:
Name Type Default Description IMAGEnumber 0 Edits the extents of the background image.
GRIDnumber 1 Edits the extents of the background grid.
SURFACEnumber 2 Edits the extents of a selected rectangular surface.
-
:boolean
REVERSE <static>
-
An alias for
trueto make some polygon/polyline method calls more readable.Type
- boolean
-
SCHEDULE <static>
-
Stores a range of schedule and profile enumerations.
-
SELECT <static, readonly>
-
Enumerates different types of sub-item selection methods.
Properties:
Name Type Default Description ANYnumber 0 Select any sub-item, typically the first matching item.
CLOSESTnumber 1 Select the closest sub-item, typically to the selection ray origin.
FARTHESTnumber 2 Select the farthest sub-item, typically from the selection ray origin.
ALLnumber 3 Select all matching sub-items.
-
SELECTED <static, readonly>
-
Enumerates the type of model feature that a selection set contains.
Properties:
Name Type Default Description NONEnumber 0 Nothing is selected.
BBOXnumber 1 The bounding box extents of an element is selected.
SHELLnumber 2 The
PD.Shellof a model element is selected.SHELL_FACETnumber 3 A
PD.Polygonfacet of aPD.Shellis selected.SHELL_EDGEnumber 4 An edge between two
PD.Polygonfacets of aPD.Shellis selected.VERTEXnumber 5 One or more
PD.Pointvertices within aPD.Shellare selected.BREPnumber 6 The
PD.BRepof a model element is selected.BREP_FACEnumber 7 BREP_EDGEnumber 8 An edge within the
PD.BRepof a model element is selected.BREP_VERTEXnumber 9 A vertex within the
PD.BRepof a model element is selected.ELEMENTnumber 10 The
BIM.Pathof a modelBIM.Elementis selected.JUNCTIONnumber 11 A
BIM.Junctionwithin theBIM.Pathof a modelBIM.Elementis selected.SEGMENTnumber 12 A linear or curved segment within the
BIM.Pathof a modelBIM.Elementis selected.APERTUREnumber 13 A
BIM.Aperturewithin aBIM.JunctionorBIM.Surfaceis selected.NODEnumber 14 A curve control node is selected.
LEVELnumber 20 A
BIM.Levelwithin aBIM.Structure.STRUCTUREnumber 21 A
BIM.Structurewithin aBIM.Project.isTransientfunction Determines if the current selection is transient or not.
Transient selections only appear for a short time and fade away so as not to interfere with interactive selections. For example, if you select an element on a different level to the current level, a transient level selection appears while the model transitions the selected level to become the current level, and then disappears to allow you to select things on the new current level.
isJunctionOrSegmentfunction Determines if the current selection is equal to either
PD.SELECTED.JUNCTIONorPD.SELECTED.SEGMENT.toStringfunction Format the given value as a string.
-
SELECTION <static>
-
Enumerates the different selection types.
This enumerator is typically filled out by
PD.SelectionHandlerclass instances when they are enabled by the host application.Properties:
Name Type Description NONEnumber No selection.
STRUCTUREnumber When a BIM.Structure is selected.
LEVELnumber When a BIM.Level is selected.
ELEMENTnumber When a BIM.Element is selected.
-
SELECT_ACTION <static, readonly>
-
Enumerates whether items that are interactively selected will replace, be added to, removed from or toggled within the current selection set.
Properties:
Name Type Default Description REMOVEnumber -1 Interactive selection removes from the existing selection set.
REPLACEnumber 0 Interactive selection replaces the existing selection set.
ADDnumber 1 Interactive selection is added to the existing selection set.
TOGGLEnumber 2 The state of items Interactive selection. Interactive selection is added to the existing selection set.
-
SIDE <static, readonly>
-
Enumerates the different sides of a entity.
Properties:
Name Type Default Description NONEnumber -99 Stick rigidly to line/plane without projection or offset.
INSIDEnumber -1 The side opposite to the direction of the surface normal or the inner surface/plane.
MIDDLEnumber 0 The actual line of the path or face of the center surface/plane.
OUTSIDEnumber 1 The side in the direction of the surface normal or the outer surface/plane.
getParamTypefunction Retrieve side types as a
PD.ParamTypefrom global cache. -
SKYDOME <static>
-
Enumerates different methods for subdividing the sky dome into patches.
There are many ways to subdivide the surface of a sphere into a series of discrete areas. The values defined here represent some of the commonly used standards for subdividing a hemispherical sky dome into analysis patches.
Properties:
Name Type Description EQUAL_ANGLEnumber The equal-angle method divides the sky into equal azimuth and altitude angles, which means that segmentation is denser towards the zenith.
EQUAL_AREAnumber The equal-area method tries to keep all segments as close as possible to the same solid angle by varying the number within each altitude band.
TREGENZAnumber The Reinhart/Tregenza method first generates 145 equal area sky patches and then further subdivides them to obtain the required angle.
GEODESICnumber The Geodesic method progressively subdivides icosahedral triangles into smaller triangles and projects them onto the sky dome.
-
SKY_TYPE <static>
-
Enumerates the different standard general all-weather sky types.
Properties:
Name Type Description NONEnumber NO SKY DISTRIBUTION.
SKY_01number Standard Overcast Sky.
SKY_02number Overcast, steep grade, some Sun.
SKY_03number Overcast, moderate grade, no Sun.
SKY_04number Overcast, moderate grade, some Sun.
SKY_05number Standard Uniform Sky.
SKY_06number Partly cloudy, no grade, some Sun.
SKY_07number Partly cloudy, no grade, more Sun.
SKY_08number Partly cloudy, no grade, distinct corona.
SKY_09number Partly cloudy, obscured Sun.
SKY_10number Partly cloudy, circumsolar region.
SKY_11number White-blue sky, distinct corona.
SKY_12number Standard Clear Sky, low turbidity.
SKY_13number Standard Clear Sky, some pollution.
SKY_14number Cloudless turbid sky, broad corona.
SKY_15number White-blue turbid sky, broad corona.
SKY_16number Traditional Overcast Sky.
WEATHERnumber FROM WEATHER DATA.
-
SNAP <static, readonly>
-
Enumerates the various object snap options.
Properties:
Name Type Default Description NONEnumber 0 Completely disable snapping.
GRIDnumber 1 Snap to the current grid.
POINTSnumber 2 Snap to other vertices on the currently selected path.
MIDPOINTSnumber 4 Snap to the mid-point of line segments in the currently selected path.
LINESnumber 8 Snap to the closest point on line segments in the currently selected path.
DIAGONALSnumber 16 Snap when at a 45 degree angle to adjacent vertices on the currently selected path.
HOVERnumber 32 Snap to the closest point beneath the pointer when dragging.
PATHnumber 64 Snap to nearest 90 degrees increment from previous/next junction in path.
ALLnumber 127 Snap to vertices, mid-points and 45deg angles.
-
SPECIFIC_VOLUME <static, readonly>
-
Provides tools to convert between different specific volume units.
Properties:
Name Type Default Description CUBIC_METERS_PER_KILOGRAMnumber 140 The identifier for cubic meters per kilogram (m3/kg).
CUBIC_FEET_PER_POUNDnumber 141 The identifier for cubic feet per pound (ft3/lb).
toCubicMetersPerKilogramfunction Converts a specific volume value to cubic meters per kilogram (m3/kg).
fromCubicMetersPerKilogramfunction Converts a specific volume value from cubic meters per kilogram (m3/kg).
convertBetweenfunction Converts a pressure value between the two given units.
getNamefunction Retrieves the name of the given specific volume units.
Based on the given units, this method returns one of the following string values: 'Cubic Meters per Kilogram' or 'Cubic Feet per Pound'.
getAbbrevfunction Retrieves the abbreviation of the given specific volume units.
Based on the given units, this method returns one of the following string values: 'm3/kg' or 'ft3/lb'.
getUnitsFromAbbrevfunction Retrieves the specific volume units identifier from the given abbreviation.
Parses the abbreviations 'm3/kg' or 'ft3/lb' into the appropriate unit ID,
-
TEMPERATURE <static, readonly>
-
Provides tools to convert between different temperature units.
Properties:
Name Type Default Description CELSIUSnumber 0 The identifier for degrees Celsius (°C).
FAHRENHEITnumber 1 The identifier for degrees Fahrenheit (°F).
RANKINEnumber 2 The identifier for degrees Rankine (°R).
KELVINnumber 3 The identifier for degrees Kelvin (K).
toCelsiusfunction Converts a temperature value from the given units to Celsius.
fromCelsiusfunction Converts a temperature value in Celsius to the given units.
convertBetweenfunction Converts a temperature value between the two given units.
getNamefunction Retrieves the name of the given temperature units.
Based on the given units, this method returns one of the following string values: 'Celsius', 'Fahrenheit', 'Rankine' or 'Kelvin'.
getAbbrevfunction Retrieves the abbreviation of the given temperature units.
Based on the given units, this method returns one of the following string values: '°C', '°F', '°R' or 'K'.
getUnitsFromAbbrevfunction Retrieves the temperature units identifier from the given abbreviation.
Interprets the abbreviations '°C'/'degC', '°F''degF', '°R'/'degR' or 'K' into the identifiers
CELSIUS | FAHRENHEIT | RANKINE | KELVIN.Example
const kelvin = PD.TEMPERATURE.convertBetween(83.48, PD.TEMPERATURE.FAHRENHEIT, PD.TEMPERATURE.KELVIN); console.log(kelvin); // = 301.75 /// Convert values to degrees Celsius. const c1 = PD.TEMPERATURE.toCelsius(61.7, PD.TEMPERATURE.FAHRENHEIT); const c2 = PD.TEMPERATURE.toCelsius(95.0, PD.TEMPERATURE.FAHRENHEIT); console.log(c1, c2); // = 16.5, 35.0 /// Assign a new value from degrees Celsius. const f1 = new PD.TEMPERATURE.fromCelsius(0.0, PD.TEMPERATURE.FAHRENHEIT); const units_abbrev = PD.TEMPERATURE.getAbbrev(PD.TEMPERATURE.FAHRENHEIT); console.log(f1.toFixed(1) + units_abbrev; // '32.0°F'.
-
:URLSearchParams
URLParams <static, readonly>
-
Allows access to any parameters appended to the page URL.
This uses URLSearchParams which is supported by all the evergreen browsers, other than Internet Explorer.
Type
- URLSearchParams
-
VELOCITY <static>
-
Provides tools to convert between velocity units.
The available velocity unit types are:
PD.VELOCITY.METERS_PER_SECOND,PD.VELOCITY.KILOMETERS_PER_HOUR,PD.VELOCITY.FEET_PER_SECOND,PD.VELOCITY.FEET_PER_MINUTE,PD.VELOCITY.MILES_PER_HOURandPD.VELOCITY.KNOTS.Properties:
Name Type Default Description METERS_PER_SECONDnumber 0 The identifier for meters per second (m/s).
KILOMETERS_PER_HOURnumber 1 The identifier for kilometres per hour (km/h).
FEET_PER_SECONDnumber 2 The identifier for feet per second (ft/s).
FEET_PER_MINUTEnumber 3 The identifier for feet per second (ft/s).
MILES_PER_HOURnumber 4 The identifier for miles per hour (mph).
KNOTSnumber 5 The identifier for knots (kn).
toMetersPerSecondConverts a velocity value to meters per second (m/s).
fromMetersPerSecondConverts a velocity value from meters per second (m/s).
convertBetweenConverts a velocity value between the two given units.
getNamefunction Retrieves the name of the given enthalpy units.
Based on the given units, this method returns one of the following string values: 'Joules per Kilogram', 'kilo-Joules per Kilogram' or 'Btu per Pound'.
getAbbrevRetrieves the abbreviation of the given enthalpy units.
Based on the given units, this method returns one of the following string values: 'J/kg', 'kJ/kg' or 'Btu/lb'.
getUnitsFromAbbrevRetrieves the enthalpy units identifier from the given abbreviation.
Interprets the abbreviations 'J/kg', 'kJ/kg' or 'Btu/lb' into the identifiers
PD.ENTHALPY.JOULES_PER_KILOGRAM | KILO_JOULES_PER_KILOGRAM | BTU_PER_POUND. -
WEATHERDATA <static, readonly>
-
Weather data indexes for the
PD.WeatherData#getMetricmethod.Properties:
Name Type Default Description DRY_BULBnumber 0 Dry Bulb Temperature (°C).
DEW_POINTnumber 1 Dew Point Temperature (°C).
REL_HUMIDITYnumber 2 Relative Humidity (%).
ATM_PRESSUREnumber 3 Atmospheric Pressure (Pa).
ET_SOLAR_HORIZONTALnumber 4 Extraterrestrial Horizontal Radiation (Wh/m2).
ET_SOLAR_DIRECTnumber 5 Extraterrestrial Direct Normal Radiation (Wh/m2).
INFRA_RED_HORIZONTALnumber 6 Horizontal Infrared Radiation from Sky (Wh/m2).
SOLAR_GLOBAL_HORIZONTALnumber 7 Global Horizontal Radiation (Wh/m2).
SOLAR_DIRECT_NORMALnumber 8 Direct Normal Radiation (Wh/m2).
SOLAR_DIFFUSE_HORIZONTALnumber 9 Diffuse Horizontal Radiation (Wh/m2).
ILLUM_GLOBAL_HORIZONTALnumber 10 Global Horizontal Illuminance (Lux).
ILLUM_DIRECT_NORMALnumber 11 Direct Normal Illuminance (Lux).
ILLUM_DIFFUSE_HORIZONTALnumber 12 Diffuse Horizontal Illuminance (Lux).
ILLUM_ZENITHnumber 13 Zenith Luminance (cd/m2).
WIND_DIRECTIONnumber 14 Wind Direction (deg).
WIND_SPEEDnumber 15 Wind Speed (m/s).
CLOUD_COVER_TOTALnumber 16 Total Cloud Cover (%).
CLOUD_COVER_OPAQUEnumber 17 Opaque Sky Cover (%).
VISIBILITYnumber 18 Visibility (km).
CEILING_HEIGHTnumber 19 Ceiling Height (m).
PRECIPITABLE_WATERnumber 20 Precipitable Water (mm).
AEROSOL_DEPTHnumber 21 Aerosol Optical Depth (thou).
SNOW_DEPTHnumber 22 Snow Depth (cm).
SNOW_DAYS_SINCE_LAST_FALLnumber 23 Days Since Last Snowfall (days).
ALBEDOnumber 24 Albedo (0-1).
RAINFALLnumber 25 Precipitation Depth (mm).
-
:string
appID <static>
-
An identifier for your particular app, defaults to 'PD'.
This value is used as a key prefix for all application-based local storage access within the framework. Whilst not always necessary, this does allow for differentiation if there is more than one app served from the same web address or server folder, or you are working on multiple apps using a local web server or via the File URI scheme.
You can change its value for your particular app by either creating the
window.pdAppIdentifiervariable prior to including thesrc/pd/core/pd.jsscript file, or later by including another customisation script that runs some time afterpd.jsbut before thesrc/pd/app/pd-global-state.jsscript file.Type
- string
-
:number
pageScale <static>
-
The current scale required to fit the page on a small screen.
This is used by some SVG charts to deal with UI scaling issues, particularly in some versions of FireFox.
Type
- number
Methods
-
Debounce(callback [, delay]) <static>
-
Creates a function that accumulates multiple invocations onto just one.
This returns a function that does not execute immediately when invoked, but waits for a pause in a stream of invocations that is greater than the given delay period before executing. Each new invocation restarts an internal timer.
This method is different to throttling in that debouncing guarantees no execution until there is a pause in invocations at least as long as the delay time, rather than periodic execution at regular intervals.
Parameters:
Name Type Argument Description callbackfunction A function to call after the delay period.
delaynumber <optional>
The delay before calling in milliseconds (1 to 30,000), defaults to 50ms.
Throws:
-
Throws an error if the given callback is not a function.
- Type
- TypeError
Returns:
Returns a function that waits
delayms before executing.- Type
- function
-
-
DynamicDebounce(callback [, shortDelay] [, longDelay] [, runLen]) <static>
-
Creates a function that accumulates multiple invocations onto just one, and uses a running average of calculation times to dynamically adjust the event accumulation period.
This returns a function that does not execute immediately when invoked, but waits for a pause in a stream of invocations that is greater than the given delay period before executing. Each new invocation restarts an internal timer.
Parameters:
Name Type Argument Description callbackfunction A function to call after the delay period.
shortDelaynumber <optional>
The accumulation period in milliseconds when the calculation is short (1 to 30,000), defaults to 50ms.
longDelaynumber <optional>
The accumulation period in milliseconds when the calculation is long (1 to 30,000), defaults to 250ms.
runLennumber <optional>
Length of the running average queue (1 to 64), defaults to 5.
Throws:
-
Throws an error if the given callback is not a function.
- Type
- TypeError
Returns:
Returns a function that accumulated calls before executing.
- Type
- function
-
-
PolyLabelPos(polygon [, result]) <static>
-
Calculates a good point within a complex polygon to place a label.
This uses polylabel (https://github.com/mapbox/polylabel), a fast algorithm for finding polygon 'pole of inaccessibility', the most distant internal point from the polygon outline (not to be confused with centroid). This is useful for the optimal placement of a text label that is actually within the polygon area, even if it has holes.
It is used in this framework for positioning labels on the floor plans of spaces as well as when inserting apertures and holes in selected surfaces.
The polygon must be given as an array of outer and inner boundary coordinates arrays. For polygons with multiple contours, the first must be the outer boundary ring and any others must be inner rings representing openings or holes.
Parameters:
Name Type Argument Description polygonPD.Polygon The polygon to calculate the best label position for.
resultTHREE.Vector3 <optional>
An optional 3D vector object to receive the label position.
Returns:
Returns the
resultvalue, or a new 3D vector.- Type
- THREE.Vector3
-
Throttle(callback [, delay]) <static>
-
Creates a function that throttles invocations to once per delay period.
This returns a function that does not execute immediately when invoked, but waits for the given delay period before executing. Any subsequent calls within delay period are ignored.
This method is different from debouncing in that it guarantees execution at regular intervals, rather than waiting for a pause in invocations.
Parameters:
Name Type Argument Description callbackfunction A function to call after the delay period.
delaynumber <optional>
The delay before calling in milliseconds (1 to 30,000), defaults to 50ms.
Throws:
-
Throws an error if the given callback is not a function.
- Type
- TypeError
Returns:
Returns a function that waits
delayms before executing.- Type
- function
-
-
WrappedCallback(obj, callback) <static>
-
Creates a function that invokes a callback method with the given object as
this.The aim of wrapping a callback function or method is to ensure that it is always invoked with the given object as
this, regardless of how the wrapper function is called.This is also useful when you want to add an auto-generated listener to an event that can then removed at some later time. Simply store the wrapped callback in a persistent variable, and use it in
removeEventListener()exactly the same way asaddEventListener().Parameters:
Name Type Description objobject The object to use as
thisin the callback.callbackfunction A method on the given object to invoke.
Throws:
-
Throws an error if callback is not a function or object is not valid.
- Type
- TypeError
Returns:
Returns a function that invokes the callback.
- Type
- function
-
-
getDefaultValue(key) <static>
-
Retrieves the value associated with a prefixed key in local storage.
This method modifies the given key by prefixing it with the current value of
PD.appIDfollowed by a full colon, in order to make the data specific for this app. Thus, if a key value ofcolorSchemeis given, and the value ofPD.appIDisPD:SP3D, then the actual key looked up in local storage will bePD:SP3D:colorScheme.You are strongly encouraged to use the methods provided by
PD.GlobalActionsfor accessing local storage instead of this one. These includePD.GlobalActions.getDefaultValue,PD.GlobalActions.setDefaultValueandPD.GlobalActions.removeDefaultValue. This method exists for use internally by the framework when reading application state beforePD.GlobalActionshas been created.Parameters:
Name Type Description keystring The unprefixed name of the item.
Returns:
Returns the value, or null.
- Type
- any | null