Class: Level

BIM. Level

Defines a level or storey within a building or structure.

Levels are typically used to contain all the spatial, building, construction and drawing elements that make up a floor or storey within a BIM.Building or BIM.Structure. As such, they have floorLevel and ceilingHeight properties that define their vertical extents and are aware of the levels immediately above and below them.

However, when part of a BIM.Site, levels serve more as information layers that can be used to group and easily show/hide different parts of the surrounding site or proposed landscaping.

The relationship between the various level height values are shown in the image below.

                              |///|
         ---------------------+---+
         slab above \\\\\\\\\\\\\\|
         ---------------------+---+  < - height
         ceiling space        |///|
         ---------------------+///|  < - ceilingHeight
                              |///|
                              |---|
         open area            | | |
                              | | |
                              | | |
                              | | |
                              |---|
                              |///|
                              |///|
         ---------------------+---+  < - 0.0 (floorLevel)
         slab below \\\\\\\\\\\\\\|
         ---------------------+---+  < - floorSlabDepth
                              |///|

Levels are the point where low-level THREE.js meshes are stored and managed. This allows each level to be quickly and independently turned on/off, animated up/down or faded in/out using mesh-level properties or transforms. Each level has a meshes property that stores a BIM.Meshes object, which is a subclass of THREE.Group and stores three primary meshes and a number of on-demand meshes. The primary meshes are used for rendering surface geometry, transparent glazing, edge outlines, thick and dotted line work as well as text and other annotations. The on-demand meshes are used for showing things like analysis grid data, vegetation and image overlays when they are present on a level.


new Level( [config])

Creates a new level within a building or structure.

Parameters:
Name Type Argument Description
config object <optional>

A configuration object.

Properties of config:
Name Type Argument Description
name string <optional>

The human-readable name for the level.

visible boolean <optional>

Whether or not the level is visible within the model, defaults to true.

ghosted boolean <optional>

Whether or not the level is shown in transparent outline only, defaults to false.

Building BIM.Building <optional>

The building/structure that this level belongs to.

structure BIM.Structure <optional>

The structure/building that this level belongs to.

floorLevel number <optional>

The height to the top of the floor slab above the site reference elevation, in mm.

ceilingHeight number <optional>

The preferred height from floor level to underside of slab above, in mm.

floorSlabDepth number <optional>

The thickness of the floor slab below the floor level, in mm.

connectToLevelAbove boolean <optional>

Whether or not the floor height of the level above is affected by the height of this level.

fitToLevelAbove boolean <optional>

Whether or not spaces and other structural elements should fit to the level above.

sectionHeight number <optional>

The height at which plan-view sections will be cut, in mm.

Author:
  • drajmarsh

Extends

Members


:PD.Octree|null

_octreeGlass

Caches an octree of all transparent glazing surfaces on the level for faster ray-tracing.

Type

:PD.Octree|null

_octreeOpaque

Caches an octree of all opaque surfaces on the level for faster ray-tracing.

Type

:boolean

applySectionPlane

Whether or not to cut the 3D view with the plan section plane.

Type
  • boolean

:Map

attributes

Stores any arbitrary attributes associated with this entity.

This is a simple key/value map that can be used to store any additional information about the entity that may be required by the application such as reference ids, material types, fire ratings, costings, etc.

Type
  • Map
Inherited From:
Overrides:

:BIM.Structure|null

building

The building/structure that this level belongs to.

Type

:number

ceilingHeight

The default height for new rooms and spaces above floor level.

     +---------------+
     +---------------+    :
     - - - - - - - - - <- + - ceilingHeight
                          :
                          :
                          :
     +---------------+ <- + - floorLevel
     +---------------+    :
Type
  • number

:string

className <readonly>

The name of the subclass for this object instance.

This name must match the name of this class within the PD.Registry. Thus, the base implementation simply references this.constructor.getClassName() to ensure that this is always the case even for subclasses. As a result, there is rarely any need to override this method.

This property is used when copying, storing and exporting data for subclass instances to ensure that they are recreated as instances of the right class.

Type
  • string
Inherited From:
Overrides:

:boolean

connectToLevelAbove

Whether or not the floor height of the level above is affected by the height of this level.

When true, the level above this one will have its floorLevel automatically adjusted to be equal to the sum of this level's floorLevel and height properties.

Type
  • boolean

:boolean

cutAndFill

Whether or not this the level boundary cuts and fills terrain elements.

Type
  • boolean

:THREE.Box3

displayExtents

Stores the 3D extents of the displayed meshes.

Internally, all levels and the elements within them are generated relative to a base floor level of zero (Z=0). The generated display meshes are then positioned within the model offset vertically by their actual floor level.

In order to center the current level within the view, the entire model is offset/animated up and down such that the floor plane of the currently selected level is always at absolute zero in the Z axis.

The extents property stores the bounding box of just the contents of the level. The displayExtents property stores the bounding box of the level as it is displayed within the model.

Type
  • THREE.Box3
Inherited From:
Overrides:

:string

displayName <readonly>

The name to display for this class within the user interface.

Type
  • string
Inherited From:
Overrides:

:THREE.Vector3

displayOffset

Stores the current absolute display offset.

Internally, all levels and the elements within them are generated relative to a base floor level of zero (Z=0) and a local origin. The generated display meshes are then positioned within the model offset vertically by their actual floor level.

In order to center the current level within the view, the entire model is offset/animated up and down such that the floor plane of the currently selected level is always at absolute zero in the Z axis.

This vector stores the display offset position of the level meshes within the current editable view. Whilst levels are most ofter just displaced vertically, specific display modes may also move levels laterally. This vector stores the absolute offset of the level within the editable view and is used to adjust rays and frustums for selection.

Type
  • THREE.Vector3
Inherited From:
Overrides:

:Array

elementList

The list of elements in the container.

Type
  • Array
Inherited From:
Overrides:

:BIM.ENTITY

entityType <readonly>

Defines the type of BIM entity this class represents.

This value is used by the PD.Registry for grouping elements and matching components. The base implementation simply references this.constructor.getEntityType() so that only a static method needs to be added to subclasses.

Type
Inherited From:
Overrides:

:THREE.Box3

extents

The 3D extents of the element as a bounding box.

Type
  • THREE.Box3
Inherited From:
Overrides:

:PD.Polyline

externalBoundary

Stores the external boundary shapes of all spaces on the level.

This is used to generate the outer bounds of the floor slab for the level.

    +--------------------------+
    |                          |
    |                          |
    |                          |
    |                          |
    |                          |
    |             +------------+
    |             |
    +-------------+

