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/formats/xkt";
import { saveBCFViewpoint, loadBCFViewpoint } from "@xeokit/sdk/bcf";

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

const viewer = new Viewer({
scene
});

const renderer = new WebGLRenderer({
viewer
});

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

const view = viewResult.value;

const sceneModelResult = scene.createModel({ id: "myModel" });
const sceneModel = sceneModelResult.value;

const dataModelResult = data.createModel({ id: "myModel" });
const dataModel = dataModelResult.value;

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

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

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 bcfViewpointResult = saveBCFViewpoint({ view });
const bcfViewpoint = bcfViewpointResult.value;

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.
view.createLayer({ id: "foreground" });
view.createLayer({ id: "background" });

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

//...

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

const bcfViewpoint = bcfViewpointResult.value;

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