3D

Models

Retrieve a model by ID

ThreeDModelsAPI.retrieve(id: int) ThreeDModel | None

Retrieve a 3d model by id

Parameters

id (int) – Get the model with this id.

Returns

The requested 3d model.

Return type

ThreeDModel | None

Example

Get 3d model by id:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.models.retrieve(id=1)

List models

ThreeDModelsAPI.list(published: bool | None = None, limit: int | None = 25) ThreeDModelList

List 3d models.

Parameters
  • published (bool | None) – Filter based on whether or not the model has published revisions.

  • limit (int | None) – Maximum number of models to retrieve. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

Returns

The list of 3d models.

Return type

ThreeDModelList

Examples

List 3d models:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> three_d_model_list = client.three_d.models.list()

Iterate over 3d models:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> for three_d_model in client.three_d.models:
...     three_d_model # do something with the 3d model

Iterate over chunks of 3d models to reduce memory load:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> for three_d_model in client.three_d.models(chunk_size=50):
...     three_d_model # do something with the 3d model

Create models

ThreeDModelsAPI.create(name: str | SequenceNotStr[str], data_set_id: int | None = None, metadata: dict[str, str] | None = None) ThreeDModel | ThreeDModelList

Create new 3d models.

Parameters
  • name (str | SequenceNotStr[str]) – The name of the 3d model(s) to create.

  • data_set_id (int | None) – The id of the dataset this 3D model belongs to.

  • metadata (dict[str, str] | None) – Custom, application-specific metadata. String key -> String value. Limits: Maximum length of key is 32 bytes, value 512 bytes, up to 16 key-value pairs.

Returns

The created 3d model(s).

Return type

ThreeDModel | ThreeDModelList

Example

Create new 3d models:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.models.create(name="My Model", data_set_id=1, metadata={"key1": "value1", "key2": "value2"})

Update models

ThreeDModelsAPI.update(item: ThreeDModel | ThreeDModelWrite) ThreeDModel
ThreeDModelsAPI.update(item: Sequence[ThreeDModel | ThreeDModelWrite]) ThreeDModelList

Update 3d models.

Parameters

item (ThreeDModel | ThreeDModelWrite | ThreeDModelUpdate | Sequence[ThreeDModel | ThreeDModelWrite | ThreeDModelUpdate]) – ThreeDModel(s) to update

Returns

Updated ThreeDModel(s)

Return type

ThreeDModel | ThreeDModelList

Examples

Update 3d model that you have fetched. This will perform a full update of the model:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> three_d_model = client.three_d.models.retrieve(id=1)
>>> three_d_model.name = "New Name"
>>> res = client.three_d.models.update(three_d_model)

Perform a partial update on a 3d model:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes import ThreeDModelUpdate
>>> client = CogniteClient()
>>> my_update = ThreeDModelUpdate(id=1).name.set("New Name")
>>> res = client.three_d.models.update(my_update)

Delete models

ThreeDModelsAPI.delete(id: int | Sequence[int]) None

Delete 3d models.

Parameters

id (int | Sequence[int]) – ID or list of IDs to delete.

Example

Delete 3d model by id:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.models.delete(id=1)

Revisions

Retrieve a revision by ID

ThreeDRevisionsAPI.retrieve(model_id: int, id: int) ThreeDModelRevision | None

Retrieve a 3d model revision by id

Parameters
  • model_id (int) – Get the revision under the model with this id.

  • id (int) – Get the model revision with this id.

Returns

The requested 3d model revision.

Return type

ThreeDModelRevision | None

Example

Retrieve 3d model revision by model id and revision id:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.revisions.retrieve(model_id=1, id=1)

Create a revision

ThreeDRevisionsAPI.create(model_id: int, revision: ThreeDModelRevision | ThreeDModelRevisionWrite) ThreeDModelRevision
ThreeDRevisionsAPI.create(model_id: int, revision: Sequence[ThreeDModelRevision] | Sequence[ThreeDModelRevisionWrite]) ThreeDModelRevisionList

Create a revisions for a specified 3d model.

Parameters
Returns

The created revision(s)

Return type

ThreeDModelRevision | ThreeDModelRevisionList

Example

Create 3d model revision:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes import ThreeDModelRevisionWrite
>>> client = CogniteClient()
>>> my_revision = ThreeDModelRevisionWrite(file_id=1)
>>> res = client.three_d.revisions.create(model_id=1, revision=my_revision)

List revisions