NOTE: As the slab may consist of more than one separate area that will be extruded upwards, this has to be a closed polyline rather than a polygon so that each contour defines a separate region rather than one or more holes within a single external boundary.

Type

:boolean

fitToLevelAbove

Whether or not spaces and other structural elements should fit to the level above.

This is primarily used to toggle the trimming/extending of walls and other elements to any unclipped roofs on the level above.

Type
  • boolean

:number

floorLevel

The height to the top of the floor slab above the site reference elevation, in mm.

     +---------------+
     +---------------+
     - - - - - - - - -


                          :
     +---------------+ <- + - floorLevel
     +---------------+    :
                          :
   ___________________________
   / / \ \ / / \ \ / / \ \ / /
Type
  • number

:number

floorSlabDepth

The thickness of the floor slab below the floor level, in mm.

     +---------------+
     +---------------+
     - - - - - - - - -


                          :
     +---------------+ <- + - floorLevel
     +---------------+ <- + - floorSlabDepth
                          :
Type
  • number

:PD.Polygon

footprint

Stores the footprint of all the walls between and around spaces.

This is a complex polygon that follows the outer wall boundary, which is the extents of all spaces on the level, with holes for the internal footprint of each space. It is used to generate the top surface(s) of extruded walls.

    +--------------------------+
    | +---------+ +----------+ |
    | |         | |          | |
    | |         | |          | |
    | |         | |          | |
    | |         | +----------+ |
    | |         | +------------+
    | +---------+ |
    +-------------+

NOTE: Even though a level boundary can have multiple separate regions, this needs to be a polygon rather than a closed polyline in order for the internal areas of spaces to be treated as holes within each region.

Type

:boolean

ghosted

Whether or not the container is shown in transparent outline only.

Type
  • boolean
Inherited From:
Overrides:

:boolean

hasChanged

Whether or not the entity has recently changed and needs to update.

This property is typically set by the user interface or other parts of the framework when the entity's properties have changed and any visual representations need to be updated.

Type
  • boolean
Inherited From:
Overrides:

:number

height

The preferred height from floor level to the underside of the slab above, in mm.

     +---------------+    :
     +---------------+ <- + - height
     - - - - - - - - -    :
                          :
                          :
                          :
     +---------------+ <- + - floorLevel
     +---------------+    :
Type
  • number

:string

iconName <readonly>

The name of the SVG icon to associate with this object instance.

This name should match the name of the icon associated with this class within the PD.Registry. Thus, the default implementation simply references this.constructor.getClassName() to ensure that this is always the case, even for subclasses. However, you can override this property if you want a different icon dependant on other properties of the class instance, as shown in the example below.

Type
  • string
Inherited From:
Overrides:
Example
// Overriding the icon name.

MyElements.Table = class extends PD.Base {
    /// ...
    get iconName() {
        if (this.hasRoundTop) return 'MyElements.Table.Round';
        return this.constructor.getClassName();
    };
    /// ...
 };

:number

id

A unique integer identifier for fast discovery and/or equality checking.

This identifier is unique within the current project data and is primarily intended to facilitate fast lookup and equality checking. It is assigned automatically when the renderable is created and should not change. It is much simpler than the uuid property, being a numeric integer rather than a long string of characters, and is the preferred way of comparing renderable entities to see if they are the same.

Type
  • number
Inherited From:
Overrides:

:boolean

isEntity <readonly>

A flag identifying this object as an entity.

Type
  • boolean
Inherited From:
Overrides:

:boolean

isLevel <readonly>

A flag identifying this object as a level in a building or structure.

Type
  • boolean

:boolean

isRenderable <readonly>

A flag identifying this object as a renderable container for elements.

Type
  • boolean
Inherited From:
Overrides:

:BIM.Level|null

levelAbove

The next level immediately above this one, if any.

This is set when the sortLevels() method is called on the parent building or structure.

Type

:BIM.Level|null

levelBelow

The previous level immediately above this one, if any.

This is set when the sortLevels() method is called on the parent building or structure.

Type

:BIM.Meshes

meshes

A collection of meshes required to render elements.

Type
Inherited From:
Overrides:

:string

name

A human-readable name for this item instance.

Type
  • string
Inherited From:
Overrides:

:PD.Polygon

planSection

The plan-section view boundary of the level.

This is basically the footprint with the areas of each aperture that crosses the plan section plane removed from it. The height of the plan section plane is defined by the sectionHeight property.

    +---------------+      +---+
    | +---------+ +-+      +-+ |
    | |         +-+          | |
    +-+                      | |
                +-+          | |
                | +----------+ |
    +-+         | +------------+
    | +---------+ |
    +-------------+

NOTE: Even though a level boundary can have multiple separate regions, this needs to be a polygon rather than a closed polyline in order for the internal areas of spaces to be treated as holes within each region.

Type

:number

sectionHeight

The height at which plan-view sections will be cut through walls and apertures, in mm.

     +---------------+
     | +-------------+
     | | - - - - - - -
     +-+
      :                  :
 -  - :-  -  -  -  -  <- + - sectionHeight
     +-+                 :
     | +-------------+ <- + - floorLevel
     +---------------+   :
Type
  • number

:THREE.Plane|null

sectionPlane

The plane to cut 3D level meshes with.

Type
  • THREE.Plane | null

:boolean

selected

Whether or not the entity is in the current selection set.

This property is typically set by the user interface when the user selects or deselects entities within the model view. The PD.SelectionManager uses this property to keep track of which entities are currently selected.

Type
  • boolean
Inherited From:
Overrides:

:PD.Shell

shell

Stores the external 3D shell geometry for this level.

This shell is used to store the extruded walls and other generated geometry that belongs to the level as a whole rather than any element within it.

Type

:BIM.Level|string|null

snapLevel

An upper or lower level to snap to, as either a level or UUID string.

Type

:Array.<BIM.Space>

spacesAboveLevelHeight

Stores a list of spaces whose top height is above the level height.

This information is stored to allow the level(s) above to quickly analyse and accommodate such spaces.

                                       Level 3
     ---                              ---------
                       +-----------+
                       |           |   Level 2
     ---  +------------+           |  ---------  Z
          |            |           |             |
          |  Space 1   |  Space 2  |   Level 1   |
     ---  +------------+-----------+  ---------  o----> X
Type

:Array.<BIM.Space>

spacesWithFloorVoids

Stores a list of spaces on this level that contain holes in their floors.

