Namespace bcf

xeokit BCF Viewpoint Importer and Exporter


Exchange BCF viewpoints with other BIM software to enhance collaboration and communication.


The xeokit SDK provides support for interoperability with other BIM software through the exchange of BCF (Building Collaboration Format) Viewpoints, an open standard that allows exchanging bookmarks of 3D Viewer states.

A BCF viewpoint captures a snapshot of an issue within a building project. It includes:

  • A problem description to communicate issues to team members.
  • The exact location within the 3D model where the issue occurs.

This facilitates efficient collaboration among project stakeholders by allowing them to share and review issues directly within the model.

For more details on the BCF viewpoint format, see BCFViewpoint.


BCF Workflow


npm install @xeokit/sdk

This example demonstrates how to:

  • Set up a xeokit Viewer
  • Load a BIM model from XKT format
  • Save and load BCF viewpoints to bookmark Viewer states
import { Scene } from "@xeokit/sdk/scene";
import { Data } from "@xeokit/sdk/data";
import { Viewer } from "@xeokit/sdk/viewer";
import { WebGLRenderer } from "@xeokit/sdk/webglrenderer";
import { loadXKT } from "@xeokit/sdk/xkt";
import { saveBCFViewpoint, loadBCFViewpoint } from "@xeokit/sdk/bcf";

const scene = new Scene();
const data = new Data();

const viewer = new Viewer({
scene,
renderer: new WebGLRenderer()
});

const view = viewer.createView({
id: "myView",
elementId: "myCanvas"
});

const sceneModel = scene.createModel({ id: "myModel" });
const dataModel = data.createModel({ id: "myModel" });

fetch("myModel.xkt").then(response => response.arrayBuffer().then(fileData => {
loadXKT({ data, sceneModel, dataModel });
sceneModel.build();
dataModel.build();
}));

Once the model is loaded and built, we can capture a viewpoint:

sceneModel.onBuilt.one(() => {

view.camera.eye = [0, 0, -33];
view.camera.look = [0, 0, 0];
view.camera.up = [0, 0, 1];

view.setObjectsVisible(view.objectIds, false);
view.setObjectsVisible(["myObject1", "myObject2"], true);
view.setObjectsXRayed(["myObject1"], true);

const bcfViewpoint = saveBCFViewpoint({ view });
});

The saved BCFViewpoint can be restored later:

loadBCFViewpoint({
bcfViewpoint,
view
});

ViewLayers allow selective export of ViewObjects. In this example:

  • Two ViewLayers (foreground and background) are created.
  • Only the foreground layer is exported.
const foregroundViewLayer = view.createLayer({ id: "foreground" });
const backgroundViewLayer = view.createLayer({ id: "background" });

const sceneModel = scene.createModel({
id: "myModel",
layerId: "foreground"
});

sceneModel.build();

const bcfViewpoint = saveBCFViewpoint({
view,
includeViewLayerIds: ["foreground"]
});

The viewpoint is restored only for the foreground layer:

loadBCFViewpoint({
bcfViewpoint,
view,
includeViewLayerIds: ["foreground"]
});

Interfaces

BCFBitmap
BCFClippingPlane
BCFColoringComponent
BCFComponent
BCFComponents
BCFLine
BCFOrthogonalCamera
BCFPerspectiveCamera
BCFSelectionComponent
BCFSnapshot
BCFTranslucencyComponent
BCFVector
BCFViewpoint
BCFViewSetupHints
BCFVisibilityComponent
LoadBCFViewpointParams
SaveBCFViewpointParams

Functions

loadBCFViewpoint
saveBCFViewpoint