ThreeDRevisionsAPI.list(model_id: int, published: bool = False, limit: int | None = 25) ThreeDModelRevisionList

List 3d model revisions.

Parameters
  • model_id (int) – List revisions under the model with this id.

  • published (bool) – Filter based on whether or not the revision is published.

  • limit (int | None) – Maximum number of models to retrieve. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

Returns

The list of 3d model revisions.

Return type

ThreeDModelRevisionList

Example

List 3d model revisions:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.revisions.list(model_id=1, published=True, limit=100)

Update revisions

ThreeDRevisionsAPI.update(model_id: int, item: ThreeDModelRevision | ThreeDModelRevisionUpdate | Sequence[ThreeDModelRevision | ThreeDModelRevisionUpdate]) ThreeDModelRevision | ThreeDModelRevisionList

Update 3d model revisions.

Parameters
Returns

Updated ThreeDModelRevision(s)

Return type

ThreeDModelRevision | ThreeDModelRevisionList

Examples

Update a revision that you have fetched. This will perform a full update of the revision:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> revision = client.three_d.revisions.retrieve(model_id=1, id=1)
>>> revision.status = "New Status"
>>> res = client.three_d.revisions.update(model_id=1, item=revision)

Perform a partial update on a revision, updating the published property and adding a new field to metadata:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes import ThreeDModelRevisionUpdate
>>> client = CogniteClient()
>>> my_update = ThreeDModelRevisionUpdate(id=1).published.set(False).metadata.add({"key": "value"})
>>> res = client.three_d.revisions.update(model_id=1, item=my_update)

Delete revisions

ThreeDRevisionsAPI.delete(model_id: int, id: int | Sequence[int]) None

Delete 3d model revisions.

Parameters
  • model_id (int) – Delete the revision under the model with this id.

  • id (int | Sequence[int]) – ID or list of IDs to delete.

Example

Delete 3d model revision by id:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.revisions.delete(model_id=1, id=1)

Update a revision thumbnail

ThreeDRevisionsAPI.update_thumbnail(model_id: int, revision_id: int, file_id: int) None

Update a revision thumbnail.

Parameters
  • model_id (int) – Id of the model.

  • revision_id (int) – Id of the revision.

  • file_id (int) – Id of the thumbnail file in the Files API.

Example

Update revision thumbnail:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.revisions.update_thumbnail(model_id=1, revision_id=1, file_id=1)

List nodes

ThreeDRevisionsAPI.list_nodes(model_id: int, revision_id: int, node_id: int | None = None, depth: int | None = None, sort_by_node_id: bool = False, partitions: int | None = None, limit: int | None = 25) ThreeDNodeList

Retrieves a list of nodes from the hierarchy in the 3D Model.

You can also request a specific subtree with the ‘nodeId’ query parameter and limit the depth of the resulting subtree with the ‘depth’ query parameter.

Parameters
  • model_id (int) – Id of the model.

  • revision_id (int) – Id of the revision.

  • node_id (int | None) – ID of the root node of the subtree you request (default is the root node).

  • depth (int | None) – Get sub nodes up to this many levels below the specified node. Depth 0 is the root node.

  • sort_by_node_id (bool) – Returns the nodes in nodeId order.

  • partitions (int | None) – The result is retrieved in this many parts in parallel. Requires sort_by_node_id to be set to true.

  • limit (int | None) – Maximum number of nodes to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

Returns

The list of 3d nodes.

Return type

ThreeDNodeList

Example

List nodes from the hierarchy in the 3d model:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.revisions.list_nodes(model_id=1, revision_id=1, limit=10)

Filter nodes

ThreeDRevisionsAPI.filter_nodes(model_id: int, revision_id: int, properties: dict[str, dict[str, SequenceNotStr[str]]] | None = None, limit: int | None = 25, partitions: int | None = None) ThreeDNodeList

List nodes in a revision, filtered by node property values.

Parameters
  • model_id (int) – Id of the model.

  • revision_id (int) – Id of the revision.

  • properties (dict[str, dict[str, SequenceNotStr[str]]] | None) – Properties for filtering. The object contains one or more category. Each category references one or more properties. Each property is associated with a list of values. For a node to satisfy the filter, it must, for each category/property in the filter, contain the category+property combination with a value that is contained within the corresponding list in the filter.

  • limit (int | None) – Maximum number of nodes to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

  • partitions (int | None) – The result is retrieved in this many parts in parallel. Requires sort_by_node_id to be set to true.

Returns

The list of 3d nodes.

