Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yiskang/forge-restore-viewstate-demo

This sample is demonstrating how to manage viewpoints in a viewer panel
https://github.com/yiskang/forge-restore-viewstate-demo

Last synced: 21 days ago
JSON representation

This sample is demonstrating how to manage viewpoints in a viewer panel

Awesome Lists containing this project

README

        

[![Node.js](https://img.shields.io/badge/Node.js-8.9.4-blue.svg)](https://nodejs.org/)
[![npm](https://img.shields.io/badge/npm-5.8.0-blue.svg)](https://www.npmjs.com/)
![Platforms](https://img.shields.io/badge/platform-windows%20%7C%20osx%20%7C%20linux-lightgray.svg)
[![License](http://img.shields.io/:license-mit-blue.svg)](http://opensource.org/licenses/MIT)

# Autodesk Forge Viewpoint Management Panel Demo

## Overview

This sample is demonstrating how to manage viewpoints in a viewer panel:

- Save current viewpoint (camera state) into db
- Retrieve saved viewpoints from db via REST API
- Store saved viewpoints with a single mouse-clicking on the docking panel

## Thumbnail
![thumbnail](/thumbnail.jpg)

## Requirements

* node.js v8.9.4 or later


## Setup

1. Download and install [Node.js](http://nodejs.org/) (that will install npm as well)
2. Download this repo anywhere you want
3. Execute 'npm install', this command will download and install the required node modules automatically for you.

```bash
npm install
```


## Use of the sample

Before starting the server, you have to set the Forge credentials up.

- Mac OSX/Linux (Terminal)
```bash
export FORGE_CLIENT_ID=<>
export FORGE_CLIENT_SECRET=<>
```

- Windows (use **Node.js command line** from Start menu)
```bash
set FORGE_CLIENT_ID=<>
set FORGE_CLIENT_SECRET=<>
```

- Windows (use **Powershell** from Start menu)
```bash
$env:FORGE_CLIENT_ID="<>"
$env:FORGE_CLIENT_SECRET="<>"
```

Then Run the server

```bash
npm start
```

And visit http://127.0.0.1:8089

## License

This sample is licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Please see the [LICENSE](LICENSE) file for full details.

## Written by

Eason Kang

Forge Partner Development

https://developer.autodesk.com/

https://forge.autodesk.com/blog