3D
Models
Retrieve a model by ID
- ThreeDModelsAPI.retrieve(id: int) cognite.client.data_classes.three_d.ThreeDModel | None
-
- 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: Optional[bool] = None, limit: int | None = 25) ThreeDModelList
-
- 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 >>> client = CogniteClient() >>> three_d_model_list = client.three_d.models.list()
Iterate over 3d models:
>>> 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:
>>> 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: Union[str, ThreeDModelWrite, SequenceNotStr[str | cognite.client.data_classes.three_d.ThreeDModelWrite]], data_set_id: Optional[int] = None, metadata: Optional[dict[str, str]] = None) cognite.client.data_classes.three_d.ThreeDModel | cognite.client.data_classes.three_d.ThreeDModelList
-
- 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 >>> client = CogniteClient() >>> 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() >>> 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
- ThreeDModelsAPI.update(item: cognite.client.data_classes.three_d.ThreeDModel | cognite.client.data_classes.three_d.ThreeDModelUpdate, mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null') ThreeDModel
- ThreeDModelsAPI.update(item: Sequence[cognite.client.data_classes.three_d.ThreeDModel | cognite.client.data_classes.three_d.ThreeDModelUpdate], mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null') ThreeDModelList
-
- 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 >>> 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.data_classes import ThreeDModelUpdate >>> my_update = ThreeDModelUpdate(id=1).name.set("New Name") >>> res = client.three_d.models.update(my_update)
Delete models
- ThreeDModelsAPI.delete(id: int | collections.abc.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 >>> client = CogniteClient() >>> res = client.three_d.models.delete(id=1)
Revisions
Retrieve a revision by ID
- ThreeDRevisionsAPI.retrieve(model_id: int, id: int) cognite.client.data_classes.three_d.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: cognite.client.data_classes.three_d.ThreeDModelRevision | cognite.client.data_classes.three_d.ThreeDModelRevisionWrite) ThreeDModelRevision
- ThreeDRevisionsAPI.create(model_id: int, revision: collections.abc.Sequence[cognite.client.data_classes.three_d.ThreeDModelRevision] | collections.abc.Sequence[cognite.client.data_classes.three_d.ThreeDModelRevisionWrite]) ThreeDModelRevisionList
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() >>> 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
-
- 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 >>> client = CogniteClient() >>> res = client.three_d.revisions.list(model_id=1, published=True, limit=100)
Update revisions
- ThreeDRevisionsAPI.update(model_id: int, item: cognite.client.data_classes.three_d.ThreeDModelRevision | cognite.client.data_classes.three_d.ThreeDModelRevisionUpdate | collections.abc.Sequence[cognite.client.data_classes.three_d.ThreeDModelRevision | cognite.client.data_classes.three_d.ThreeDModelRevisionUpdate], mode: Literal['replace_ignore_null', 'patch', 'replace'] = 'replace_ignore_null') cognite.client.data_classes.three_d.ThreeDModelRevision | cognite.client.data_classes.three_d.ThreeDModelRevisionList
-
- 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 >>> 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.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
- ThreeDRevisionsAPI.delete(model_id: int, id: int | collections.abc.Sequence[int]) None
-
- 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
-
- 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: Optional[int] = None, depth: Optional[int] = None, sort_by_node_id: bool = False, partitions: Optional[int] = 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
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: Optional[dict[str, dict[str, cognite.client.utils.useful_types.SequenceNotStr[str]]]] = None, limit: int | None = 25, partitions: Optional[int] = 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
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: Optional[int] = None, limit: int | None = 25) ThreeDNodeList
-
- 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 >>> 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: cognite.client.data_classes.three_d.ThreeDAssetMapping | cognite.client.data_classes.three_d.ThreeDAssetMappingWrite) ThreeDAssetMapping
- ThreeDAssetMappingAPI.create(model_id: int, revision_id: int, asset_mapping: collections.abc.Sequence[cognite.client.data_classes.three_d.ThreeDAssetMapping] | collections.abc.Sequence[cognite.client.data_classes.three_d.ThreeDAssetMappingWrite]) ThreeDAssetMappingList
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() >>> 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: Optional[int] = None, asset_id: Optional[int] = None, intersects_bounding_box: Optional[BoundingBox3D] = None, limit: int | None = 25) ThreeDAssetMappingList
-
- 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 >>> 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: cognite.client.data_classes.three_d.ThreeDAssetMapping | collections.abc.Sequence[cognite.client.data_classes.three_d.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: Optional[list[float]] = None, min: Optional[list[float]] = 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: Optional[list[float]] = None, position: Optional[list[float]] = 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: Optional[int] = None, asset_id: Optional[int] = 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: Iterable[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: Iterable[Any], cognite_client: CogniteClient | None = None)
- 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: Optional[str] = None, data_set_id: Optional[int] = None, metadata: Optional[dict[str, str]] = 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: Iterable[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: Optional[int] = None, published: Optional[bool] = None, rotation: Optional[list[float]] = None, scale: Optional[list[float]] = None, translation: Optional[list[float]] = None, camera: Optional[Union[RevisionCameraProperties, dict[str, Any]]] = None, metadata: Optional[dict[str, str]] = 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: Iterable[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: Optional[int] = None, external_id: Optional[str] = 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: Optional[list[float]] = None, scale: Optional[list[float]] = None, translation: Optional[list[float]] = None, camera: Optional[Union[RevisionCameraProperties, dict[str, Any]]] = None, metadata: Optional[dict[str, str]] = 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: Iterable[Any], cognite_client: CogniteClient | None = None)
- class cognite.client.data_classes.three_d.ThreeDModelUpdate(id: Optional[int] = None, external_id: Optional[str] = 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: Optional[int] = None, metadata: Optional[dict[str, str]] = 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: Iterable[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: Iterable[Any], cognite_client: CogniteClient | None = None)
Bases:
CogniteResourceList
[ThreeDNode
],InternalIdTransformerMixin