new Meshes(renderable)
Creates three meshes that elements can use to render themselves.
Parameters:
| Name | Type | Description |
|---|---|---|
renderable |
BIM.Renderable | The renderable drawing/level to create meshes for. |
Extends
- THREE.Group
Members
-
:PD.PolyMesh
black
-
The dynamic mesh used to render black text and lines.
Type
-
:PD.PolyMesh
default
-
The dynamic mesh used to render 3D surfaces and lines.
Type
-
:PD.PolyMesh
transparent
-
The dynamic mesh used to render transparent surfaces and coloured lines.
Type
-
:number
darkOutlineColor <static>
-
The color for making outlines dark.
Type
- number
Methods
-
addAnalysisMesh(mesh)
-
Adds an analysis mesh to the level meshes.
Parameters:
Name Type Description meshTHREE.Object3D The mesh/group/object to add.
Returns:
Returns true if
meshis a valid Mesh, Group or Object3D and was added.- Type
- boolean
-
addCustomMesh(mesh)
-
Adds a custom mesh to the level meshes.
Parameters:
Name Type Description meshTHREE.Object3D The mesh/group/object to add.
Returns:
Returns true if
meshis a valid Mesh, Group or Object3D and was added.- Type
- boolean
-
clear()
-
Clears all meshes other than core meshes from the level.
Returns:
Returns this meshes instance to support method chaining.
- Type
- BIM.Meshes
-
clearAnalysisMeshes()
-
Clears all analysis meshes added to the level.
Returns:
Returns this meshes instance to support method chaining.
- Type
- BIM.Meshes
-
clearCustomMeshes()
-
Clears all custom meshes added to the level.
Returns:
Returns this meshes instance to support method chaining.
- Type
- BIM.Meshes
-
getAnalysisMeshes()
-
Retrieves the list of analysis meshes added to the level meshes.
Returns:
Returns an array of analysis meshes.
- Type
- Array.<THREE.Object3D>
-
getCustomMeshes()
-
Retrieves the list of custom meshes added to the level meshes.
Returns:
Returns an array of custom meshes.
- Type
- Array.<THREE.Object3D>
-
getDataMesh()
-
A dynamically created mesh for rendering analysis data on this level.
Analysis data includes 3D grids, flow indicator arrows, sun-path bands and other information overlay geometry. This needs to be separate from other level meshes so that its transparency can be independently changed to suit different display scenarios and visualisation effects.
-
getImageMesh()
-
Retrieves a dynamically created mesh for rendering the trace image.
Trace images are imported bitmaps that show the plan of a building or structure that can nbe scaled to the right size and then raced over to create the geometry of a level. This method creates a new rectangular image mesh if not already created.
Returns:
Returns the level image mesh.
- Type
- PD.PolyMesh
-
getSiteMesh()
-
Retrieves a dynamically created mesh for rendering landscaping and vegetation.
The surfaces of vegetation, rocks, grass and other landscaping elements are typically more Lambertian in nature than specular, so need to be represented by a separate and more suitable material. This method creates a new Lambertian site mesh if not already created.
Returns:
Returns the level site mesh.
- Type
- PD.PolyMesh
-
hasDataMesh()
-
Checks if there is an active level data mesh.
Returns:
Returns true if there is an active level data mesh.
- Type
- boolean
-
hasImageMesh()
-
Checks if there is an active level image mesh.
Returns:
Returns true if there is an active level image mesh.
- Type
- boolean
-
hasSiteMesh()
-
Checks if there is an active level site mesh.
Returns:
Returns true if there is an active level site mesh.
- Type
- boolean
-
removeAnalysisMesh(mesh)
-
Removes an analysis mesh from the level meshes.
Parameters:
Name Type Description meshTHREE.Object3D The mesh/group/object to remove.
Returns:
Returns true if
meshwas removed.- Type
- boolean
-
removeCustomMesh(mesh)
-
Removes a custom mesh from the level meshes.
Parameters:
Name Type Description meshTHREE.Object3D The mesh/group/object to remove.
Returns:
Returns true if
meshwas removed.- Type
- boolean
-
setClippingPlane( [plane])
-
Adds a clipping plane to the modelling meshes.
Parameters:
Name Type Argument Description planeTHREE.Plane <optional>
An optional plane to clip to.
Returns:
Returns this meshes instance to support method chaining.
- Type
- BIM.Meshes
-
showDataMeshIfActive( [show])
-
Sets the visibility of the active level data mesh if there is one.
Parameters:
Name Type Argument Description showboolean <optional>
The visibility state to set the level data mesh, defaults to true.
-
showShadows(state)
-
Sets the display of shadows within these meshes.
Parameters:
Name Type Description stateboolean Whether or not to show shadows.
Returns:
Returns this meshes instance to support method chaining.
- Type
- BIM.Meshes
-
showSiteMeshIfActive( [show])
-
Sets the visibility of the active level site mesh if there is one.
Parameters:
Name Type Argument Description showboolean <optional>
The visibility state to set the level site mesh, defaults to true.
-
updateName(owner)
-
Updates the name of the meshes object based on its owner.
Parameters:
Name Type Description ownerBIM.Renderable The level or drawing that owns these meshes.
-
createAnalysisMesh( [name] [, hasColors] [, lineColors] [, hasAlpha]) <static>
-
Creates an analysis mesh for rendering (semi)transparent analysis data.
Analysis meshes are a little different to standard model meshes as they should not cast or receive shadows, and their opacity and outline colors are set by the analysis display settings rather than model view opacities.
Transparency is not handled that well in THREE.js when multiple transparent surfaces overlap each other. This is particularly noticeable when a semi-transparent data grid is rendered inside a semi-transparent building model. If the grid is rendered before the model, the grid surface will set the depth buffer, meaning that any model geometry behind it will not be rendered. If the grid is rendered after the model, model surfaces will have already set the depth buffer, so any grid geometry behind it will not be visible even though the model is semi-transparent.
To solve this, the framework renders analysis meshes twice, once before the model and once after. This requires creating two objects that share the same geometry and material. The first object is rendered before the model and is set to not write to the WebGL depth buffer. This means that it will be visible through semi-transparent model surfaces, but will also be overwritten by model geometry that is behind it. The second object is then rendered after the model in order fill in those areas of the analysis mesh inadvertently obscured by model geometry.
This adds an extra draw call to each level render, but the geometry buffers are only created once on the GPU and shared between both objects. This is a reasonable compromise to ensure that transparent analysis data is properly visible within the model.
Parameters:
Name Type Argument Default Description namestring <optional>
An optional name for the mesh.
hasColorsboolean <optional>
true Whether or not the mesh has per-vertex surface colors.
lineColorsboolean <optional>
false Whether or not the mesh has per-vertex outline colors.
hasAlphaboolean <optional>
false Whether or not the mesh has per-vertex opacity.
Returns:
Returns a new analysis mesh.
- Type
- PD.PolyMesh
-
createImageMesh() <static>
-
Creates a mesh for rendering the trace image for this level.
Returns:
Returns a new image mesh.
- Type
- PD.PolyMesh
-
createSiteMesh() <static>
-
Creates a mesh for rendering landscaping and vegetation.
Returns:
Returns a new site mesh.
- Type
- PD.PolyMesh