Return type

ThreeDNodeList

Example

Filter nodes from the hierarchy in the 3d model that have one of the values “AB76”, “AB77” or “AB78” for property PDMS/Area AND that also have one of the values “PIPE”, “BEND” or “PIPESUP” for the property PDMS/Type.

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.revisions.filter_nodes(model_id=1, revision_id=1, properties={ "PDMS": { "Area": ["AB76", "AB77", "AB78"], "Type": ["PIPE", "BEND", "PIPESUP"] } }, limit=10)

List ancestor nodes

ThreeDRevisionsAPI.list_ancestor_nodes(model_id: int, revision_id: int, node_id: int | None = None, limit: int | None = 25) ThreeDNodeList

Retrieves a list of ancestor nodes of a given node, including itself, in the hierarchy of the 3D model

Parameters
  • model_id (int) – Id of the model.

  • revision_id (int) – Id of the revision.

  • node_id (int | None) – ID of the node to get the ancestors of.

  • limit (int | None) – Maximum number of nodes to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

Returns

The list of 3d nodes.

Return type

ThreeDNodeList

Example

Get a list of ancestor nodes of a given node:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.revisions.list_ancestor_nodes(model_id=1, revision_id=1, node_id=5, limit=10)

Files

Retrieve a 3D file

ThreeDFilesAPI.retrieve(id: int) bytes

Retrieve the contents of a 3d file by id.

Parameters

id (int) – The id of the file to retrieve.

Returns

The contents of the file.

Return type

bytes

Example

Retrieve the contents of a 3d file by id:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.files.retrieve(1)

Asset mappings

Create an asset mapping

ThreeDAssetMappingAPI.create(model_id: int, revision_id: int, asset_mapping: ThreeDAssetMapping | ThreeDAssetMappingWrite) ThreeDAssetMapping
ThreeDAssetMappingAPI.create(model_id: int, revision_id: int, asset_mapping: Sequence[ThreeDAssetMapping] | Sequence[ThreeDAssetMappingWrite]) ThreeDAssetMappingList

Create 3d node asset mappings.

Parameters
Returns

The created asset mapping(s).

Return type

ThreeDAssetMapping | ThreeDAssetMappingList

Example

Create new 3d node asset mapping:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes import ThreeDAssetMappingWrite
>>> my_mapping = ThreeDAssetMappingWrite(node_id=1, asset_id=1)
>>> client = CogniteClient()
>>> res = client.three_d.asset_mappings.create(model_id=1, revision_id=1, asset_mapping=my_mapping)

List asset mappings

ThreeDAssetMappingAPI.list(model_id: int, revision_id: int, node_id: int | None = None, asset_id: int | None = None, intersects_bounding_box: BoundingBox3D | None = None, limit: int | None = 25) ThreeDAssetMappingList

List 3D node asset mappings.

Parameters
  • model_id (int) – Id of the model.

  • revision_id (int) – Id of the revision.

  • node_id (int | None) – List only asset mappings associated with this node.

  • asset_id (int | None) – List only asset mappings associated with this asset.

  • intersects_bounding_box (BoundingBox3D | None) – If given, only return asset mappings for assets whose bounding box intersects with the given bounding box.

  • limit (int | None) – Maximum number of asset mappings to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

Returns

The list of asset mappings.

Return type

ThreeDAssetMappingList

Example

List 3d node asset mappings:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> res = client.three_d.asset_mappings.list(model_id=1, revision_id=1)

List 3d node asset mappings for assets whose bounding box intersects with a given bounding box:

>>> from cognite.client.data_classes import BoundingBox3D
>>> bbox = BoundingBox3D(min=[0.0, 0.0, 0.0], max=[1.0, 1.0, 1.0])
>>> res = client.three_d.asset_mappings.list(
...     model_id=1, revision_id=1, intersects_bounding_box=bbox)

Delete asset mappings

ThreeDAssetMappingAPI.delete(model_id: int, revision_id: int, asset_mapping: ThreeDAssetMapping | Sequence[ThreeDAssetMapping]) None

Delete 3d node asset mappings.

Parameters
  • model_id (int) – Id of the model.

  • revision_id (int) – Id of the revision.

  • asset_mapping (ThreeDAssetMapping | Sequence[ThreeDAssetMapping]) – The asset mapping(s) to delete.

Example

Delete 3d node asset mapping:

