View package.json
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
{ | |
"name": "visual", | |
"description": "default_template_value", | |
"repository": { | |
"type": "default_template_value", | |
"url": "default_template_value" | |
}, | |
"license": "MIT", | |
"scripts": { | |
"pbiviz": "pbiviz", |
View index.html
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
<head> | |
<title>Viewer Loading Multi-Model with GLB</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="icon" href="data:,"> | |
<style> | |
#panel { | |
position: fixed; z-index: 2; margin: 10px; | |
font-family:arial; font-size:1.5em; } | |
</style> |
View convert-glb.mjs
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
// PURPOSE: convert draco-pnts to glb (ie. 3dTiles v1.0 to v1.1) | |
// INSTALL: npm install draco3d gltfpack | |
// RUN: | |
// > node infolderPNTS outfolderGLB | |
import fs from 'fs'; | |
import draco3d from 'draco3d'; | |
import gltfpack from 'gltfpack'; | |
const inFolder = process.argv.slice(2)[0] || 'infolder'; |
View pull-tiles-offline.mjs
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
// PURPOSE: download 3d-tiles files from BIM360, to local drive | |
// INSTALL: npm install node-fetch | |
// RUN: add your BIM360 access-token and the base url, then type | |
// > node pull-tiles-offline.mjs myOutputFolder | |
import fetch from 'node-fetch'; | |
import fs from 'fs'; | |
import util from 'util'; | |
import stream from 'stream'; |
View index.html
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
<header> | |
<style> | |
body { font-family: arial; margin: 0; } | |
.nav { | |
color: white; background-color: rgba(100, 100, 100, 0.5); | |
text-align: center; width: 100%; top: 0px; | |
position: fixed; z-index: 1; margin: 0px; | |
} | |
</style> | |
</header> |
View clone-three-mesh.html
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<link rel="icon" href="data:,"> |
View unlit-texture.js
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
function getFlatTexture_FlatMaterial(textureUrl) { | |
const shader = { | |
side: THREE.DoubleSide, | |
depthWrite: false, | |
depthTest: true, | |
uniforms: { | |
map: { value: THREE.ImageUtils.loadTexture(textureUrl), type: 't' } | |
}, | |
fragmentShader: ` | |
varying vec2 vUv; |
View convert.js
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
// convert SVF to dstPath/output.glb (with zeux compression) | |
// but only convert a subset of objects (see filter on line 23) | |
// INSTALL: | |
// > npm install forge-convert-utils forge-server-utils fs-extra gltfpack | |
// RUN: | |
// > node convert url guid token dstPath | |
const path = require('path'); |
View convert-gltf-to-glb.js
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
var fs = require('fs'); | |
function ConvertToGLB(gltf, outputFilename, sourceFilename) { | |
const Binary = { | |
Magic: 0x46546C67 | |
}; | |
const bufferMap = new Map(); | |
function decodeBase64(uri) { |
View 3dwood-uvw.js
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
function ensureMeshUvws(geometry) { | |
// If mesh has no uvws, generate them by copying the vertex position vectors | |
// (x,y,z) => (u,v,w). We apply no transform. All geometry loaded by lmvtk uses | |
// this interleaved vertex buffer approach. We have to get the vertex position | |
// vectors out of the interleaved vertex buffer. | |
if (!geometry.getAttribute('uvw')) { | |
let vbb = ggeom.vb; // should always be 3 | |
NewerOlder