3D
Models
Retrieve a model by ID
- async ThreeDModelsAPI.retrieve(
- id: int,
-
- 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, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.models.retrieve(id=1)
List models
- async ThreeDModelsAPI.list(
- published: bool | None = None,
- limit: int | None = 25,
-
- 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:
Examples
List 3d models:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> model_list = client.three_d.models.list()
Iterate over 3d models, one-by-one:
>>> for model in client.three_d.models(): ... model # do something with the 3d model
Iterate over chunks of 3d models to reduce memory load:
>>> for model in client.three_d.models(chunk_size=50): ... model # do something with the 3d model
Create models
- async ThreeDModelsAPI.create(
- name: str | ThreeDModelWrite | SequenceNotStr[str | ThreeDModelWrite],
- data_set_id: int | None = None,
- metadata: dict[str, str] | None = None,
-
- Parameters:
name (str | ThreeDModelWrite | SequenceNotStr[str | ThreeDModelWrite]) – The name of the 3d model(s) or 3D model object to create. If a 3D model object is provided, the other arguments are ignored.
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:
Example
Create new 3d models:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.models.create(name="My Model", data_set_id=1, metadata={"key1": "value1", "key2": "value2"})
Create multiple new 3D Models:
>>> from cognite.client import CogniteClient >>> from cognite.client.data_classes import ThreeDModelWrite >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> my_model = ThreeDModelWrite(name="My Model", data_set_id=1, metadata={"key1": "value1", "key2": "value2"}) >>> my_other_model = ThreeDModelWrite(name="My Other Model", data_set_id=1, metadata={"key1": "value1", "key2": "value2"}) >>> res = client.three_d.models.create([my_model, my_other_model])
Update models
- async ThreeDModelsAPI.update(
- item: ThreeDModel | ThreeDModelUpdate | Sequence[ThreeDModel | ThreeDModelUpdate],
- mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null',
-
- Parameters:
item (ThreeDModel | ThreeDModelUpdate | Sequence[ThreeDModel | ThreeDModelUpdate]) – ThreeDModel(s) to update
mode (Literal['replace_ignore_null', 'patch', 'replace']) – How to update data when a non-update object is given (ThreeDModel or -Write). If you use ‘replace_ignore_null’, only the fields you have set will be used to replace existing (default). Using ‘replace’ will additionally clear all the fields that are not specified by you. Last option, ‘patch’, will update only the fields you have set and for container-like fields such as metadata or labels, add the values to the existing. For more details, see Update and Upsert Mode Parameter.
- Returns:
Updated ThreeDModel(s)
- Return type:
Examples
Update 3d model that you have fetched. This will perform a full update of the model:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> model = client.three_d.models.retrieve(id=1) >>> model.name = "New Name" >>> res = client.three_d.models.update(model)
Perform a partial update on a 3d model:
>>> from cognite.client.data_classes import ThreeDModelUpdate >>> my_update = ThreeDModelUpdate(id=1).name.set("New Name") >>> res = client.three_d.models.update(my_update)
Delete models
- async ThreeDModelsAPI.delete(id: int | Sequence[int]) None
-
- Parameters:
id (int | Sequence[int]) – ID or list of IDs to delete.
Example
Delete 3d model by id:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.models.delete(id=1)
Revisions
Retrieve a revision by ID
- async ThreeDRevisionsAPI.retrieve(
- model_id: int,
- id: int,
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, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.revisions.retrieve(model_id=1, id=1)
Create a revision
- async ThreeDRevisionsAPI.create(
- model_id: int,
- revision: ThreeDModelRevision | ThreeDModelRevisionWrite | Sequence[ThreeDModelRevision] | Sequence[ThreeDModelRevisionWrite],
Create a revisions for a specified 3d model.
- Parameters:
model_id (int) – Create revisions for this model.
revision (ThreeDModelRevision | ThreeDModelRevisionWrite | Sequence[ThreeDModelRevision] | Sequence[ThreeDModelRevisionWrite]) – The revision(s) to create.
- Returns:
The created revision(s)
- Return type:
Example
Create 3d model revision:
>>> from cognite.client import CogniteClient >>> from cognite.client.data_classes import ThreeDModelRevisionWrite >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> my_revision = ThreeDModelRevisionWrite(file_id=1) >>> res = client.three_d.revisions.create(model_id=1, revision=my_revision)
List revisions
- async ThreeDRevisionsAPI.list(
- model_id: int,
- published: bool = False,
- limit: int | None = 25,
-
- 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:
Example
List 3d model revisions:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.revisions.list(model_id=1, published=True, limit=100)
Update revisions
- async ThreeDRevisionsAPI.update(
- model_id: int,
- item: ThreeDModelRevision | ThreeDModelRevisionUpdate | Sequence[ThreeDModelRevision | ThreeDModelRevisionUpdate],
- mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null',
-
- Parameters:
model_id (int) – Update the revision under the model with this id.
item (ThreeDModelRevision | ThreeDModelRevisionUpdate | Sequence[ThreeDModelRevision | ThreeDModelRevisionUpdate]) – ThreeDModelRevision(s) to update
mode (Literal['replace_ignore_null', 'patch', 'replace']) – How to update data when a non-update object is given (ThreeDModelRevision or -Write). If you use ‘replace_ignore_null’, only the fields you have set will be used to replace existing (default). Using ‘replace’ will additionally clear all the fields that are not specified by you. Last option, ‘patch’, will update only the fields you have set and for container-like fields such as metadata or labels, add the values to the existing. For more details, see Update and Upsert Mode Parameter.
- Returns:
Updated ThreeDModelRevision(s)
- Return type:
Examples
Update a revision that you have fetched. This will perform a full update of the revision:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> 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.data_classes import ThreeDModelRevisionUpdate >>> 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
- async ThreeDRevisionsAPI.delete(
- model_id: int,
- id: int | Sequence[int],
-
- 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, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.revisions.delete(model_id=1, id=1)
Update a revision thumbnail
- async ThreeDRevisionsAPI.update_thumbnail(
- model_id: int,
- revision_id: int,
- file_id: int,
-
- 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, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.revisions.update_thumbnail(model_id=1, revision_id=1, file_id=1)
List nodes
- async 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,
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:
Example
List nodes from the hierarchy in the 3d model:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.revisions.list_nodes(model_id=1, revision_id=1, limit=10)
Filter nodes
- async 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,
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:
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, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> 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
- async ThreeDRevisionsAPI.list_ancestor_nodes(
- model_id: int,
- revision_id: int,
- node_id: int | None = None,
- limit: int | None = 25,
-
- 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:
Example
Get a list of ancestor nodes of a given node:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.revisions.list_ancestor_nodes(model_id=1, revision_id=1, node_id=5, limit=10)
Files
Retrieve a 3D file
- async 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, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.files.retrieve(1)
Asset mappings
Create an asset mapping
- async ThreeDAssetMappingAPI.create(
- model_id: int,
- revision_id: int,
- asset_mapping: ThreeDAssetMapping | ThreeDAssetMappingWrite | Sequence[ThreeDAssetMapping] | Sequence[ThreeDAssetMappingWrite],
Create 3d node asset mappings.
- Parameters:
model_id (int) – Id of the model.
revision_id (int) – Id of the revision.
asset_mapping (ThreeDAssetMapping | ThreeDAssetMappingWrite | Sequence[ThreeDAssetMapping] | Sequence[ThreeDAssetMappingWrite]) – The asset mapping(s) to create.
- Returns:
The created asset mapping(s).
- Return type:
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() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.three_d.asset_mappings.create(model_id=1, revision_id=1, asset_mapping=my_mapping)
List asset mappings
- async 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,
-
- 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:
Example
List 3d node asset mappings:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> 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
- async ThreeDAssetMappingAPI.delete(
- model_id: int,
- revision_id: int,
- asset_mapping: ThreeDAssetMapping | Sequence[ThreeDAssetMapping],
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, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> 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], min: list[float])
Bases:
CogniteResourceThe 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]) – No description.
min (list[float]) – No description.
- class cognite.client.data_classes.three_d.RevisionCameraProperties(target: list[float], position: list[float])
Bases:
CogniteResourceInitial camera position and target.
- Parameters:
target (list[float]) – Initial camera target.
position (list[float]) – Initial camera position.
- class cognite.client.data_classes.three_d.ThreeDAssetMapping(
- node_id: int,
- asset_id: int | None,
- tree_index: int | None,
- subtree_size: int | None,
Bases:
ThreeDAssetMappingCore3D Asset mappings. This is the read version of ThreeDAssetMapping, which is used when retrieving 3D asset mappings.
- Parameters:
node_id (int) – 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).
- as_write() ThreeDAssetMappingWrite
Returns this ThreedAssetMapping in a write version.
- class cognite.client.data_classes.three_d.ThreeDAssetMappingCore(node_id: int, asset_id: int | None)
Bases:
WriteableCogniteResource[ThreeDAssetMappingWrite],ABCNo description.
- Parameters:
node_id (int) – 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: Sequence[T_CogniteResource],
Bases:
WriteableCogniteResourceList[ThreeDAssetMappingWrite,ThreeDAssetMapping]- as_write() ThreeDAssetMappingWriteList
Returns this ThreedAssetMappingList in a write version.
- class cognite.client.data_classes.three_d.ThreeDAssetMappingWrite(node_id: int, asset_id: int | None = None)
Bases:
ThreeDAssetMappingCore3D Asset mappings. This is the write version of ThreeDAssetMapping, which is used when creating 3D asset mappings.
- Parameters:
node_id (int) – The ID of the node.
asset_id (int | None) – 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: Sequence[T_CogniteResource],
- class cognite.client.data_classes.three_d.ThreeDModel(
- name: str,
- id: int,
- created_time: int,
- data_set_id: int | None,
- metadata: dict[str, str] | None,
Bases:
ThreeDModelCoreThis class represents a 3D model in Cognite Data Fusion. This is the read version of ThreeDModel, which is used when retrieving 3D models.
- Parameters:
name (str) – The name of the model.
id (int) – The ID of the model.
created_time (int) – 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.
- as_write() ThreeDModelWrite
Returns this ThreedModel in a write version.
- class cognite.client.data_classes.three_d.ThreeDModelCore(
- name: str,
- data_set_id: int | None,
- metadata: dict[str, str] | None,
Bases:
WriteableCogniteResource[ThreeDModelWrite],ABCThis class represents a 3D model in Cognite Data Fusion.
- 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.
- class cognite.client.data_classes.three_d.ThreeDModelList(
- resources: Sequence[T_CogniteResource],
Bases:
WriteableCogniteResourceList[ThreeDModelWrite,ThreeDModel],NameTransformerMixin,InternalIdTransformerMixin- as_write() ThreeDModelWriteList
Returns this ThreedModelList in a write version.
- class cognite.client.data_classes.three_d.ThreeDModelRevision(
- id: int,
- file_id: int,
- published: bool,
- rotation: list[float] | None,
- scale: list[float] | None,
- translation: list[float] | None,
- camera: RevisionCameraProperties | None,
- status: str,
- metadata: dict[str, str] | None,
- thumbnail_threed_file_id: int | None,
- thumbnail_url: str | None,
- asset_mapping_count: int,
- created_time: int,
Bases:
ThreeDModelRevisionCoreThis 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) – The ID of the revision.
file_id (int) – The file id.
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 | None) – Initial camera position and target.
status (str) – 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) – The number of asset mappings for this revision.
created_time (int) – The creation time of the resource, in milliseconds since January 1, 1970 at 00:00 UTC.
- as_write() ThreeDModelRevisionWrite
Returns this ThreedModelRevision in a write 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],ABCNo 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: Sequence[T_CogniteResource],
Bases:
WriteableCogniteResourceList[ThreeDModelRevisionWrite,ThreeDModelRevision],InternalIdTransformerMixin- as_write() ThreeDModelRevisionWriteList
Returns this ThreedModelRevisionList in a write version.
- class cognite.client.data_classes.three_d.ThreeDModelRevisionUpdate(id: int | None = None, external_id: str | None = None)
Bases:
CogniteUpdateNo 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:
ThreeDModelRevisionCoreThis class represents a 3D model revision in Cognite Data Fusion. This is the write 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: Sequence[T_CogniteResource],
- class cognite.client.data_classes.three_d.ThreeDModelUpdate(id: int | None = None, external_id: str | None = None)
Bases:
CogniteUpdateNo 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:
ThreeDModelCoreThis class represents a 3D model in Cognite Data Fusion. This is the write 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: Sequence[T_CogniteResource],
Bases:
CogniteResourceList[ThreeDModelWrite],NameTransformerMixin
- class cognite.client.data_classes.three_d.ThreeDNode(
- id: int,
- tree_index: int,
- parent_id: int | None,
- depth: int,
- name: str,
- subtree_size: int,
- properties: dict[str, dict[str, str]] | None,
- bounding_box: BoundingBox3D | None,
Bases:
CogniteResourceNo description.
- Parameters:
id (int) – The ID of the node.
tree_index (int) – 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) – The depth of the node in the tree, starting from 0 at the root node.
name (str) – The name of the node.
subtree_size (int) – 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 | None) – The bounding box of the subtree with this sector as the root sector. Is null if there are no geometries in the subtree.
- 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: Sequence[T_CogniteResource],
Bases:
CogniteResourceList[ThreeDNode],InternalIdTransformerMixin