Add dat.gui, and enable to update dxf elevation for bim_2_overlay_with_dxf
This commit is contained in:
@ -37,7 +37,6 @@ import { DxfViewer, DxfViewerConfig, ModelConfig } from "@pattern-x/gemini-viewe
|
|||||||
|
|
||||||
const viewerCfg: DxfViewerConfig = {
|
const viewerCfg: DxfViewerConfig = {
|
||||||
containerId: "myCanvas",
|
containerId: "myCanvas",
|
||||||
enableToolbar: true,
|
|
||||||
enableSpinner: true,
|
enableSpinner: true,
|
||||||
enableLayoutBar: true,
|
enableLayoutBar: true,
|
||||||
};
|
};
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
NavCubePlugin,
|
NavCubePlugin,
|
||||||
SectionPlugin,
|
SectionPlugin,
|
||||||
} from "./demo/libs/gemini-viewer.esm.min.js";
|
} from "./demo/libs/gemini-viewer.esm.min.js";
|
||||||
|
import * as dat from "./demo/libs/dat.gui.module.js";
|
||||||
|
const gui = new dat.GUI();
|
||||||
|
|
||||||
const project = {
|
const project = {
|
||||||
"id": "building1",
|
"id": "building1",
|
||||||
@ -82,6 +84,22 @@
|
|||||||
// viewer.setToOrthographicCamera(false);
|
// viewer.setToOrthographicCamera(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// dat.gui controls
|
||||||
|
const controls = {
|
||||||
|
dxfElevation: 0,
|
||||||
|
}
|
||||||
|
// update dxf elevation between -2 to 30, default value is 17.
|
||||||
|
gui.add(controls, "dxfElevation", -2.0, 30.0, 0.1)
|
||||||
|
.name("Dxf elevation")
|
||||||
|
.setValue(17) // the origin value is 17
|
||||||
|
.onChange((val) => {
|
||||||
|
const dxf = viewer.loadedModels.find((model) => model.modelId.endsWith(".dxf"));
|
||||||
|
const object = dxf.object;
|
||||||
|
object.position.setY(val);
|
||||||
|
object.updateMatrix();
|
||||||
|
viewer.enableRender();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
const viewerCfg = {
|
const viewerCfg = {
|
||||||
containerId: "myCanvas",
|
containerId: "myCanvas",
|
||||||
language: "en",
|
language: "en",
|
||||||
enableToolbar: false,
|
|
||||||
}
|
}
|
||||||
const viewer = new BimViewer(viewerCfg);
|
const viewer = new BimViewer(viewerCfg);
|
||||||
|
|
||||||
|
2524
public/demo/libs/dat.gui.module.js
Normal file
2524
public/demo/libs/dat.gui.module.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user