This information is stored to allow such holes to propagate through the ceilings of the level(s) below this one.

Type

:BIM.Structure|null

structure

The building/structure that this level belongs to.

Type

:BIM.TraceImage

traceImage

Stores information about the underlay trace image.

Each renderable can store an image to show as an underlay or for tracing over to create model geometry. This property stores the metadata, size and position of that image.

Type
Inherited From:
Overrides:

:ClipperLib.Paths

unclippedRoofs

Stores information about unclipped roofs on this level and, potentially, any unclipped roofs on the level above.

If a roof element has its BIM.Roof#clipToLevel property set to false and is either raised up above floor level or has its BIM.Roof#inclinedCeilings property set to true, then the level will try to trim or extend any overlapping space, wall and balcony elements to it.

If the level has its connectToLevelAbove flag set to true, and the level above it has one or more unclipped roofs, then spaces and walls on this level also need to be trimmed or extended to those roofs as well.

Unclipped roofs found on this level are stored within the roofList array. If this array is not empty, the level will generate a ClipperLib.Paths entry for each downwards-oriented face in the roof's BRep, for each roof element in the list. The clipPlanes array is then used to associate a ClipperLib path` and vertical offset with the corresponding BRep face so that the face's plane equation can be used to convert 2D clipped points back to 3D.

If there are unclipped roofs on the level above, these are also added to the clipPlanes array, with an additional vertical offset to account for the difference in floor levels between the two levels. Thus, for faces belonging to this level, the offsetZ array entry value will be zero. For faces belonging to the level above, the value will be the difference in floor levels between the two levels.

The clipPlanes array is then used to generate the outerBoundary path, which is the outer boundary of all ClipperLib paths in the clip list. This outer boundary is used to compute the wall tops and space ceilings that are not covered by any unclipped roofs.

Type
  • ClipperLib.Paths

:string

uuid

A universally unique identifier for the item instance.

Type
  • string
Inherited From:
Overrides:

:boolean

visible

Whether or not the entity is visible within the model.

The framework tries its best to avoid rendering invisible entities, but depending on the type of entity and how it is represented, this may not always be possible. For example, not rendering a chair is

Type
  • boolean
Inherited From:
Overrides:

:object

icon <static>

The icon associated with this class in the PD.Registry.

See PD.Base.icon for more information on this object format.

Type
  • object

Methods


OLD_generateLevelFootprint(show3d [, forceUpdate])

Generates the complex footprint of the level by unioning all its space and external wall elements.

Parameters:
Name Type Argument Default Description
show3d boolean

Whether the model is rendered in 3D rather than plan.

forceUpdate boolean <optional>
false

Whether or not to rebuild elements even if not unchanged, defaults to false.


OLD_prepareChildElements( [forceUpdate])

Prepare level and its elements for rendering.

Ths method first updates all elements, then checks for space elements for junctions that have external apertures and roof elements that are unclipped to the level boundary.

Parameters:
Name Type Argument Default Description
forceUpdate boolean <optional>
false

Whether or not to rebuild elements even if unchanged, defaults to false.

Returns:

Returns a list of junctions with apertures in them.

Type
Array

addElement(element [, index])

Add an element to this container.

Parameters:
Name Type Argument Description
element BIM.Element

The element to add.

index number <optional>

An optional ordinal index at which to insert it.

Inherited From:
Overrides:
Returns:

Returns true if the element was successfully added, otherwise false.

Type
boolean

afterRebuild()

Finalises meshes after container has been rebuilt.

Inherited From:
Overrides:

beforeRebuild()

Initialise meshes prior to rebuilding the container.

Inherited From:
Overrides:

checkDynamicParameter(param, group)

Checks the allowable range of level parameter values.

See the PD.Base#checkDynamicParameter method for more details.

Parameters:
Name Type Description
param PD.Parameter

The parameter that is being interactively changed.

group PD.ParamGroup

The group that the dynamic parameter belongs to.

Inherited From:
Overrides:
Example
checkDynamicParameter(param, group, host) {

     switch (param.name) {

         case 'height':
             if (param.value < 1.0) param.value = 1.0;
             break;

         case 'width':
         case 'length':
             if (param.value < 100.0) param.value = 100.0;
             if (this.standardBedSize > 0) { // If not custom.
                 group.setParameterValue('standardBedSize', 0);
                 this.standardBedSize = 0; // Make it custom.
             }
             break;

         case 'standardBedSize': {
                 const std_bed = this.getStandardBedSize(Math.round(param.value));
                 if (std_bed != null) {
                     const [ width, length ] = (PD.DIMENSION.useImperial) ? std_bed.sizeImperial : std_bed.sizeMetric;
                     this.width = PD.Utils.toNumber(width, this.width);
                     group.setParameterValue('width', this.width);
                     this.length = PD.Utils.toNumber(length, this.length);
                     group.setParameterValue('length', this.length);
                 }
             } break;

       }

 };

clear()

Clears everything from this container so it can be reused.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

clearTraceImage()

Removes the texture and image mesh, and releases them from the GPU.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

clone()

Creates a copy of this instance with different name and uuid.

Inherited From:
Overrides:
Returns:

Returns a new instance with copied values.

Type
PD.Base | null

computeDisplayOffset()

Calculates and returns the relative display offset vector.

This method updates the displayOffset property by adding the model display position to the level meshes position.

In order to center the current level within the view, the entire model is offset/animated up and down such that the floor plane of the currently selected level is always at absolute zero in the Z axis.

This means that the display offset changes each time a new level is selected, and dynamically when the model is animated up/down. Thus, this method should be called before any interactive selection to update the value.

Inherited From:
Overrides:
Returns:

Returns the relative display offset vector.

Type
THREE.Vector3

computeExtents( [all])

Calculates the extents of the container from all its (visible) elements.

Internally, all levels and the elements within them are generated relative to a base floor level of zero (Z=0). The generated display meshes are then positioned within the model offset vertically by their actual floor level.

In order to center the current level within the view, the entire model is offset/animated up and down such that the floor plane of the currently selected level is always at absolute zero in the Z axis.

The extents property stores the bounding box of just the contents of the level, whilst the displayExtents property stores the bounding box the level as it is displayed within the model. This method calculates and updates both.

Parameters:
Name Type Argument Description
all boolean <optional>

When true, all elements are included rather than only visible ones.

Inherited From:
Overrides:
Returns:

Returns the newly computed extents bounding box.

Type
THREE.Box3