>>> from cognite.client import CogniteClient
>>> client = CogniteClient()
>>> mapping_to_delete = client.three_d.asset_mappings.list(model_id=1, revision_id=1)[0]
>>> res = client.three_d.asset_mappings.delete(model_id=1, revision_id=1, asset_mapping=mapping_to_delete)

Data classes

class cognite.client.data_classes.three_d.BoundingBox3D(max: list[float] | None = None, min: list[float] | None = None, **_: Any)

Bases: CogniteObject

The bounding box of the subtree with this sector as the root sector. Is null if there are no geometries in the subtree.

Parameters
  • max (list[float] | None) – No description.

  • min (list[float] | None) – No description.

  • **_ (Any) – No description.

class cognite.client.data_classes.three_d.RevisionCameraProperties(target: list[float] | None = None, position: list[float] | None = None, **_: Any)

Bases: CogniteObject

Initial camera position and target.

Parameters
  • target (list[float] | None) – Initial camera target.

  • position (list[float] | None) – Initial camera position.

  • **_ (Any) – No description.

class cognite.client.data_classes.three_d.ThreeDAssetMapping(node_id: int | None = None, asset_id: int | None = None, tree_index: int | None = None, subtree_size: int | None = None, cognite_client: CogniteClient | None = None)

Bases: ThreeDAssetMappingCore

3D Asset mappings. This is the reading version of ThreeDAssetMapping, which is used when retrieving 3D asset mappings.

Parameters
  • node_id (int | None) – The ID of the node.

  • asset_id (int | None) – The ID of the associated asset (Cognite’s Assets API).

  • tree_index (int | None) – A number describing the position of this node in the 3D hierarchy, starting from 0. The tree is traversed in a depth-first order.

  • subtree_size (int | None) – The number of nodes in the subtree of this node (this number included the node itself).

  • cognite_client (CogniteClient | None) – The client to associate with this object.

as_write() ThreeDAssetMappingWrite

Returns this ThreedAssetMapping in a writing version.

class cognite.client.data_classes.three_d.ThreeDAssetMappingCore(node_id: int | None = None, asset_id: int | None = None)

Bases: WriteableCogniteResource[ThreeDAssetMappingWrite], ABC

No description.

Parameters
  • node_id (int | None) – The ID of the node.

  • asset_id (int | None) – The ID of the associated asset (Cognite’s Assets API).

class cognite.client.data_classes.three_d.ThreeDAssetMappingList(resources: Collection[Any], cognite_client: CogniteClient | None = None)

Bases: WriteableCogniteResourceList[ThreeDAssetMappingWrite, ThreeDAssetMapping]

as_write() ThreeDAssetMappingWriteList

Returns this ThreedAssetMappingList in a writing version.

class cognite.client.data_classes.three_d.ThreeDAssetMappingWrite(node_id: int, asset_id: int)

Bases: ThreeDAssetMappingCore

3D Asset mappings. This is the writing version of ThreeDAssetMapping, which is used when creating 3D asset mappings.

Parameters
  • node_id (int) – The ID of the node.

  • asset_id (int) – The ID of the associated asset (Cognite’s Assets API).

as_write() ThreeDAssetMappingWrite

Returns this ThreedAssetMappingWrite instance.

class cognite.client.data_classes.three_d.ThreeDAssetMappingWriteList(resources: Collection[Any], cognite_client: CogniteClient | None = None)

Bases: CogniteResourceList[ThreeDAssetMappingWrite]

class cognite.client.data_classes.three_d.ThreeDModel(name: str | None = None, id: int | None = None, created_time: int | None = None, data_set_id: int | None = None, metadata: dict[str, str] | None = None, cognite_client: CogniteClient | None = None)

Bases: ThreeDModelCore

This class represents a 3D model in Cognite Data Fusion. This is the reading version of ThreeDModel, which is used when retrieving 3D models.

Parameters
  • name (str | None) – The name of the model.

  • id (int | None) – The ID of the model.

  • created_time (int | None) – The creation time of the resource, in milliseconds since January 1, 1970 at 00:00 UTC.

  • data_set_id (int | None) – The id of the dataset this 3D model belongs to.

  • metadata (dict[str, str] | None) – Custom, application-specific metadata. String key -> String value. Limits: Maximum length of key is 32 bytes, value 512 bytes, up to 16 key-value pairs.

  • cognite_client (CogniteClient | None) – The client to associate with this object.

as_write() ThreeDModelWrite

Returns this ThreedModel in a writing version.

