【19-e-6】a360 クラウドプラットフォーム webサービスapiのご紹介
TRANSCRIPT
A360 クラウド プラットフォームWeb サービス API のご紹介
オートデスク 株式会社Autodesk Developer Network伊勢崎 俊明
© 2014 Autodesk
1. 多様化する 3D
2. クラウドの登場
3. A360 Web サービス API
アジェンダ - ご紹介する内容
© 2014 Autodesk
© 2014 Autodesk
© 2014 Autodesk
設計者/デザイナー専⽤ソフトウェア専⾨家⽤ソフトウェア
© 2014 Autodesk
© 2014 Autodesk
http://autodesk360.com
© 2014 Autodesk
ReCap 360 クラウド サービス
https://recap360.autodesk.com 写真合成による 3D モデル生成
© 2014 Autodesk
http://autodesk360.com
A360:プロジェクト管理サービス
© 2014 Autodesk
様々なファイル形式への対応
© 2014 Autodesk
A360 のビューワー表示機能
1. A360 クラウドに各種ファイルをアップロード
2. クラウド内で中間ファイルを自動生成
3. Web ブラウザやモバイル専用無償アプリで表示
検索 アクティビティ表⽰プロジェクト データアイデンティティ
IaaS – Infrastructure as a Service
PaaS – Platform as a Service
SaaS – Software as a Service
© 2014 Autodesk
検索、表示、データの統合
拡張する⾒つける ⾒る
Empower your application with Autodesk Web Services
© 2014 Autodesk
View & Data サービス API
WebGL
Three.js
View & Data Web Service
© 2014 Autodesk
View & Data サービス API の特徴
ゼロ クライアント
WebGL 対応ブラウザがあれば OK
HTML5 実装
最新の Web テクノロジ
ストリーミング
大規模モデルの表示が高速
高品質表示
陰影、マテリアル等を高度に表現
対応ファイル形式
多様なファイル形式をサポート
© 2014 Autodesk
View & Data サービス API - 2 種類の API を用意
サーバー & 管理 APIファイル アップロード
ライフサイクルと変換処理
アクセス権限
OAuth 2.0 - REST API
WEB クライアント APIThree.js ベースの表示テクノロジ
HTML5 アプリケーションへの埋め込みと表示制御
ドキュメントへのアクセス、オブジェクト操作、カメラ …JavaScript API
© 2014 Autodesk
3D 表示機能
選択、プロパティ表示、ズーム、パン、オービット、独立表示、ハイライト、フォーカス… 3D モデル配下へのアクセス(メッシュ、マテリアル)
2D 表示機能
ラスター イメージ化した図面アクセス – ズームとパンのみ
ベクトル情報へのアクセス
選択、プロパティ表示、ズーム、パン、独立表示、フォーカス、ハイライト
View & Data サービス API の機能
© 2014 Autodesk
View & Data サービス API ワークフロー
© 2014 Autodesk
オートデスク デベロッパ ポータル
https://developer.autodesk.com
ドキュメント
キーの取得
サンプル コードGitHib
API Console
© 2014 Autodesk
クラウド コミュニケーション REST APIステップ 1:アプリの登録と作成(キー取得)
Consumer Key / Secret が必須
Callback URL はダミーでも OK(アクセス トークン取得用)
© 2014 Autodesk
Header Content-Type: application/x-www-form-urlencoded
Bodyclient_id=xxxxxxxxxxxx&client_secret=xxxxxxxxxxxx&grant_type=client_credentials
POST https://developer.api.autodesk.com/authentication/v1/authenticate
クラウド コミュニケーション REST APIステップ 2:アクセス トークンの取得
© 2014 Autodesk
Header "Content-Type: application/json" "Authorization: Bearer xxxxxxxxxxxx"
Body'{¥"bucketKey¥":¥"mybucket¥",¥"policy¥":¥"transient¥"}'
POSThttps://developer.api.autodesk.com/oss/v1/buckets
バケット ポリシー
Transient: 24 時間のみ維持
Temporary: 30 日間維持
Persistent: 削除されるまで維持
クラウド コミュニケーション REST APIステップ 3:バケットの作成
© 2014 Autodesk
Header "Authorization: Bearer xxxxxxxxxxxxxxxx" "Content-Length: 308331" "Content-Type: application/octet-stream"
Body ファイル コンテンツ
PUT https://developer.api.autodesk.com/oss/v1/buckets/{bucketkey}/objects/{objectkey}
クラウド コミュニケーション REST APIステップ 4:ファイルのアップロード
© 2014 Autodesk
URN の取得{"bucket-key": "mybucket", "objects": [ {"location":
https://developer.api.autodesk.com/oss/v1/buckets/mybucket/objects/skyscpr1.3ds",
"size": 308331, "key": "skyscpr1.3ds", "id": "urn:adsk.objects:os.object:mybucket/skyscpr1.3ds","sha-1": "e84021849a9f5d1842bf792bbcbc6445c280e15b","content-type": "application/octet-stream"
} ] } URN = Base64 エンコードされた ID
クラウド コミュニケーション REST APIアップロード レスポンス
© 2014 Autodesk
Header "Content-Type: application/json " "Authorization:Bearer xxxxxxxxxxxx“
Body "{¥"urn¥":¥“{前のステップで Base64 でエンコードされた ID}¥"}“
POSThttps://developer.api.autodesk.com/viewingservice/v1/register
クラウド コミュニケーション REST APIステップ 5:表示用にデータを登録
© 2014 Autodesk
Header "Authorization: Bearer xxxxxxxxxxxx"
GEThttps://developer.api.autodesk.com/viewingservice/v1/{URN}
クラウド コミュニケーション REST APIチェック処理
いくつかのパーツだけが "complete" ステータスを持つ場合でも登録されたデータをビューアで表示することができることに注意
© 2014 Autodesk
Header "Authorization: Bearer xxxxxxxxxxxx"
GEThttps://developer.api.autodesk.com/viewingservice/v1/thumbnails/{URN}
クラウド コミュニケーション REST APIサムネイル画像の取得
© 2014 Autodesk
WebGL カンバス
A360 ビューワでのモデル表示で必須
WebGL サポート ブラウザ
クライアント側 JavaScript 実装
View & Data サービスのシステム要件
© 2014 Autodesk
HTML5 ページか Web アプリケーションを作成
CSS と JavaScript の参照を追加
<link rel="stylesheet" href="https://developer.api.autodesk.com/viewingservice/v1/viewers/style.css" type="text/css">
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js"></script>
クライアント側 JavaScript 実装
JavaScript ビューワへの表示
© 2014 Autodesk
HTML コンテナへの追加
<body onload="initialize()"><div id="viewer"></div>
</body>
現在のところ div セクションへの表示を想定(Canvas ではなく)
クライアント側 JavaScript 実装
JavaScript ビューワへの表示
© 2014 Autodesk
ビューワの初期化
クライアント側 JavaScript 実装
JavaScript ビューワへの表示
function initialize () {var options ={ "document" : "urn:XXXXXXXXXX“ } ;var viewerElement =document.getElementById ("viewer") ;var viewer =new Autodesk.Viewing.Viewer3D (viewerElement, {}) ;viewer.initialize () ;Autodesk.Viewing.Initializer (options, function () {
loadDocument (viewer,getURLParameterByName ("accessToken"),options.document) ;
}) ;}
© 2014 Autodesk
ビューワへのモデル ロードfunction loadDocument (viewer, auth, documentId) {
// Find the first 3d geometry and load that.Autodesk.Viewing.Document.load (documentId, auth,
function (doc) {var geometryItems =[] ;geometryItems=Autodesk.Viewing.Document.getSubItemsWithProperties(
doc.getRootItem (), { "type" : "geometry", "role" : "3d" }, true) ;if ( geometryItems.length > 0 )
viewer.load (doc.getViewablePath (geometryItems [0])) ;},function (errorMsg) {
alert ("Load Error: " + errorMsg) ;}) ;
}
クライアント側 JavaScript 実装
JavaScript ビューワへの表示
© 2014 Autodesk
モデル階層
メタデータ / プロパティ
イベント処理
カメラ / ズーム / ナビゲーション
ジオメトリやテクスチャへのアクセス
検索
…
クライアント側 JavaScript 実装
その他の実装
© 2014 Autodesk
Google Cardboard のコンテンツ例
© 2014 Autodesk
ディスカッション フォーラムhttp://forums.autodesk.com/t5/view-and-data-api/bd-p/95
Cloud and Mobilehttp://adndevblog.typepad.com/cloud_and_mobile/
Through the Interfacehttp://through-the-interface.typepad.com/
Technology Perspective from Japanhttp://adndevblog.typepad.com/technology_perspective
開発についての参照(フォーラム、ブログ)
© 2014 Autodesk
http://www.3dwebfest.com/
3D Web Festival のお知らせ
© 2014 Autodesk
http://spark.autodesk.com
クラウドを利用した 3D プリンタ API
オープン ソース
3rd Party ソリューションの構築が可能
Ember
オートデスク製 3D プリンタ
光造形方式を採用
Spark
© 2013 Autodesk, Inc. All rights reserved.
Autodesk is a registered trademark of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document.