computeLinearProfileFromFacets(shell, p1, p2, plane, defaultHeight)

Computes a profile of intersection lines between unclipped roof faces and the given plane, spanning coplanar points p1 and p2.

As BRep faces can be planar or curved (non-planar), this method needs to be robust enough to accommodate any kind of geometry that a BRep can store. It also needs to be able to identify gaps between faces or areas of the profile not covered by any part of the roof.

To achieve this, this method uses a combination of plane/BRep intersection and ray-tracing to determine the intersection points. The plane/BRep intersection gives accurate face boundary edge points, whilst using a vertical ray just before and just after each point allows for accurate height step determination regardless of how many coincident edges there may be at each intersection.

Parameters:
Name Type Description
shell PD.Shell

The shell to use for new points.

p1 PD.Point

The starting point in XY plane.

p2 PD.Point

The ending point in XY plane.

plane THREE.Plane

The plane equation of the line (p1->p2).

defaultHeight number

The default height when not covered by facets.

Returns:

Returns an array of zero or more profile points between p1 and p2.

Type
Array.<PD.Point>

containsElement(element)

Checks if the container contains the given element.

Parameters:
Name Type Description
element BIM.Element

The element to check.

Inherited From:
Overrides:
Returns:

Returns true if this container contains the element.

Type
boolean

deleteAttribute(name)

Removes an attribute from this entity.

Parameters:
Name Type Description
name string

The name of the attribute to remove.

Inherited From:
Overrides:
Returns:

Returns this entity to support method chaining.

Type
PD.Base

extendStructureToUnclippedRoofs()

Checks if the level should extend to unclipped roof elements on this or the level above.

Returns:

Returns true if this level or the level above has unclipped roof elements to extend spaces and walls to.

Type
boolean

fadeIn( [speed])

Fades the container from zero to full opacity.

Parameters:
Name Type Argument Description
speed number <optional>

An optional animation speed in ms, defaults to global animation speed.

Inherited From:
Overrides:

fadeOut( [speed])

Fades the container to zero from its current opacity.

Parameters:
Name Type Argument Description
speed number <optional>

An optional animation speed in ms, defaults to global animation speed.

Inherited From:
Overrides:

findByRay(selection, event)

Checks if the given ray intersects this level and updates the selection.

This method is typically called on levels other than the currently selected level, on which the local model origin is based. Thus, the given selection ray is automatically modified by the level's display offset for testing and then reset back to its original condition. There is no need to modify the selection ray manually before calling this method.

Parameters:
Name Type Description
selection PD.Selection

The interactive selection accumulator.

event Event

The DOM event that triggered this selection.

Returns:

Returns true if the level was intersected and selected.

Type
boolean

findClosestElementByRay(selection, event [, selectedElement])

Finds the closest element in the element list.

This method fills out the selection object with information on the closest element.

NOTE: This method does not check that the PD.GlobalState.selectElements flag is true before testing and adding elements to the selection as it may be used by simulation and analysis classes for purposes unrelated to interactive selection. If used for interactive selection, however, the calling function must first check that PD.GlobalState.selectElements is true before calling this method.

This method is typically called only on the currently selected level, on which the local model origin is based. Thus the given selection ray is not modified by the level's display offset. To use this method on a non-current level, you will need to modify the selection ray manually before calling it, as shown below.

Parameters:
Name Type Argument Description
selection PD.Selection

The interactive selection accumulator.

event Event

The DOM event that triggered this selection.

selectedElement BIM.Element <optional>

The element currently selected within the model.

Inherited From:
Overrides:
Returns:

Returns true if something in the model was selected and the selection updated, otherwise false.

Type
boolean
Example
function findClosestElementByRay(selection, event, selectedElement) {

    let found = false;

    for (const level of myLevelContainer.levelList);

        /// ### -> Accommodate display position.
        selection.ray.origin.sub(level.computeDisplayOffset());

        if (level.findClosestElementByRay(selection, event, selectedElement)) {
            /// Act on `selection.closestElement`...
            found = true;
        }

        /// ### -> Reset ray position.
        selection.ray.origin.add(level.displayOffset);

    }

    return found;

}

findClosestFeatureByRay(selection, event [, selectedElement] [, selectedType])

Finds the closest feature in the element list.

This method fills out the selection object with information on the closest junction, path segment, aperture or element. If the selection.currentElement value is not null, then priority for selection is given to this element.

This method is typically called only on the currently selected level, on which the local model origin is based. Thus the given selection ray is not modified by the level's display offset. To use this method on a non-current level, you will need to modify the selection ray manually before calling it, as shown below.

Parameters:
Name Type Argument Description
selection PD.Selection

The interactive selection accumulator.

event Event

The DOM event that triggered this selection.

selectedElement BIM.Element <optional>

The element currently selected within the model.

selectedType PD.SELECTED <optional>

The current model selection type, defaults to PD.SELECTED.NONE.

Inherited From:
Overrides:
Returns:

Returns true if something in the model was selected and the selection updated, otherwise false.

Type
boolean
Example
function findClosestFeatureByRay(selection, event, selectedElement, selectedType) {

    let found = false;

    for (const level of myLevelContainer.levelList);

        /// ### -> Accommodate display position.
        selection.ray.origin.sub(level.computeDisplayOffset());

        if (level.findClosestFeatureByRay(selection, event, selectedElement, selectedType)) {

            switch (selection.selectedType) {

                case PD.SELECTED.ELEMENT:
                    /// Act on `selection.closestElement`...
                    found = true;
                    break;

                case PD.SELECTED.SEGMENT:
                case PD.SELECTED.JUNCTION:
                    /// Act on `selection.closestJunction`...
                    found = true;
                    break;

                case PD.SELECTED.APERTURE:
                    /// Act on `selection.closestAperture`...
                    found = true;
                    break;

            }

        }

        /// ### -> Reset ray position.
        selection.ray.origin.add(level.displayOffset);

    }

    return found;

}

generateCeilingFacets(shell, ceilingPaths)

Generates the intersection between unclipped roof facet paths and an space inner footprint path.

Parameters:
Name Type Description
shell PD.Shell

The shell to add ceiling facets to.

ceilingPaths Array.<Array.<PD.ClipPt2D>>

The boundary intersection.

Returns:

Returns any newly added shell facets.

Type
Array.<PD.Polygon>

generateExternalBoundarySurfaces()

Extrudes the PD.Level#externalBoundary polyline vertically, checking for any clipping roof geometry and trimming or extending the facets as required.

