Infohub JS API
Loading...
Searching...
No Matches
BcfViewpointsResource Class Reference

Description

Provides access to the viewpoints of one BCF topic.

const viewpoints = await topic.viewpoints.list();
const created = await topic.viewpoints.create({ perspective_camera: cameraData });

Public Member Functions

 create (viewpointData)
 list ()

Function Documentation

◆ create()

create ( viewpointData)

Creates a viewpoint (camera, selection, coloring, visibility, snapshot).

Exactly one of perspective_camera / orthogonal_camera is used - perspective wins if both are sent.

Parameters
{object}viewpointData - Viewpoint creation data.
Returns
{Promise<ApiResponse>} The response containing the created viewpoint.
// Input:
{
"index": 10,
"perspective_camera": {
"camera_view_point": { "x": 0.0, "y": 0.0, "z": 0.0 },
"camera_direction": { "x": 1.0, "y": 1.0, "z": 2.0 },
"camera_up_vector": { "x": 0.0, "y": 0.0, "z": 1.0 },
"field_of_view": 90.0,
"aspect_ratio": 1.33
},
"snapshot": { "snapshot_type": "png", "snapshot_data": "SGVsbG8gV29ybGQh" },
"components": {
"selection": [{ "ifc_guid": "2MF28NhmDBiRVyFakgdbCT" }],
"coloring": [{ "color": "ff0000", "components": [{ "ifc_guid": "3$cshxZO9AJBebsni$z9Yk" }] }],
"visibility": { "default_visibility": false, "exceptions": [{ "ifc_guid": "4$cshxZO9AJBebsni$z9Yk" }] }
}
}
// Output:
{
"guid": "a11a82e7-e66c-34b4-ada1-5846abf39133",
"index": 10,
"perspective_camera": {
"camera_view_point": { "x": 0.0, "y": 0.0, "z": 0.0 },
"camera_direction": { "x": 1.0, "y": 1.0, "z": 2.0 },
"camera_up_vector": { "x": 0.0, "y": 0.0, "z": 1.0 },
"field_of_view": 90.0,
"aspect_ratio": 1.33
},
"snapshot": { "snapshot_type": "png" }
}

◆ list()

list ( )
Returns
{Promise<ApiResponse>} The response containing the viewpoints.
// Output:
[{
"guid": "b24a82e9-f67b-43b8-bda0-4946abf39624",
"perspective_camera": {
"camera_view_point": { "x": 0.0, "y": 0.0, "z": 0.0 },
"camera_direction": { "x": 1.0, "y": 1.0, "z": 2.0 },
"camera_up_vector": { "x": 0.0, "y": 0.0, "z": 1.0 },
"field_of_view": 90.0,
"aspect_ratio": 1.33
}
}]