Giter Club home page Giter Club logo

poc-hololens-bim360's Introduction

poc-hololens-bim360

Sample application showing how to view and manipulate BIM 360 content from a HoloLens device using AR/VR Toolkit, Mixed Reality Toolkit, and Forge/BIM360 APIs.

Demo

Development

Prerequisites

  • Unity 2018.2.17f1 with UWP Build Support (IL2CPP) component
    • older versions might work, too, but have not been tested
  • Node.js v8.0 or newer
  • Visual Studio 2017

Bootstrap

Server Side

  • install Node.js dependencies: npm install
  • if you don't have one, create a Forge application with access to a BIM360 project (tutorial)
  • obtain a lineage ID and a version URN of one of your documents in the BIM 360 project (tutorial)
  • obtain an ID of the issue container in the BIM 360 project (tutorial)
  • generate a couple of AR/VR toolkit scenes for the document version URN (tutorial)

The server requires several env. variables:

  • SERVER_URL - URL on which this server can be accessed by other devices, for example, http://192.168.0.123:3000
  • FORGE_CLIENT_ID - client ID of your Forge application
  • FORGE_CLIENT_SECRET - client secret of your Forge application
  • FORGE_API_HOST - base URL for all requests to Forge; use https://developer.api.autodesk.com
  • REDIRECT_URL - callback URL for the 3-legged auth workflow, for example, http://192.168.0.123:3000/api/auth/3-legged/callback
  • BIM360_CONTAINER_ID - BIM360 issues container ID
  • BIM360_DOCUMENT_LINEAGE_ID - ID of a specific BIM360 document lineage; will be used for listing/creating issues
  • BIM360_DOCUMENT_VERSION_URN - URN of a specific BIM360 document version; will be used for viewing and for AR/VR toolkit scenes
  • BIM360_DOCUMENT_SHEET_GUID - GUID of a specific sheet; will be used for creating issues
  • TOOLKIT_API_HOST - base URL for all requests to AR/VR toolkit; use https://developer-api-beta.autodesk.io

If you're using Visual Studio Code, here's an example configuration you can use in .vscode/launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceFolder}/index.js",
            "env": {
                "SERVER_URL": "http://<your ip address>:3000",
                "FORGE_CLIENT_ID": "<your client id>",
                "FORGE_CLIENT_SECRET": "<your client secret>",
                "REDIRECT_URL": "http://<your ip address>:3000/api/auth/3-legged/callback",
                "FORGE_API_HOST": "https://developer.api.autodesk.com",
                "TOOLKIT_API_HOST": "https://developer-api-beta.autodesk.io",
                "BIM360_CONTAINER_ID": "<your BIM360 issue container id>",
                "BIM360_DOCUMENT_LINEAGE_ID": "<your BIM360 document lineage ID, without base64-encoding>",
                "BIM360_DOCUMENT_VERSION_URN": "<your BIM360 document version URN, base64-encoded>",
                "BIM360_DOCUMENT_SHEET_GUID": "<your BIM360 document sheet GUID>"
            }
        }
    ]
}

Client Side

To setup the Unity project for development and building:

  • go to Mixed Reality Toolkit > Configure, click Apply Mixed Reality Project Settings, and apply the predefined options
  • go to Mixed Reality Toolkit > Configure, click Apply UWP Capability Settings, and enable Microphone, Webcam, Spatial Perception, and Internet Client
  • go to Edit > Project Settings > Player, and in the Other Settings section, make sure the Scripting Runtime Version is .NET 4.x Equivalent, and the Scripting Backend is IL2CPP
  • go to Mixed Reality Toolkit menu, and click Build Window
  • in the build window:
    • click Build Unity Project; this will create a Visual Studio 2017 project in UWP subfolder
    • click Open in Visual Studio to open the generated solution
  • configure the UWP solution for deployment to HoloLens following this tutorial: https://docs.microsoft.com/en-us/windows/mixed-reality/using-visual-studio#deploying-an-app-over-wi-fi-hololens
  • build and deploy the Unity application to your HoloLens device

Running

  • start the server and open its URL in the browser
  • use the Login link in the sidebar to log in with your Autodesk ID
    • the sidebar should now include a list of BIM360 documents and issues, AR/VR scenes, and a QR code
    • the QR code encodes a URL providing all config parameters such as server URL or access token
  • start the Unity application on your HoloLens device, and look at the QR code with the headset on
  • after scanning the QR code, the Unity application is configured and should greet you with a list of scenes
  • airtap on one of the scenes to load the geometry as well as any BIM360 issues associated with it

poc-hololens-bim360's People

Contributors

petrbroz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.