The very first surface in the resulting facets array will always be the bottom surface of the level's slab, followed by the vertical boundary surfaces.

The tops of the

Returns:

Returns a list of generated facets.

Type
Array.<PD.Polygon>

generateLevelFootprint(show3d [, forceUpdate])

Generates the complex footprint of the level by unioning all its space and external wall elements.

Parameters:
Name Type Argument Default Description
show3d boolean

Whether the model is rendered in 3D rather than plan.

forceUpdate boolean <optional>
false

Whether or not to rebuild elements even if not unchanged, defaults to false.


generatePathKdTree()

Computes a KDTree of all space path junctions on the level.

This tree is generated on demand and used to quickly determine coincident and co-linear junctions on adjacent paths, as well as potential intersections. It is also used when adding virtual junctions on adjacent paths that sub-surfaces between adjacent spaces can be more easily determined.

Returns:

Returns a KDTree of the space path junctions.

Type
PD.Path.KDTreeXY

generateUnclippedRoofMap()

Searches though BIM.Level#unclippedRoofs.roofList and creates a map of each downwards-oriented BRep faces with their associated ClipperLib path in the XY plane.

It also generates an octree of these faces for quick searching. This map and octree are then used to extend/trim the extruded external surfaces of the level boundary as well as the inner surfaces of each space and wall on the level.


generateWallTopFacets(shell, footprintPaths [, clipper])

Generates tops for all the walls extended up to the bottoms of unclipped roofs.

This method uses the level footprint path (from which all walls are extruded) and intersects it with all the downward-facing unclipped roof surfaces on this level. Any intersections are used to create new wall top facets.

It also creates the outer boundary of all the roof areas and subtracts this from the level footprint path to get any leftover wall tops outside the extended area. This is stored in BIM.Level#unclippedRoofs.outerBoundary for use when extending individual space ceiling facets.

Parameters:
Name Type Argument Description
shell PD.Shell

The shell to add wall facets to.

footprintPaths Array.<Array.<PD.ClipPt2D>>

The paths defining the level footprint.

clipper ClipperLib.Clipper <optional>

The clipper to use, defaults to PD.Clipper.startClip.

Returns:

Returns any newly added shell facets.

Type
Array.<PD.Polygon>

getAttribute(name)

Retrieve an attribute stored on this entity, if it exists.

Parameters:
Name Type Description
name string

The name of the attribute to retrieve.

Inherited From:
Overrides:
Returns:

Returns the attribute value, or undefined if it does not exist.

Type
any | undefined

getCSGEnvelope()

Lazily generates and returns a PD.Solid CSG envelope corresponding to the external boundary extruded by the level height.

If the level is set to connectToLevelAbove, then the envelope is extruded to just above the level extents.

Returns:

Returns a PD.Solid representing the level envelope.

Type
PD.Solid

getDynamicParameters( [no_title])

Provides a list of dynamic parameter groups for this level.

See the PD.Base#getDynamicParameters method for more details.

Parameters:
Name Type Argument Description
no_title boolean <optional>

If true, the group is displayed without a section title.

Inherited From:
Overrides:
Returns:

Returns an array of PD.ParamGroup objects.

Type
Array
Example
getDynamicParameters(host) {
     return [
         new PD.ParamGroup({
             name: 'mainParams',
             title: 'Table Parameters',
             target: this,
             params: [
                 new PD.Parameter({ name: 'height', title: 'Table Height', value: this.height, paramType: PD.ParamType.SmallDistance, description: 'The height from floor level to the top of the table.' }),
                 new PD.Parameter({ name: 'size', title: 'Table Top Size/Diameter', value: this.size, paramType: PD.ParamType.Distance, description: 'The size of the table top when not defined by a closed path.' }),
                 new PD.Parameter({ name: 'thickness', title: 'Table Top Thickness', value: this.thickness, paramType: PD.ParamType.SmallDistance, description: 'The thickness of the table top surface.' }),
                 new PD.Parameter({ name: 'offset', title: 'Offset From Path', value: this.offset, paramType: PD.ParamType.SmallDistance, description: 'The offset distance from the table path.' }),
                 new PD.Parameter({ name: 'swapSides', title: 'Swap Sides', value: this.swapSides, paramType: PD.ParamType.Boolean, description: 'Reverse the direction of the table relative to its path.' }),
                 new PD.Parameter({ name: 'isRound', title: 'Round Table', value: this.isRound, paramType: PD.ParamType.Boolean, description: 'Whether or not the table surface is round.'  }),
             ]
         }),
         new PD.ParamGroup({
             name: 'legParams',
             title: 'Leg Parameters',
             target: this,
             params: [
                 new PD.Parameter({ name: 'legCount', title: 'Number of Legs', value: this.legCount, paramType: PD.ParamType.Integer, description: 'The number of legs on the table.' }),
                 new PD.Parameter({ name: 'legSize', title: 'Leg Size', value: this.legSize, paramType: PD.ParamType.SmallDistance, description: 'The thickness of each leg of the table.' }),
                 new PD.Parameter({ name: 'legInset', title: 'Leg Edge Inset', value: this.legInset, paramType: PD.ParamType.SmallDistance, description: 'The inset distance of each leg from the table edge.' }),
                 new PD.Parameter({ name: 'legOffset', title: 'Leg Edge Offset', value: this.legOffset, paramType: PD.ParamType.Fraction, description: 'The relative distance of the leg along each edge span.' }),
                 new PD.Parameter({ name: 'legSpan', title: 'Max. Distance Between Legs', value: this.legSpan, paramType: PD.ParamType.Distance, description: 'The maximum distance between legs along each edge span.' })
             ]
         })
     ];
 };

getElements(filterFn)

Retrieves a list of elements in the container filtered down to just those that pass the test implemented in the provided callback function.

The callback function takes an element from the container as an argument and should apply a test that returns true to add the element to the returned list or false to skip it.

Parameters:
Name Type Description
filterFn function

A callback function suitable for use with Array.filter().

Inherited From:
Overrides:
Returns:

Returns an array of elements that passed the callback test.

Type
Array
Example
const my_space = ...
const other_spaces = my_space.level.getElements((element, index, array) => {
    return element.isSpace && (element.uuid != myspace.uuid);
});

getExternalBoundaryClipPath()

Retrieves the ClipperLib path(s) of the level's external boundary.

This method can be used in an element's rebuild method to check if there is a valid external boundary to clip itself to. The returned path is a ClipperLib-compatible array of 2D {X,Y} points, or null if the level has no spatial elements or is not yet updated.

