Merge branch 'dev' into navigator_redesign
This commit is contained in:
commit
d94dd7d862
29
libs/loaders/rhino3dm.min.js
vendored
29
libs/loaders/rhino3dm.min.js
vendored
File diff suppressed because one or more lines are too long
@ -20,10 +20,13 @@
|
||||
"test": "mocha test",
|
||||
"build": "node tools/run_python.js tools/build.py",
|
||||
"update": "node tools/run_python.js tools/update.py",
|
||||
"updatelibs": "node tools/run_python.js tools/updatelibs.py && npm run update",
|
||||
"updatelibs": "npm install && node tools/run_python.js tools/updatelibs.py",
|
||||
"svg": "node tools/run_python.js tools/svg.py"
|
||||
},
|
||||
"dependencies": {},
|
||||
"dependencies": {
|
||||
"rhino3dm": "7.7.0",
|
||||
"three": "0.134.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
"browser": true,
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
|
||||
<!-- engine start -->
|
||||
<script type="text/javascript" src="../source/core/core.js"></script>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
|
||||
<!-- engine start -->
|
||||
<script type="text/javascript" src="../source/core/core.js"></script>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
<!-- engine start -->
|
||||
<script type="text/javascript" src="../source/core/core.js"></script>
|
||||
<script type="text/javascript" src="../source/core/taskrunner.js"></script>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
|
||||
<!-- engine start -->
|
||||
<script type="text/javascript" src="../source/core/core.js"></script>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
|
||||
<!-- engine start -->
|
||||
<script type="text/javascript" src="../source/core/core.js"></script>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
<!-- engine start -->
|
||||
<script type="text/javascript" src="../source/core/core.js"></script>
|
||||
<script type="text/javascript" src="../source/core/taskrunner.js"></script>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
<!-- engine start -->
|
||||
<script type="text/javascript" src="../source/core/core.js"></script>
|
||||
<script type="text/javascript" src="../source/core/taskrunner.js"></script>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
<script type='text/javascript'>
|
||||
function HasHighpDriverIssue ()
|
||||
{
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../../libs/three.min.js"></script>
|
||||
<script type='text/javascript'>
|
||||
function Sandbox3D ()
|
||||
{
|
||||
|
||||
@ -63,14 +63,14 @@ def CreateDestinationDir (config, rootDir, websiteDir, version, testBuild):
|
||||
shutil.copytree (os.path.join (rootDir, 'website', 'o3dv', 'css', 'Quicksand'), os.path.join (websiteDir, 'o3dv', 'Quicksand'))
|
||||
shutil.copytree (os.path.join (rootDir, 'website', 'o3dv', 'css', 'O3DVIcons'), os.path.join (websiteDir, 'o3dv', 'O3DVIcons'))
|
||||
shutil.copytree (os.path.join (rootDir, 'website', 'info'), os.path.join (websiteDir, 'info'))
|
||||
|
||||
|
||||
libFiles = config['lib_files']
|
||||
importerFiles = ['o3dv/o3dv.min.js']
|
||||
websiteFiles = [
|
||||
'o3dv/o3dv.website.min.css',
|
||||
'o3dv/o3dv.website.min.js'
|
||||
]
|
||||
|
||||
|
||||
htmlFileNames = [
|
||||
'index.html',
|
||||
'embed.html',
|
||||
@ -112,9 +112,9 @@ def CreatePackage (rootDir, websiteDir, packageDir, version):
|
||||
zip.write (os.path.join (websiteDir, 'libs', 'loaders', lib), 'libs/loaders/' + lib)
|
||||
for lib in os.listdir (os.path.join (websiteDir, 'libs', 'three_loaders')):
|
||||
zip.write (os.path.join (websiteDir, 'libs', 'three_loaders', lib), 'libs/three_loaders/' + lib)
|
||||
zip.write (os.path.join (websiteDir, 'libs', 'three.min-r134.js'), 'three.min-r134.js')
|
||||
zip.write (os.path.join (websiteDir, 'libs', 'three.min.js'), 'three.min.js')
|
||||
zip.write (os.path.join (websiteDir, 'libs', 'three.license.md'), 'three.license.md')
|
||||
zip.write (os.path.join (websiteDir, 'o3dv', 'o3dv.min.js'), 'o3dv.min-' + version + '.js')
|
||||
zip.write (os.path.join (websiteDir, 'o3dv', 'o3dv.min.js'), 'o3dv.min.js')
|
||||
zip.write (os.path.join (rootDir, 'LICENSE.md'), 'o3dv.license.md')
|
||||
zip.close ()
|
||||
return True
|
||||
@ -123,7 +123,7 @@ def Main (argv):
|
||||
toolsDir = os.path.dirname (os.path.abspath (__file__))
|
||||
rootDir = os.path.dirname (toolsDir)
|
||||
os.chdir (rootDir)
|
||||
|
||||
|
||||
testBuild = False
|
||||
buildDir = os.path.join (rootDir, 'build', 'final')
|
||||
if len (argv) >= 2 and argv[1] == 'test':
|
||||
@ -145,7 +145,7 @@ def Main (argv):
|
||||
if not esLintResult:
|
||||
PrintError ('ESLint importer sources failed.')
|
||||
return 1
|
||||
|
||||
|
||||
PrintInfo ('ESLint website sources.')
|
||||
esLintResult = ESLintFolder (os.path.join (rootDir, 'website', 'o3dv'))
|
||||
if not esLintResult:
|
||||
@ -181,5 +181,5 @@ def Main (argv):
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
sys.exit (Main (sys.argv))
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
{
|
||||
"lib_files" : [
|
||||
"libs/jquery-3.5.1.min.js",
|
||||
"libs/pickr.monolith.min-1.8.2.css",
|
||||
"libs/pickr.es5.min-1.8.2.js",
|
||||
"libs/three.min-r134.js"
|
||||
"libs/jquery.min.js",
|
||||
"libs/pickr.monolith.min.css",
|
||||
"libs/pickr.es5.min.js",
|
||||
"libs/three.min.js"
|
||||
],
|
||||
"engine_files" : [
|
||||
"source/core/core.js",
|
||||
|
||||
@ -8,13 +8,18 @@ import urllib.request
|
||||
|
||||
from lib import tools_lib as Tools
|
||||
|
||||
threeJsFilesMap = [
|
||||
[os.path.join ('build', 'three.min.js'), os.path.join ('three.min-$TAG_NAME$.js')],
|
||||
[os.path.join ('examples', 'js', 'libs', 'chevrotain.min.js'), os.path.join ('three_loaders', 'chevrotain.min.js')],
|
||||
[os.path.join ('examples', 'js', 'loaders', '3MFLoader.js'), os.path.join ('three_loaders', '3MFLoader.js')],
|
||||
[os.path.join ('examples', 'js', 'loaders', 'ColladaLoader.js'), os.path.join ('three_loaders', 'ColladaLoader.js')],
|
||||
[os.path.join ('examples', 'js', 'loaders', 'FBXLoader.js'), os.path.join ('three_loaders', 'FBXLoader.js')],
|
||||
[os.path.join ('examples', 'js', 'loaders', 'VRMLLoader.js'), os.path.join ('three_loaders', 'VRMLLoader.js')]
|
||||
threeJsFileMap = [
|
||||
[os.path.join ('three', 'build', 'three.min.js'), os.path.join ('three.min.js')],
|
||||
[os.path.join ('three', 'examples', 'js', 'libs', 'chevrotain.min.js'), os.path.join ('three_loaders', 'chevrotain.min.js')],
|
||||
[os.path.join ('three', 'examples', 'js', 'loaders', '3MFLoader.js'), os.path.join ('three_loaders', '3MFLoader.js')],
|
||||
[os.path.join ('three', 'examples', 'js', 'loaders', 'ColladaLoader.js'), os.path.join ('three_loaders', 'ColladaLoader.js')],
|
||||
[os.path.join ('three', 'examples', 'js', 'loaders', 'FBXLoader.js'), os.path.join ('three_loaders', 'FBXLoader.js')],
|
||||
[os.path.join ('three', 'examples', 'js', 'loaders', 'VRMLLoader.js'), os.path.join ('three_loaders', 'VRMLLoader.js')]
|
||||
]
|
||||
|
||||
rhino3dmFileMap = [
|
||||
[os.path.join ('rhino3dm', 'rhino3dm.js'), os.path.join ('loaders', 'rhino3dm.min.js')],
|
||||
[os.path.join ('rhino3dm', 'rhino3dm.wasm'), os.path.join ('loaders', 'rhino3dm.wasm')],
|
||||
]
|
||||
|
||||
def PrintInfo (message):
|
||||
@ -23,57 +28,23 @@ def PrintInfo (message):
|
||||
def PrintError (message):
|
||||
print ('ERROR: ' + message)
|
||||
|
||||
def DownloadFile (url, resultPath):
|
||||
PrintInfo ('Downloading ' + url)
|
||||
urllib.request.urlretrieve (url, resultPath)
|
||||
|
||||
def UnzipFile (zipPath, resultFolder):
|
||||
PrintInfo ('Unzipping ' + zipPath)
|
||||
with zipfile.ZipFile (zipPath, 'r') as zipFile:
|
||||
zipFile.extractall (resultFolder)
|
||||
|
||||
def UpdateThreeJs (rootDir, tempDir):
|
||||
libsDir = os.path.join (rootDir, 'libs')
|
||||
for fileName in os.listdir (libsDir):
|
||||
if (fileName.startswith ('three.min-')):
|
||||
os.remove (os.path.join (libsDir, fileName))
|
||||
|
||||
response = urllib.request.urlopen ('https://api.github.com/repos/mrdoob/three.js/releases/latest')
|
||||
responseJson = json.loads (response.read ())
|
||||
|
||||
threeJsTagName = responseJson['tag_name']
|
||||
|
||||
threeJsFileName = 'three.js-' + threeJsTagName
|
||||
threeJsZipPath = os.path.join (tempDir, threeJsFileName + '.zip')
|
||||
threeJsExtractedFolderPath = os.path.join (tempDir, threeJsFileName)
|
||||
|
||||
DownloadFile ('https://github.com/mrdoob/three.js/archive/refs/tags/' + threeJsTagName + '.zip', threeJsZipPath)
|
||||
UnzipFile (threeJsZipPath, threeJsExtractedFolderPath)
|
||||
|
||||
for threeJsFile in threeJsFilesMap:
|
||||
src = os.path.join (tempDir, threeJsFileName, threeJsFileName, threeJsFile[0])
|
||||
dst = os.path.join (libsDir, threeJsFile[1].replace ('$TAG_NAME$', threeJsTagName))
|
||||
def UpdateModule (fileMap, moduleDir, libsDir):
|
||||
for fileEntry in fileMap:
|
||||
src = os.path.join (moduleDir, fileEntry[0])
|
||||
dst = os.path.join (libsDir, fileEntry[1])
|
||||
PrintInfo ('Copying file ' + os.path.split (src)[1])
|
||||
shutil.copy2 (src, dst)
|
||||
|
||||
PrintInfo ('Replacing file name')
|
||||
configFilePath = os.path.join (rootDir, 'tools', 'config.json')
|
||||
Tools.ReplaceRegexInFile (configFilePath, 'three.min-r?[0-9]+.js', 'three.min-' + threeJsTagName + '.js')
|
||||
buildScriptPath = os.path.join (rootDir, 'tools', 'build.py')
|
||||
Tools.ReplaceRegexInFile (buildScriptPath, 'three.min-r?[0-9]+.js', 'three.min-' + threeJsTagName + '.js')
|
||||
|
||||
def Main (argv):
|
||||
toolsDir = os.path.dirname (os.path.abspath (__file__))
|
||||
rootDir = os.path.dirname (toolsDir)
|
||||
os.chdir (rootDir)
|
||||
|
||||
tempDir = os.path.join (rootDir, 'build', 'temp')
|
||||
if os.path.exists (tempDir):
|
||||
shutil.rmtree (tempDir)
|
||||
os.makedirs (tempDir)
|
||||
nodeModulesDir = os.path.join (rootDir, 'node_modules')
|
||||
libsDir = os.path.join (rootDir, 'libs')
|
||||
|
||||
UpdateThreeJs (rootDir, tempDir)
|
||||
shutil.rmtree (tempDir)
|
||||
UpdateModule (threeJsFileMap, nodeModulesDir, libsDir)
|
||||
UpdateModule (rhino3dmFileMap, nodeModulesDir, libsDir)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@ -5,19 +5,19 @@
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
<link rel="icon" type="image/png" href="assets/images/3dviewer_net_favicon.ico">
|
||||
|
||||
|
||||
<title>Online 3D Viewer Embedded</title>
|
||||
|
||||
<!-- meta start -->
|
||||
<!-- meta end -->
|
||||
|
||||
<!-- libs start -->
|
||||
<script type="text/javascript" src="../libs/jquery-3.5.1.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../libs/pickr.monolith.min-1.8.2.css">
|
||||
<script type="text/javascript" src="../libs/pickr.es5.min-1.8.2.js"></script>
|
||||
<script type="text/javascript" src="../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../libs/jquery.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../libs/pickr.monolith.min.css">
|
||||
<script type="text/javascript" src="../libs/pickr.es5.min.js"></script>
|
||||
<script type="text/javascript" src="../libs/three.min.js"></script>
|
||||
<!-- libs end -->
|
||||
|
||||
|
||||
<!-- engine start -->
|
||||
<script type="text/javascript" src="../source/core/core.js"></script>
|
||||
<script type="text/javascript" src="../source/core/taskrunner.js"></script>
|
||||
@ -81,7 +81,7 @@
|
||||
<script type="text/javascript" src="../source/viewer/viewer.js"></script>
|
||||
<script type="text/javascript" src="../source/viewer/domviewer.js"></script>
|
||||
<!-- engine end -->
|
||||
|
||||
|
||||
<!-- website start -->
|
||||
<link rel="stylesheet" type="text/css" href="o3dv/css/icons.css">
|
||||
<link rel="stylesheet" type="text/css" href="o3dv/css/themes.css">
|
||||
|
||||
@ -9,10 +9,10 @@
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<!-- libs start -->
|
||||
<script type="text/javascript" src="../libs/jquery-3.5.1.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../libs/pickr.monolith.min-1.8.2.css">
|
||||
<script type="text/javascript" src="../libs/pickr.es5.min-1.8.2.js"></script>
|
||||
<script type="text/javascript" src="../libs/three.min-r134.js"></script>
|
||||
<script type="text/javascript" src="../libs/jquery.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../libs/pickr.monolith.min.css">
|
||||
<script type="text/javascript" src="../libs/pickr.es5.min.js"></script>
|
||||
<script type="text/javascript" src="../libs/three.min.js"></script>
|
||||
<!-- libs end -->
|
||||
|
||||
<!-- meta start -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user