Online 3D Viewer
repository·master·Indexed 25 days ago
https://github.com/kovacsv/online3dviewerAn open-source web-based tool and library for visualizing and exploring 3D models. It supports importing formats such as 3dm, 3ds, 3mf, dae, fbx, gltf, ifc, step, stl, and obj, and exporting to 3dm, bim, gltf, obj, off, stl, and ply. The tool can be deployed as a standalone website via StartWebsite() or integrated into other web projects using StartEmbed().
What's inside online-3d-viewer
- Online 3D Viewer is a free and open-source web solution designed to visualize and explore 3D models directly in a web browser. It provides both a hosted website (https://3dviewer.net) and a library that can be integrated into other projects. Developers can use the source code to host their own instance or build upon the underlying library.
Start the Online 3D Viewer website
masterInitialize the full website interface by callingStartWebsite(). This function expects specific DOM elements to exist in the document to populate the header, toolbar, main viewer, sidebar, and navigation components. It also handles drag-and-drop functionality and file loading. Note that embedding the full website in an iframe is not supported; if detected, it will display a warning message instead.Embed the Online 3D Viewer
masterUseStartEmbed()to initialize the lightweight embedded version of the viewer. This requires a container for the viewer and a container for the website link. This mode is intended for use within other web pages.Supported 3D file formats for Import and Export
masterOnline 3D Viewer supports a wide range of 3D file formats for both importing models into the viewer and exporting them.
Import formats: 3dm, 3ds, 3mf, amf, bim, brep, dae, fbx, fcstd, gltf, ifc, iges, step, stl, obj, off, ply, wrl.
Export formats: 3dm, bim, gltf, obj, off, stl, ply.
View model file licenses
masterThewebsite/assets/models/directory contains various 3D model files used for demonstration or testing. Each file is subject to specific licensing terms (e.g., MIT, GNU LGPL, Creative Commons). When using these specific assets in your own projects, ensure you comply with their respective licenses and provide attribution where required.Set a website event handler
masterConfigure a custom event handler for the website by passing an object toSetWebsiteEventHandler(eventHandler). This allows you to intercept and respond to internal viewer events.Access UI components and utilities
masterThe
UIobject provides access to various dialog components, event handling utilities, and localization tools:UI.ButtonDialog: Button-based dialog.UI.ProgressDialog: Progress indicator dialog.UI.ShowMessageDialog: Message display dialog.UI.HandleEvent: Utility for handling events.UI.Loc: Localization function.
Register Header and Toolbar plugins
masterExtend the viewer's UI by registering custom plugins to the header or toolbar areas usingRegisterHeaderPluginandRegisterToolbarPlugin.Access the Engine core
masterTheEngineobject is exported directly from the entry point, providing access to the underlying 3D engine core functionalities.