Returns:

Returns the external boundary ClipperLib path.

Type
Array.<PD.ClipPt2D> | null

getFloorToFloorHeight()

Retrieves the relative height of the floor of the level above this one.

Returns:

Returns the floor-to-floor height in mm.

Type
number

getInternalWallHeight()

Retrieves the height of internal walls from top of floor to bottom of slab above.

Returns:

Returns the internal height.

Type
number

getMeshPosHeight()

Retrieves the current model height at which this level's rendered meshes are displayed.

Inherited From:
Overrides:
Returns:

Returns the model height of the level's meshes.

Type
number

getOpacity()

Retrieves the container's current mesh opacities.

Inherited From:
Overrides:
Returns:

Returns the container mesh opacity (0 to 1).

Type
number

getRefPos()

Retrieves the drawable's reference position.

The reference position stores the drawable's original starting position at the beginning of a dynamic animation.

As this is not always required or used, this is actually a getter for a vector object that is dynamically created as an attribute when first accessed.

Inherited From:
Overrides:
Returns:

Returns the reference position.

Type
THREE.Vector3

getStructureAsIndexedShell()

Extracts the building structure from the level.

Returns:

Returns an indexed face mesh containing the built structure.

Type
object

getTargetPos()

Retrieves the drawable's target display position.

The display position stores the drawable's target position during a dynamic animation.

As this is not always required or used, this is actually a getter for a vector object that is dynamically created as an attribute when first accessed.

Inherited From:
Overrides:
Returns:

Returns the display position.

Type
THREE.Vector3

hasClippedElements( [update])

Checks if any elements in the level are clipped to the level boundary.

When the update argument is false or not given, this method simply checks for any clipped elements and returns true if any are found.

If the update argument is true, then each element that is clipped to the level boundary will have its hasChanged flag set to true so that it will be rebuilt next time the level is rebuilt.

Parameters:
Name Type Argument Default Description
update boolean <optional>
false

When true, each clipped element will have its hasChanged flag set to true, defaults to false.

Returns:

Returns true if any elements are clipped to the level boundary.

Type
boolean

hasContent()

Checks if the container has any elements.

Inherited From:
Overrides:
Returns:

Returns true if the container has content.

Type
boolean

hasUnclippedRoofs()

Checks if the level has unclipped roof elements.

Unclipped roof elements are roof elements that are not clipped to the level boundary, and cover any spaces that exist on the same level.

Returns:

Returns true if the level has unclipped roof elements.

Type
boolean

highlight(mesh, view)

Renders a highlighted view of the level to show it as selected.

Parameters:
Name Type Description
mesh PD.PolyMesh

The selection mesh to render highlighting to.

view PD.ViewData

The view definition to render the model within.

Returns:

Returns true if anything was added to the mesh.

Type
boolean

intersectExtents(ray, intersection)

Determines if the given ray intersects the entity extents.

Parameters:
Name Type Description
ray THREE.Ray

The ray to find the intersection for.

intersection THREE.Vector3

The vector to store the intersection point, if any.

Inherited From:
Overrides:
Returns:

Returns the intersection point, or null if no intersection.

Type
THREE.Vector3 | null

intersectLightRay(ray, result)

Handles the intersection of a light or shading ray with this element.

This method typically intersects the ray with the BIM.Element#shell if it has one. Override this method in your custom element if it needs to handle light ray intersections differently.

Parameters:
Name Type Description
ray THREE.Ray

The ray defining the origin and direction of the light ray.

result object

An object containing information about the light ray.

Properties of result:
Name Type Description
intersection THREE.Vector3

Stores the triangle intersection point as a {x,y,z} vector.

transmittance number

Stores the accumulated transmittance of all intersected surfaces.

reflectance number

Stores the accumulated reflectance from all intersected surfaces.

color number

Stores the color of the primary intersected surface.

Returns:

Returns true if the light ray hit an opaque surface and updated results.

Type
boolean

isInsideAnySpace(element)

Determine if the given element is inside a space on this level.

Parameters:
Name Type Description
element BIM.Element

The element to check for a host space.

Returns:

Returns the space that the element is in, or null.

Type
BIM.Space | null

isLevelAboveVisible()

Determines if the level above this one is visible.

Returns:

Returns true if the level above is visible.

Type
boolean

isLevelBelowVisible()

Determines if the level below this one is visible.

Returns:

Returns true if the level above is visible.

Type
boolean

loadTraceImage(image_url, callback)

Loads in and displays a floor plan image for tracing.

Parameters:
Name Type Description
image_url string

The url of the image to load.

callback function

The callback function once loaded.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

markGeometryAsChanged()

Tells the level that its geometry has changed.

Returns:

Returns this level to support method chaining.

Type
BIM.Level

moveLevelToTargetPos(fraction)

Interpolates the container towards its target display position.

Parameters:
Name Type Description
fraction number

The interpolation fraction (0 to 1), defaults to 1.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

needsRebuild( [force])

Checks whether the level needs to be rebuilt.

If the force argument is true, the level will be flagged for a full rebuild during the next call to the rebuild method.

Parameters:
Name Type Argument Default Description
force boolean <optional>
false

An optional flag to force a rebuild, defaults to false.

Inherited From:
Overrides:
Returns:

Returns true if a rebuild is required.

Type
boolean

overlapsElevation(level, height)

Checks if the given level overlaps the given elevation height.

Parameters:
Name Type Description
level BIM.Level

The level to check against.

height number

The elevation height to check.

Returns:

Returns true if level overlaps height.

Type
boolean

overlapsLevelInElevation(level)

Checks if the given level overlaps this level in vertical height.

Parameters:
Name Type Description
level BIM.Level

Another level to check against.

Returns:

Returns true if level extents overlap in XY plane.

Type
boolean

overlapsLevelInPlan(level)

Checks if the given level overlaps this level in plan view.

As this check is done when levels are first created, if either of the level's bounding box is empty, then they are considered to overlap.

Parameters:
Name Type Description
level BIM.Level

Another level to check against.

Returns:

Returns true if level extents overlap in XY plane.

Type
boolean

prepareChildElements( [forceUpdate])

Prepare level and its elements for rendering.

Ths method first updates all elements, then checks for space elements for junctions that have external apertures and roof elements that are unclipped to the level boundary.

Parameters:
Name Type Argument Default Description
forceUpdate boolean <optional>
false

Whether or not to rebuild elements even if unchanged, defaults to false.

Returns:

Returns a list of junctions with apertures in them.

Type
Array

