Skip to content

Latest commit

 

History

History
85 lines (54 loc) · 2.14 KB

README.md

File metadata and controls

85 lines (54 loc) · 2.14 KB

Reality Capture SDK examples

These examples demonstrate authentication, data uploads, and Reality Capture job submission with the Python SDK.

Prerequisites

  • Python 3.10 or later.
  • An iTwin where input and output data can be stored.
  • A Bentley service application with access to the iTwin.

Create or Select an iTwin

Input or output data are stored in iTwins. If you don't have one yet, go here and select "Register new project".

Create a Service Application

To run the examples, you will also need a client application. To create one, go here and select "Register new". Select "Service" application type and register the application.

Configure the Environment

After creating the iTwin and the application, change to the python_sdk/examples directory and configure the environment for the examples. Copy template.env to .env, then provide values for ITWIN_ID, CLIENT_ID, and CLIENT_SECRET.

Set Up a Python Virtual Environment

  • From the python_sdk directory, create a new virtual environment.

    python -m venv .venv
  • Activate the environment.

    Windows Command Prompt:

    .venv\Scripts\activate.bat

    Windows PowerShell:

    .venv\Scripts\Activate.ps1

    Linux or macOS:

    source .venv/bin/activate
  • From the python_sdk directory, install the SDK and the dependencies required by the examples.

    python -m pip install -e ".[dev]"
  • Alternatively, install a wheel from the GitHub releases page together with the dependency required by the examples.

    python -m pip install <path-to-reality_capture_sdk.whl> python-dotenv

Run Examples

From the python_sdk/examples directory, run one of the following commands:

  • Upload & download reality data example

    python example_upload_reality_data.py
  • Upload & download bucket data example

    python example_upload_bucket_data.py
  • Modeling Reconstruction example

    python example_modeling.py