-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update scripts * testing script * update permission * update working-directory * Raised quality bar * improved performance * update script * update error code * Raised the bar * Update conditional * Fixed type error * Update beta * cdn autodesk * cdn autodesk comments * comments canvas * html comments * matterport comments * threejs comments * cdn matterport * cdn mouse * cdn real time * cdn three * video cdn * cdn wio * Update CDN Projects * update version * update type * Added Form Elements to samples * Fixed project infos * Fixed type check
- Loading branch information
Showing
92 changed files
with
10,733 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"prettier" | ||
], | ||
"extends": [ | ||
"plugin:prettier/recommended", | ||
"plugin:react/recommended" | ||
], | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "17" | ||
} | ||
}, | ||
"rules": { | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"printWidth": 200, | ||
"tabWidth": 2, | ||
"useTabs": true, | ||
"semi": false | ||
} | ||
], | ||
"@typescript-eslint/consistent-type-definitions": [ | ||
"error", | ||
"interface" | ||
], | ||
"@typescript-eslint/explicit-module-boundary-types": [ | ||
0 | ||
], | ||
"@typescript-eslint/no-shadow": [ | ||
"error" | ||
], | ||
"@typescript-eslint/no-use-before-define": [ | ||
"error" | ||
], | ||
"react/jsx-one-expression-per-line": [ | ||
0 | ||
], | ||
"react/jsx-props-no-spreading": "off", | ||
"react/jsx-uses-react": [ | ||
0 | ||
], | ||
"react/react-in-jsx-scope": [ | ||
0 | ||
], | ||
"react/prop-types": [ | ||
0 | ||
], | ||
"react/jsx-indent": [ | ||
0 | ||
], | ||
"react/jsx-closing-bracket-location": [ | ||
"error", | ||
{ | ||
"selfClosing": "after-props", | ||
"nonEmpty": "after-props" | ||
} | ||
], | ||
"jsx-quotes": [ | ||
"error", | ||
"prefer-single" | ||
], | ||
"newline-per-chained-call": [ | ||
"error", | ||
{ | ||
"ignoreChainWithDepth": 4 | ||
} | ||
], | ||
"no-console": "off", | ||
"comma-dangle": [ | ||
"error", | ||
"always-multiline" | ||
], | ||
"import/prefer-default-export": "off", | ||
"func-names": "off", | ||
"import/extensions": [ | ||
0 | ||
], | ||
"no-shadow": "off", | ||
"no-use-before-define": "off", | ||
"max-len": "off", | ||
"semi": [ | ||
"error", | ||
"never" | ||
], | ||
"nonblock-statement-body-position": [ | ||
"error", | ||
"below" | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"printWidth": 280, | ||
"tabWidth": 2, | ||
"useTabs": true, | ||
"semi": false, | ||
"jsxSingleQuote": true, | ||
"bracketSameLine": true, | ||
"arrowParens": "always", | ||
"singleAttributePerLine": false, | ||
"importOrder": [ | ||
"^components/(.*)$", | ||
"^services/(.*)$", | ||
"^[./]" | ||
], | ||
"importOrderSeparation": true, | ||
"importOrderSortSpecifiers": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,108 @@ | ||
import { DEVELOPER_KEY, CLIENT_ID, CLIENT_SECRET } from "../env.js"; | ||
import { sampleInfo } from "./projectInfo.js"; | ||
import { DEVELOPER_KEY, CLIENT_ID, CLIENT_SECRET } from '../env.js' | ||
import { sampleInfo } from '../projectInfo.js' | ||
|
||
const participant = Math.floor(Math.random() * 100); | ||
const groupId = sampleInfo.id; | ||
const groupName = sampleInfo.name; | ||
const participant = Math.floor(Math.random() * 100) | ||
const groupId = sampleInfo.id | ||
const groupName = sampleInfo.name | ||
|
||
const FORGE_CLIENT = CLIENT_ID; | ||
const FORGE_SECRET = CLIENT_SECRET; | ||
const FORGE_CLIENT = CLIENT_ID | ||
const FORGE_SECRET = CLIENT_SECRET | ||
|
||
const AUTH_URL = "https://developer.api.autodesk.com/authentication/v2/token"; | ||
const modelURN = "urn:adsk.objects:os.object:e8d17563-1a4e-4471-bd72-a0a7e8d719bc/fileifc.ifc"; | ||
const AUTH_URL = 'https://developer.api.autodesk.com/authentication/v2/token' | ||
const modelURN = 'urn:adsk.objects:os.object:e8d17563-1a4e-4471-bd72-a0a7e8d719bc/fileifc.ifc' | ||
const AutodeskData = { | ||
grant_type: "client_credentials", | ||
scope: "data:read bucket:read", | ||
}; | ||
const token = btoa(`${FORGE_CLIENT}:${FORGE_SECRET}`); | ||
grant_type: 'client_credentials', | ||
scope: 'data:read bucket:read', | ||
} | ||
const token = btoa(`${FORGE_CLIENT}:${FORGE_SECRET}`) | ||
|
||
function InitAutodesk() { | ||
const contentSection = document.getElementById("zeus-participant"); | ||
let viewer = null; | ||
const contentSection = document.getElementById('zeus-participant') | ||
let viewer = null | ||
|
||
fetch(AUTH_URL, { | ||
method: "POST", | ||
headers: { "Content-Type": "application/x-www-form-urlencoded", Authorization: `Basic ${token}` }, | ||
body: new URLSearchParams(AutodeskData).toString(), | ||
}) | ||
.then((res) => { | ||
return res.json(); | ||
}) | ||
.then((dataToken) => { | ||
const options = { | ||
env: "AutodeskProduction2", | ||
api: "streamingV2", | ||
accessToken: dataToken.access_token, | ||
}; | ||
fetch(AUTH_URL, { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/x-www-form-urlencoded', Authorization: `Basic ${token}` }, | ||
body: new URLSearchParams(AutodeskData).toString(), | ||
}) | ||
.then((res) => { | ||
return res.json() | ||
}) | ||
.then((dataToken) => { | ||
const options = { | ||
env: 'AutodeskProduction2', | ||
api: 'streamingV2', | ||
accessToken: dataToken.access_token, | ||
} | ||
|
||
const modelID = btoa(modelURN); | ||
var documentId = `urn:${modelID}`; | ||
const modelID = btoa(modelURN) | ||
var documentId = `urn:${modelID}` | ||
|
||
window.Autodesk.Viewing.Initializer(options, async () => { | ||
viewer = new window.Autodesk.Viewing.GuiViewer3D(contentSection); | ||
await viewer.start(); | ||
window.Autodesk.Viewing.Initializer(options, async () => { | ||
viewer = new window.Autodesk.Viewing.GuiViewer3D(contentSection) | ||
await viewer.start() | ||
|
||
viewer.setTheme("dark-theme"); | ||
viewer.setQualityLevel(false, false); | ||
viewer.setGhosting(false); | ||
viewer.setGroundShadow(false); | ||
viewer.setGroundReflection(false); | ||
viewer.setOptimizeNavigation(true); | ||
viewer.setProgressiveRendering(true); | ||
viewer.setTheme('dark-theme') | ||
viewer.setQualityLevel(false, false) | ||
viewer.setGhosting(false) | ||
viewer.setGroundShadow(false) | ||
viewer.setGroundReflection(false) | ||
viewer.setOptimizeNavigation(true) | ||
viewer.setProgressiveRendering(true) | ||
|
||
window.Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure); | ||
}); | ||
}); | ||
window.Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure) | ||
}) | ||
}) | ||
|
||
function onDocumentLoadSuccess(doc) { | ||
const viewable = doc.getRoot().getDefaultGeometry(); | ||
if (viewable) { | ||
viewer | ||
.loadDocumentNode(doc, viewable, { | ||
applyScaling: "meters", | ||
}) | ||
.then(async (result) => { | ||
await InitSuperVizRoomWithAutodesk(viewer); | ||
}) | ||
.catch((error) => { | ||
onDocumentLoadFailure(error); | ||
}); | ||
} | ||
} | ||
function onDocumentLoadFailure(error) { | ||
console.error(`Error loading forge model: ${error}`); | ||
} | ||
function onDocumentLoadSuccess(doc) { | ||
const viewable = doc.getRoot().getDefaultGeometry() | ||
if (viewable) { | ||
viewer | ||
.loadDocumentNode(doc, viewable, { | ||
applyScaling: 'meters', | ||
}) | ||
.then(async (result) => { | ||
await InitSuperVizRoomWithAutodesk(viewer) | ||
}) | ||
.catch((error) => { | ||
onDocumentLoadFailure(error) | ||
}) | ||
} | ||
} | ||
function onDocumentLoadFailure(error) { | ||
console.error(`Error loading forge model: ${error}`) | ||
} | ||
} | ||
|
||
async function InitSuperVizRoomWithAutodesk(viewer) { | ||
const room = await window.SuperVizRoom.init(DEVELOPER_KEY, { | ||
roomId: groupId, | ||
group: { | ||
id: groupId, | ||
name: groupName, | ||
}, | ||
participant: { | ||
id: participant.toString(), | ||
name: "John " + participant, | ||
avatar: { | ||
imageUrl: `https://production.cdn.superviz.com/static/default-avatars/2.png`, | ||
model3DUrl: `https://production.storage.superviz.com/readyplayerme/2.glb`, | ||
}, | ||
}, | ||
}); | ||
const room = await window.SuperVizRoom.init(DEVELOPER_KEY, { | ||
roomId: groupId, | ||
group: { | ||
id: groupId, | ||
name: groupName, | ||
}, | ||
participant: { | ||
id: participant.toString(), | ||
name: 'John ' + participant, | ||
avatar: { | ||
imageUrl: `https://production.cdn.superviz.com/static/default-avatars/2.png`, | ||
model3DUrl: `https://production.storage.superviz.com/readyplayerme/2.glb`, | ||
}, | ||
}, | ||
}) | ||
|
||
const autodeskPresence = new window.Presence3D(viewer, { | ||
isAvatarsEnabled: true, | ||
isLaserEnabled: false, | ||
isNameEnabled: true, | ||
avatarConfig: { | ||
height: 0, | ||
scale: 10, | ||
laserOrigin: { x: 0, y: 0, z: 0 }, | ||
}, | ||
}); | ||
const autodeskPresence = new window.Presence3D(viewer, { | ||
isAvatarsEnabled: true, | ||
isLaserEnabled: false, | ||
isNameEnabled: true, | ||
avatarConfig: { | ||
height: 0, | ||
scale: 10, | ||
laserOrigin: { x: 0, y: 0, z: 0 }, | ||
}, | ||
}) | ||
|
||
room.addComponent(autodeskPresence); | ||
room.addComponent(autodeskPresence) | ||
} | ||
|
||
InitAutodesk(); | ||
InitAutodesk() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,5 @@ | |
"live-server": "^1.2.2" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
export const sampleInfo = { | ||
id: "superviz-contextual-comments-canvas-cdn-js", | ||
name: "Contextual Comments Canvas (Cdn/JavaScript)", | ||
}; | ||
export const sampleInfo = { id: 'superviz-contextual-comments-canvas-cdn-js', name: 'Contextual Comments Canvas (Cdn/JavaScript)' }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.