Merge pull request #2 from pattern-x/feature/upload-models

Added some gltf and dxf models
This commit is contained in:
yanzexuan
2022-11-04 20:34:47 +08:00
committed by GitHub
14 changed files with 1438083 additions and 94 deletions

View File

@ -4,8 +4,8 @@
"title": "本地模型加载",
"url": "./demo/empty_model_project.html"
}, {
"title": "technical school",
"url": "./demo/technical_school.html"
"title": "Duplex",
"url": "./demo/duplex.html"
}]
}, {
"title": "图纸",
@ -16,10 +16,10 @@
"title": "Rac Basic Sample Project",
"url": "./demo/dxf_0.html"
}, {
"title": "运维监控楼地下一层 、首层平面图",
"title": "城市公寓",
"url": "./demo/dxf_1.html"
}, {
"title": "厨房平面",
"title": "门窗大样",
"url": "./demo/dxf_2.html"
}, {
"title": "图纸对比",

View File

@ -33,13 +33,7 @@
const models= [{
modelId: "dxf_0",
name: "dxf_0",
src: "./demo/projects/dxf_test/dxf_0.dxf",
merge: true,
visible: true,
}, {
modelId: "dxf_0_1",
name: "dxf_0_1",
src: "./demo/projects/dxf_test/dxf_0_1.dxf",
src: "./demo/models/dxf/rac_basic_sample_project.dxf",
merge: true,
visible: true,
}];

View File

@ -20,7 +20,7 @@
const models = [{
modelId: "dxf_1",
name: "dxf_1",
src: "./demo/projects/dxf_test/dxf_1.dxf",
src: "./demo/models/dxf/apartments.dxf",
merge: true,
visible: true,
}];

View File

@ -20,7 +20,7 @@
const models = [{
modelId: "dxf_2",
name: "dxf_2",
src: "./demo/projects/dxf_test/dxf_2.dxf",
src: "./demo/models/dxf/doors_and_windows.dxf",
merge: true,
visible: true,
}];

View File

@ -19,8 +19,8 @@
import DxfSettingsPanel from "./demo/settings/DxfSettingsPanel.js";
import LayerManager from "./demo/layerManager/LayerManager.js";
const url1 = "./demo/projects/dxf_test/dxf_3.dxf";
const url2 = "./demo/projects/dxf_test/dxf_3_1.dxf";
const url1 = "./demo/models/dxf/dxf_3.dxf";
const url2 = "./demo/models/dxf/dxf_3_1.dxf";
const config = {
containerId: "myCanvas",
enableAxisGizmo: true,

View File

@ -66,8 +66,8 @@
import DxfSettingsPanel from "./demo/settings/DxfSettingsPanel.js";
import LayerManager from "./demo/layerManager/LayerManager.js";
const url1 = "./demo/projects/dxf_test/dxf_3.dxf";
const url2 = "./demo/projects/dxf_test/dxf_3_1.dxf";
const url1 = "./demo/models/dxf/dxf_3.dxf";
const url2 = "./demo/models/dxf/dxf_3_1.dxf";
const modelConfig1 = { modelId: "dxf_1", name: "dxf 1", src: url1, ignorePaperSpace: true };
const modelConfig2 = { modelId: "dxf_2", name: "dxf 2", src: url2, ignorePaperSpace: true };
const config = {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,74 +0,0 @@
<html>
<head>
<link rel="icon" href="./demo/favicon.ico" />
<link rel="stylesheet" type="text/css" href="./demo/global.css" />
</head>
<body>
<div id="viewerContainer">
<div id="myBimViewerContainer" class="renderer-container"></div>
</div>
<script type="module">
import { BimViewer, ToolbarMenuId } from "./demo/libs/gemini-viewer.esm.min.js";
const project = {
id: "technical_school",
name: "technical school",
thumbnail: "./demo/projects/technical_school/thumbnail.png",
camera: {
eye: [-65, 37, 41],
look: [-15, 0, 15],
},
models: [
{
name: "technical school",
src: "./demo/projects/technical_school/technical_school.gltf",
position: [0, 0, 0],
rotation: [0, 0, 0],
scale: [1, 1, 1],
instantiate: false,
merge: false,
edges: true,
visible: true,
},
],
};
const viewer = new BimViewer(
{
containerId: "myBimViewerContainer",
enableAxisGizmo: true,
enableStats: true,
toolbarMenuConfig: {
[ToolbarMenuId.Measure]: { visible: false },
[ToolbarMenuId.Fullscreen]: { visible: false },
[ToolbarMenuId.BimTree]: { visible: false },
},
enableBottomBar: true,
enableNavCube: false,
enableContextMenu: false,
},
project.camera
);
// loadProjectModel
let counter = 0; // to indicate how many models are loading
project.models.forEach((modelCfg) => {
if (modelCfg.visible === false) {
// visible is true by default
return; // only load visible ones
}
counter++;
viewer.loadModel(modelCfg, (event) => {
console.log(`[Demo] Loading model ${modelCfg.src}`);
}, (event) => {
console.error("Failed to load " + modelCfg.src + ". " + event.message);
}
).then(() => {
console.log(`[Demo] Loaded model ${modelCfg.src}`);
});
});
</script>
</body>
</html>

View File

@ -62,15 +62,15 @@
.code-editor .splitter {
float: left;
cursor: col-resize;
background-color: #ddd;
width: 1px;
background-color: #fff;
width: 2px;
height: 100vh;
z-index: 99;
}
.code-editor .view-box {
overflow: hidden;
border-left: 1px solid #ccc;
border-left: 0px solid #ccc;
background-color: #fff;
height: 100vh;
}