class cognite.client.data_classes.three_d.ThreeDModelCore(name: str | None = None, data_set_id: int | None = None, metadata: dict[str, str] | None = None)

Bases: WriteableCogniteResource[ThreeDModelWrite], ABC

This class represents a 3D model in Cognite Data Fusion.

Parameters
  • name (str | None) – The name of the model.

  • data_set_id (int | None) – The id of the dataset this 3D model belongs to.

  • metadata (dict[str, str] | None) – Custom, application-specific metadata. String key -> String value. Limits: Maximum length of key is 32 bytes, value 512 bytes, up to 16 key-value pairs.

class cognite.client.data_classes.three_d.ThreeDModelList(resources: Collection[Any], cognite_client: CogniteClient | None = None)

Bases: WriteableCogniteResourceList[ThreeDModelWrite, ThreeDModel], NameTransformerMixin, InternalIdTransformerMixin

as_write() ThreeDModelWriteList

Returns this ThreedModelList in a writing version.

class cognite.client.data_classes.three_d.ThreeDModelRevision(id: int | None = None, file_id: int | None = None, published: bool | None = None, rotation: list[float] | None = None, scale: list[float] | None = None, translation: list[float] | None = None, camera: RevisionCameraProperties | dict[str, Any] | None = None, status: str | None = None, metadata: dict[str, str] | None = None, thumbnail_threed_file_id: int | None = None, thumbnail_url: str | None = None, asset_mapping_count: int | None = None, created_time: int | None = None, cognite_client: CogniteClient | None = None)

Bases: ThreeDModelRevisionCore

This class represents a 3D model revision in Cognite Data Fusion. This is the read version of ThreeDModelRevision, which is used when retrieving 3D model revisions.

Parameters
  • id (int | None) – The ID of the revision.

  • file_id (int | None) – The file id.

  • published (bool | None) – True if the revision is marked as published.

  • rotation (list[float] | None) – No description.

  • scale (list[float] | None) – Scale of 3D model in directions X,Y and Z. Should be uniform.

  • translation (list[float] | None) – 3D offset of the model.

  • camera (RevisionCameraProperties | dict[str, Any] | None) – Initial camera position and target.

  • status (str | None) – The status of the revision.

  • metadata (dict[str, str] | None) – Custom, application specific metadata. String key -> String value. Limits: Maximum length of key is 32 bytes, value 512 bytes, up to 16 key-value pairs.

  • thumbnail_threed_file_id (int | None) – The threed file ID of a thumbnail for the revision. Use /3d/files/{id} to retrieve the file.

  • thumbnail_url (str | None) – The URL of a thumbnail for the revision.

  • asset_mapping_count (int | None) – The number of asset mappings for this revision.

  • created_time (int | None) – The creation time of the resource, in milliseconds since January 1, 1970 at 00:00 UTC.

  • cognite_client (CogniteClient | None) – The client to associate with this object.

as_write() ThreeDModelRevisionWrite

Returns this ThreedModelRevision in a writing version.

class cognite.client.data_classes.three_d.ThreeDModelRevisionCore(file_id: int | None = None, published: bool | None = None, rotation: list[float] | None = None, scale: list[float] | None = None, translation: list[float] | None = None, camera: RevisionCameraProperties | dict[str, Any] | None = None, metadata: dict[str, str] | None = None)

Bases: WriteableCogniteResource[ThreeDModelRevisionWrite], ABC

No description.

Parameters
  • file_id (int | None) – The file id.

  • published (bool | None) – True if the revision is marked as published.

  • rotation (list[float] | None) – No description.

  • scale (list[float] | None) – Scale of 3D model in directions X,Y and Z. Should be uniform.

  • translation (list[float] | None) – 3D offset of the model.

  • camera (RevisionCameraProperties | dict[str, Any] | None) – Initial camera position and target.

  • metadata (dict[str, str] | None) – Custom, application specific metadata. String key -> String value. Limits: Maximum length of key is 32 bytes, value 512 bytes, up to 16 key-value pairs.

dump(camel_case: bool = True) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns

A dictionary representation of the instance.

Return type

dict[str, Any]

class cognite.client.data_classes.three_d.ThreeDModelRevisionList(resources: Collection[Any], cognite_client: CogniteClient | None = None)

Bases: WriteableCogniteResourceList[ThreeDModelRevisionWrite, ThreeDModelRevision], InternalIdTransformerMixin

as_write() ThreeDModelRevisionWriteList

Returns this ThreedModelRevisionList in a writing version.