rebuild( [forceUpdate] [, refView])

Rebuilds the model mesh based on recent changes to the model.

Parameters:
Name Type Argument Default Description
forceUpdate boolean <optional>
false

Whether or not to rebuild level even if unchanged, defaults to false.

refView PD.View <optional>

An optional reference view data object to copy, defaults to the global view.

Inherited From:
Overrides:
Returns:

Returns this level to support method chaining.

Type
BIM.Level

rebuildDetailed(view [, forceUpdate])

Generates the detailed geometry of the level.

NOTE: This method also sets the inner and outer boundaries.

Parameters:
Name Type Argument Description
view PD.ViewData

The view data to use for rendering the model.

forceUpdate boolean <optional>

Whether or not to rebuild level even if unchanged, defaults to false.

Returns:

Returns true if any meshes changed.

Type
boolean

rebuildElementWithOwnMeshes(element)

Rebuilds and re-renders the given elements that uses it's own mesh(es).

This method can be used by elements who use their own mesh and don't need the entire container to update when they change.

Parameters:
Name Type Description
element BIM.Element

The element to update and re-render.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

rebuildSiteMesh()

Rebuilds and re-renders only those elements that use the site mesh.

This method can be used by those elements whose BIM.Element#onlyUsesSiteMesh property is true instead of BIM.Level#rebuild to bypass a full container rebuild and only update the site mesh.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

rebuildSpatial(view [, forceUpdate])

Rebuilds the model from simple spatial volumes.

Parameters:
Name Type Argument Description
view PD.ViewData

The view data to use for rendering the model.

forceUpdate boolean <optional>

Whether or not to rebuild level even if unchanged, defaults to false.

Returns:

Returns true if any meshes changed.

Type
boolean

removeElement(element)

Removes an element from this container.

Parameters:
Name Type Description
element BIM.Element

The building element to remove.

Inherited From:
Overrides:
Returns:

Returns the ordinal index of the removed element, or -1 if not found on this container.

Type
number

renderElementPaths(mesh)

Renders the paths of visible elements to the scene.

This is used primarily during interactive drag actions as a visual indicator for snapping.

Parameters:
Name Type Description
mesh PD.PolyMesh

the mesh to render paths to.

Inherited From:
Overrides:

renderExternalEnvelope(mesh)

Renders only the external envelope of the level to a mesh.

Parameters:
Name Type Description
mesh PD.PolyMesh

The mesh to render the envelope to.


selectByFrustum(selection)

Checks if the level is inside frustum and updates the selection.

Parameters:
Name Type Description
selection PD.Selection

The interactive selection accumulator.

Returns:

Returns true if the level was selected, otherwise false.

Type
boolean

setAttribute(name, value)

Stores an attribute on this entity, or replaces it's existing value.

Parameters:
Name Type Description
name string

The name of the attribute to store.

value string

The attribute value to store.

Inherited From:
Overrides:
Returns:

Returns this entity to support method chaining.

Type
PD.Base

setDefaultOpacity(show3d)

Sets the container's mesh opacities to default values.

Parameters:
Name Type Description
show3d boolean

Whether the model is rendered in 3D rather than plan.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

setExtents(bbox)

Set the 3D extents of the element as a bounding box.

Override this method in bounding box driven building elements such as equipment, imported or parametric meshes to rescale or regenerate their underlying geometry whenever it changes.

Parameters:
Name Type Description
bbox THREE.Box3

The new bounding box extents to set.

Inherited From:
Overrides:
Returns:

Returns this entity to support method chaining.

Type
PD.Base

setMeshPosHeight(z)

Sets the display height of this level.

Internally, all levels and the elements within them are generated relative to a base floor level of zero (Z=0). The generated display meshes are then positioned within the model offset vertically by their actual floor level.

In order to center the current level within the view, the entire model is offset/animated up and down such that the floor plane of the currently selected level is always at absolute zero in the Z axis.

This method sets the Z axis value of the level's meshes and updates the absolute display offset and extents to match.

Parameters:
Name Type Description
z number

The height to display the level at, in model units.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

setRefPos( [pos])

Sets the reference position to the given or current position.

As this is not always required or used, this is actually a setter for a vector object that is dynamically created as an attribute when first accessed.

Parameters:
Name Type Argument Description
pos THREE.Vector3 <optional>

An optional point to set, defaults to current mesh position.

Inherited From:
Overrides:
Returns:

Returns this renderable to support method chaining.

Type
BIM.Renderable

setTargetPos( [pos])

Updates the reference position to the given or current position.

As this is not always required or used, this is actually a setter for a vector object that is dynamically created as an attribute when first accessed.

Parameters:
Name Type Argument Description
pos THREE.Vector3 <optional>

An optional point to set, defaults to the current mesh position.

Inherited From:
Overrides:
Returns:

Returns this renderable to support method chaining.

Type
BIM.Renderable

setVerticalScale(scale)

Sets the vertical scale factor of the container.

This is primarily used in 2D to 3D animated transitions.

Parameters:
Name Type Description
scale number

A new vertical scale (0.01 to 1.0).

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

showShadows(state)

Sets the display of shadows within this container.

Parameters:
Name Type Description
state boolean

Whether or not to show shadows.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

storeSpacesWithFloorVoids()

Compiles an array of spaces on the level that have floor voids.

Returns:

Returns an array of spaces with holes.

Type
Array.<BIM.Space>

trimVerticalFacetsToUnclippedRoofs(shell, defaultHeight [, reverse])

Trim or extend all vertically extruded rectangular surfaces in the given shell to the current underside of any unclipped roof shapes.

Without using a full-on geometry kernel, trimming or extending a set of planer surfaces to another set of arbitrarily shaped planar surfaces is not a trivial problem. It is not fundamentally difficult, but there are just so many edge cases that can trip up different approaches, many of which are due to numerical issues which cause surfaces to not exactly line up with each other.

This method is an attempt at a fundamentally robust solution that is relatively fast and sufficiently flexible to deal with those kinds of numerical issues. It uses a combination of surface/plane intersection and ray-tracing to accurately compute the trimmed/extended profile for each surface and handle discontinuities or gaps between roof surfaces.

NOTE: This method expects a set of vertically extruded surfaces in the shell, which means rectangular facets with four (4) vertices - two above the centroid of the surface and two below.

Parameters:
Name Type Argument Description
shell PD.Shell

The shell to trim or extend.

defaultHeight number

The default height when not under a roof facet.

reverse number <optional>

