-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cff18fb
commit 070ffeb
Showing
4 changed files
with
62 additions
and
0 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,22 @@ | ||
import { Color } from 'three'; | ||
import { IfcViewerAPI } from 'web-ifc-viewer'; | ||
|
||
const container = document.getElementById('viewer-container'); | ||
const viewer = new IfcViewerAPI({ container, backgroundColor: new Color(0xffffff) }); | ||
viewer.axes.setAxes(); | ||
viewer.grid.setGrid(); | ||
|
||
const input = document.getElementById("file-input"); | ||
|
||
window.ondblclick = () => viewer.IFC.selector.pickIfcItem(true); | ||
window.onmousemove = () => viewer.IFC.selector.prePickIfcItem(); | ||
viewer.clipper.active = true; | ||
|
||
window.onkeydown = (event) => { | ||
if (event.code === 'KeyP') { | ||
viewer.clipper.createPlane(); | ||
} | ||
else if (event.code === 'KeyO') { | ||
viewer.clipper.deletePlane(); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.