class cognite.client.data_classes.three_d.ThreeDModelRevisionUpdate(id: int | None = None, external_id: str | None = None)

Bases: CogniteUpdate

No description.

Parameters

id (int) – A server-generated ID for the object.

class cognite.client.data_classes.three_d.ThreeDModelRevisionWrite(file_id: int, published: bool = False, rotation: list[float] | None = None, scale: list[float] | None = None, translation: list[float] | None = None, camera: RevisionCameraProperties | dict[str, Any] | None = None, metadata: dict[str, str] | None = None)

Bases: ThreeDModelRevisionCore

This class represents a 3D model revision in Cognite Data Fusion. This is the writing version of ThreeDModelRevision, which is used when creating 3D model revisions.

Parameters
  • file_id (int) – The file id to a file uploaded to Cognite’s Files API. Can only be set on revision creation, and can never be updated.

  • published (bool) – True if the revision is marked as published.

  • rotation (list[float] | None) – No description.

  • scale (list[float] | None) – Scale of 3D model in directions X,Y and Z. Should be uniform.

  • translation (list[float] | None) – 3D offset of the model.

  • camera (RevisionCameraProperties | dict[str, Any] | None) – Initial camera position and target.

  • metadata (dict[str, str] | None) – Custom, application specific metadata. String key -> String value. Limits: Maximum length of key is 32 bytes, value 512 bytes, up to 16 key-value pairs.

as_write() ThreeDModelRevisionWrite

Returns this ThreedModelRevisionWrite instance.

class cognite.client.data_classes.three_d.ThreeDModelRevisionWriteList(resources: Collection[Any], cognite_client: CogniteClient | None = None)

Bases: CogniteResourceList[ThreeDModelRevisionWrite]

class cognite.client.data_classes.three_d.ThreeDModelUpdate(id: int | None = None, external_id: str | None = None)

Bases: CogniteUpdate

No description.

Parameters

id (int) – A server-generated ID for the object.

class cognite.client.data_classes.three_d.ThreeDModelWrite(name: str, data_set_id: int | None = None, metadata: dict[str, str] | None = None)

Bases: ThreeDModelCore

This class represents a 3D model in Cognite Data Fusion. This is the writing version of ThreeDModel, which is used when creating 3D models.

Parameters
  • name (str) – The name of the model.

  • data_set_id (int | None) – The id of the dataset this 3D model belongs to.

  • metadata (dict[str, str] | None) – Custom, application-specific metadata. String key -> String value. Limits: Maximum length of key is 32 bytes, value 512 bytes, up to 16 key-value pairs.

as_write() ThreeDModelWrite

Returns this ThreedModelWrite instance.

class cognite.client.data_classes.three_d.ThreeDModelWriteList(resources: Collection[Any], cognite_client: CogniteClient | None = None)

Bases: CogniteResourceList[ThreeDModelWrite], NameTransformerMixin

class cognite.client.data_classes.three_d.ThreeDNode(id: int | None = None, tree_index: int | None = None, parent_id: int | None = None, depth: int | None = None, name: str | None = None, subtree_size: int | None = None, properties: dict[str, dict[str, str]] | None = None, bounding_box: BoundingBox3D | dict[str, Any] | None = None, cognite_client: CogniteClient | None = None)

Bases: CogniteResource

No description.

Parameters
  • id (int | None) – The ID of the node.

  • tree_index (int | None) – The index of the node in the 3D model hierarchy, starting from 0. The tree is traversed in a depth-first order.

  • parent_id (int | None) – The parent of the node, null if it is the root node.

  • depth (int | None) – The depth of the node in the tree, starting from 0 at the root node.

  • name (str | None) – The name of the node.

  • subtree_size (int | None) – The number of descendants of the node, plus one (counting itself).

  • properties (dict[str, dict[str, str]] | None) – Properties extracted from 3D model, with property categories containing key/value string pairs.

  • bounding_box (BoundingBox3D | dict[str, Any] | None) – The bounding box of the subtree with this sector as the root sector. Is null if there are no geometries in the subtree.

  • cognite_client (CogniteClient | None) – The client to associate with this object.

dump(camel_case: bool = True) dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters

camel_case (bool) – Use camelCase for attribute names. Defaults to True.

Returns

A dictionary representation of the instance.

Return type

dict[str, Any]

class cognite.client.data_classes.three_d.ThreeDNodeList(resources: Collection[Any], cognite_client: CogniteClient | None = None)

Bases: CogniteResourceList[ThreeDNode]