Board
TheBoard class represents a drawing board or canvas element in OpenPlans. It extends the Polygon class and provides a 2D surface for organizing and containing other architectural elements. Boards can have multiple layers for organizing different types of elements.
Constructor
Optional configuration object for the board. If not provided, default values will be used.
Properties
The element type identifier. Always set to
'BOARD'.The current configuration of the board including dimensions, color, and layers.
Map containing sub-elements added to the board.
Indicates whether the board is currently selected.
Indicates whether the board is in edit mode.
Getters & Setters
The display name of the board element. Updates the visual label.
The width of the board in meters.
The height of the board in meters.
The starting corner position of the board.
The hexadecimal color value for the board.
Methods
setOPConfig
New configuration object for the board.
getOPConfig
BoardOptions - The current board configuration object.
setOPGeometry
setOPMaterial
dispose
BoardOptions
The configuration interface for board elements.Properties
Unique identifier for the board element.
Center point of the board (calculated automatically).
Hexadecimal color value for the board (e.g., 0xFFFFFF for white).
Element type identifier.
Array of 4 corner coordinate points defining the board geometry in anti-clockwise order, starting from top-left. Calculated automatically.
Display name for the board.
Dimensions configuration for the board.
Array of layer names for organizing elements on the board (e.g., [‘walls’, ‘furniture’, ‘dimensions’]).
Example
Usage Notes
- The board is positioned in the XY plane and rotated to face the camera
- Coordinates are calculated anti-clockwise starting from the top-left corner
- The board serves as a container for other architectural elements
- Layers can be used to organize different types of elements for better management
- The label is displayed using CSS2D rendering for clear visibility
- The board is positioned slightly below y=0 (at y=-0.01) to avoid z-fighting with other elements
Layer Organization
Common layer naming conventions:'walls'- Wall elements'doors'- Door elements'windows'- Window elements'furniture'- Furniture and fixtures'dimensions'- Dimension lines and annotations'grid'- Grid lines and reference lines'text'- Text labels and notes