GithubHelp home page GithubHelp logo

xrui94 / viewer-javascript-offline.sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from autodesk-forge/viewer-javascript-offline.sample

0.0 0.0 0.0 2.87 MB

Offline viewing: Use the viewer to run local files

Home Page: http://autodesk-forge.github.io/viewer-javascript-offline.sample/

License: MIT License

HTML 100.00%

viewer-javascript-offline.sample's Introduction

Offline viewing sample for Autodesk Viewer

Viewer

Description

This repository demonstrates a self-contained Forge Viewer application, with all the necessary dependencies and resources hosted on your own server, independent of any Forge API endpoints.

Use cases of hosting the entirety of a Viewer application like this sample on your own instance include:

  • To be able to view the model even if the client has no or limited networking access to the Forge API endpoints
  • Boost loading times if the client experiences slow networking with Forge API endpoints
  • To make your application self-contained and isolated from disruptions (though rare) to the Forge API

Setup

To replace the model (in extracted format .svf) to be viewed, change the value of document in index.html.

var options = {
    'document' : './shaver/0.svf',
    'env':'Local'
    };

Run with Python: to start this application with Python 2.x, run below in the directory of your local clone:

python -m SimpleHTTPServer 8000

Run with NodeJS: to start this application with NodeJS 5+, run below in the directory of your local clone:

npx http-server -p 8000

Alternatively feel free to spin this sample up with your favorite web server (IIS/Kestrel/Tomcat/Apache/Nginx etc.) as it's 100% static.

Navigate to http://localhost:8000 on Chrome/Firefox/IE 11+/Safari/Opera to see the result.

Tips and Tricks

To view other models, replace value of 'document' of 'options' with the url below:

Shaver

http://developer-autodesk.github.io/translated-models/shaver/0.svf

House

http://developer-autodesk.github.io/translated-models/dwfx-sample-house/f0224dd3-8767-45c1-ff99-5c9c881b9fee/0.svf

thumbnail

You can also download those translated models from this GitHub repo.

You can translate your own models at extract.autodesk.io.

Written By

Shiya Luo & Bryan Huang

Thumbnail

Thumbnail

viewer-javascript-offline.sample's People

Contributors

shiya avatar augustogoncalves avatar jaimerosales avatar dukedhx avatar kimekeunkyung avatar jaylimboonkiat 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.