Whether to reverse the orientation of surfaces, defaults to false.

Returns:

Returns the modified shell facet list.

Type
Array.<PD.Polygon>

update( [forceUpdate])

Updates all elements and checks to rebuild their geometry.

Parameters:
Name Type Argument Description
forceUpdate boolean <optional>

Whether or not to rebuild elements even if unchanged, defaults to false.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

updateDisplayOffset()

Recalculates the relative display offset and updates the displayed extents.

This method updates both the displayOffset property and the displayExtents bounding box. This method is called each time the display position or height of the level is set.

Inherited From:
Overrides:
Returns:

Returns this container to support method chaining.

Type
BIM.Renderable

updateDynamicOpacity( [surface_fade] [, outline_fade])

Updates the container's mesh opacities based on dynamic PD.GlobalState values.

Parameters:
Name Type Argument Description
surface_fade number <optional>

The relative opacity of the container's surface meshes (0 to 1), defaults to 1.

outline_fade number <optional>

The relative opacity of the container's outline meshes (0 to 1), defaults to surface_fade.

Inherited From:
Overrides:
Returns:

Returns this container object to support method chaining.

Type
BIM.Renderable

updateDynamicParameters(param, group)

Sets the dynamic parameter value and updates the model as required.

See the PD.Base#updateDynamicParameters method for more details.

Parameters:
Name Type Description
param PD.Parameter

The dynamic parameter that changed.

group PD.ParamGroup

The group that the dynamic parameter belongs to.

Inherited From:
Overrides:
Returns:

Returns true if the value actually changed.

Type
boolean
Examples
updateDynamicParameters(param, group) {

     /// When you want parent class to use its logic.
     if (super.updateDynamicParameters(param, group)) {
         if (param.name == 'i_am_special') this.doSomethingSpecial();
         return true;
     }

     return false;

 };
updateDynamicParameters(param, group) {

     /// When you don't want parent to handle parameter updates.
     if (PD.Base.updateDynamicParametersOnHost(param, group, this)) {

         /// Invalidate geometry.
         if (this.typeComponent) {
             ++this.typeComponent.updateIndex;
         }

         /// Rebuild element.
         this.hasChanged = true;
         this.update();

         /// Only update site mesh.
         if (this.onlyUsesSiteMesh) {
             const level = this.level;
             if (level) { // Don't trigger whole level update.
                 level.rebuildSiteMesh();
                 PD.GlobalActions.redrawAndUpdateSelection();
                 return false;
             }
         }

         return true;

     }

     return false;

 };
updateDynamicParameters(param, group) {

     /// The following three lines of code replicate
     /// `PD.Base.updateDynamicParametersOnHost()`, which you can
     /// use if you need to access `target` without having to call
     /// `group.getTarget() || this` twice.

     const target = group.getTarget() || this;
     target.checkDynamicParameter(param, group, this);
     if (param.setValueOnHostIfDifferent(target, group, this)) {

         /// You can now use `target`.
         if (target.myOwnMeshThatIsUpdatedDuringRebuild) {

             /// Rebuild element.
             this.hasChanged = true;
             this.update();

             /// If no level meshes or other elements are affected,
             /// simply update the target locally and return false.
             this.myOwnMeshThatIsUpdatedDuringRebuild.update();

             /// Update selection meshes if the
             /// element's highlight geometry changed.
             PD.GlobalActions.updateSelectionMeshes();
             return false;

         }

         return true;

     }

     return false;

 };

updateOctrees( [force_rebuild])

Rebuilds the level octrees if required.

Parameters:
Name Type Argument Description
force_rebuild boolean <optional>

Whether or not to rebuild regardless of change, defaults to false.

Returns:

Returns true if one or more octrees on the level were rebuilt.

Type
boolean

addHolesInBottomBoundary(shell, path, facet) <static>

Adds holes within the given path to the given polygonal facet.

Parameters:
Name Type Description
shell PD.Shell

The shell to add vertices and facets to.

path PD.Polygon

The footprint path containing holes.

facet PD.Polygon

The facet to add holes to.


getApertureClipperPathsInPlan(junctions_with_apertures, level) <static>

Generates clipper paths in plan-section for all apertures on the level.

                       +----+
    + - - - - - - - - -|    | - +
    : + - - - - + +  - |    | + :
    : :        +---+   +----+ : :
   +---+       |   |          : :
   |   |       +---+          : :
   |   |        : + - - - - - + :
   +---+        : + - - - - - - +
    : + - - - - + |
    + - - - - - - +
    Aperture Paths

    +-----------------+     +---+
    | +---------+ +---+     +-+ |
    | |         +-+           | |
    +-+                       | |
                +-+           | |
                | +-----------+ |
    +-+         | +-------------+
    | +---------+ |
    +-------------+
    After Subtract
Parameters:
Name Type Description
junctions_with_apertures Array

A list of junctions with apertures.

level BIM.Level

The level with a section plane.


getClassDescription() <static>

A brief description of this class to accompany its icon.

Returns:

Returns a brief description.

Type
string

getClassName() <static>

The name of this class within the PD.Registry.

See PD.Base.getClassName for more details as this is required for use with the PD.Registry.

Returns:

Returns the registered name of this class.

Type
string

getEntityType() <static>

Defines the type of BIM entity this class represents.

See BIM.Entity.getEntityType for more details as this is required for use with the PD.Registry.

Returns:

Returns the BIM entity type this class represents.

Type
BIM.ENTITY

getListOfSpaceJunctionsWithApertures(elements [, allow_bounded] [, update]) <static>

Checks through all space elements for junctions with external apertures.

Parameters:
Name Type Argument Default Description
elements Array

An array of elements to search.

allow_bounded boolean <optional>
true

Whether to included bounded spaces, defaults to true.

update boolean <optional>
false

When true each element is updated first, defaults to false.

Returns:

Returns a list of junctions with apertures in them.

Type
Array

insertAperturesIntoParallelFacets(facets, junctions_with_apertures) <static>

Checks for parallel surfaces to junctions and inserts apertures.

Parameters:
Name Type Description
facets Array.<PD.Polygon>

A list of facets to check.

junctions_with_apertures Array.<BIM.Junction>

A list of junctions with apertures.


rebuildAndRenderApertures(junctions_with_apertures, view, level) <static>

Add the 3D geometric representation of each aperture.

Parameters:
Name Type Description
junctions_with_apertures Array

A list of junctions with apertures.

view PD.ViewData

The view data to use for rendering the model.

level BIM.Level

The level currently being rebuilt.